Tejashree Kutte
Tejashree Kutte

Reputation: 104

Why explicit wait is waiting for entire wait time even though element is visible/clickable before the wait time is over

I have given a wait time for 60 sec, and i am using wait until element to be clickable/visible but script is waiting for whole 30 secs even though the element is visible on UI and also clickable?

I tried using latest selenium version, tried using different waits also using different locators. but it did not work

Upvotes: 0

Views: 446

Answers (1)

Dmitri T
Dmitri T

Reputation: 167992

The reasons could be in:

  1. The element belongs to iframe so you need to switch to the iframe prior to attempting locating anything inside it
  2. The element belongs to Shadow DOM so you need to locate ShadowRoot object, cast it to the WebElement and find the sub-element you want to click
  3. Your locator is not correct, try getting the page source and saving it to a file. Once done use your favourite browser developer tools to locate the elemen
  4. The syntax of your Explicit Wait is not correct. Check out Explicit Waits and How to use Selenium to test web applications using AJAX technology for code examples

Going forward consider adding page source and your code to your question as the chance you will get the comprehensive answer will be much higher, otherwise we have to go for "blind shots"

Upvotes: 1

Related Questions