0

I am getting below exception even when my element has already been clicked and i am navigated to next page.

Caused by: org.openqa.selenium.TimeoutException: Expected condition failed: waiting for element to be clicked: [[ChromeDriver: chrome on XP (56f040029c23126b0087ff1dfa82369e)] -> xpath: //*[@id='login']/app-root/app-caf-login/div/div/div[2]/form/div[3]/div/div/button] (tried for 10 second(s) with 500 milliseconds interval)

Verifying XPAth but since element is already clicked them not sure why error is coming.

Description: Click the Sign In Button

 action: org.getopentest.selenium.Click
        args:
          locator: { xpath: "//*[@id='login']/app-root/app-caf-login/div/div/div[2]/form/div[3]/div/div/button" }

Description: Pause for 60 second

action: org.getopentest.selenium.ActionsPause
        args:
          durationMs: "60000"

Expected : no error should be there

Sfili_81
  • 2,377
  • 8
  • 27
  • 36
  • Possible duplicate of [timeout Exception even when element is already clicked](https://stackoverflow.com/questions/56294991/timeout-exception-even-when-element-is-already-clicked) – Adrian Theodorescu May 28 '19 at 18:19

1 Answers1

0

As described in this answer make sure you don't use the sendEnter: true argument with any of the SendKeys actions. When you pass sendEnter: true , the action will "press" the enter key after sending the keys to the textbox element. So basically, in the test you showed, the first action will input the username and then press enter, thus trying to log in without a password, which will of course fail.

Also, you are using the ActionsPause keyword incorrectly (more info here). If you want to introduce a delay in your test, you can use the $delay() API, but you very rarely need to do this with OpenTest, since synchronization is built-in, meaning all test actions that perform some work on a UI element know how to wait for that element to be available before doing the work.

Adrian Theodorescu
  • 11,664
  • 2
  • 23
  • 30