0

I have used actions class to scroll down but when it scrolls down click code is not working:

  driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
        
  Actions actions = new Actions(driver);
  actions.SendKeys(Keys.PageDown).Build().Perform();
       
       
 driver.FindElement("//a[@href='http://automationpractice.com/index.php? 
 controller=order&step=1']").Click();
        
 //var ele = driver.FindElement(proceed);
 //actions.MoveToElement(ele).Click().Perform();

enter image description here
Please use below id pass to login:

ID : [email protected]

Password : Pass123##

3
  • Can you provide the more detail, like the error, and html source for the click action. Commented May 19, 2022 at 10:13
  • Now it's working by using href, but is it right to use directly href in XPath? Commented May 20, 2022 at 11:18
  • I have edited the code in question, kindly take a look, plus link is added this error is on summary page. Commented May 20, 2022 at 11:28

1 Answer 1

0

Instead of scrolling approsimatively with PageDown, you should perform scrolling to element in a precise way. Let me know if it works for you

var element = driver.FindElement("//a[@href='http://automationpractice.com/index.php?controller=order&step=1']");
actions.MoveToElement(element);
actions.Perform();
element.Click();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.