0

I am using Selenium IDE to make a automation scripts. In my code there is a page where when i select some options the 'Next' button gets disabled for a while. I have used a 'pause' statement for the time when the button is disabled but when i re-run my scripts in Selenium IDE, the 'Next' button does not get clicked most of the time. Does anyone have any solution for this sort of a problem?

1

Use webdriverWait and ExpectedConditions:

from selenium2.webdriver.common.by import By
from selenium2.webdriver.support.ui import WebDriverWait
from selenium2.webdriver.support import expected_conditions as EC

WebDriverWait(driver, WAIT).until(EC.element_to_be_clickable((By.ID, id)))

  • I am using Selenium IDE for now! And i have used the pause statement but still doesn't work. – Jarree Arham Shahid Sep 18 '14 at 6:32
  • You may add longer wait, but it will waste more time when response is faster, making test slower. And it still might fail sometimes - just less often. Reason why people use webdriver and not Se IDE is better control. Good luck! – Peter M. - stands for Monica Sep 18 '14 at 18:30
  • Adding a wait doesnot help at all. i cant figure out whats wrong. – Jarree Arham Shahid Sep 19 '14 at 7:18
0

Have you tried adding the Selenium IDE: Implicit Wait add-on? It might give you what you are looking for.

"This plugin allows Selenium IDE to automatically wait until the element is found before executing each command using a locator. It is equivalent to the implicit wait function available with Selenium 2 WebDrivers."

https://addons.mozilla.org/en-US/firefox/addon/selenium-ide-implicit-wait/

  • I think my 'Next' button does get executed as all the next operations run successfully. Its just that the next page doesn't appear on my screen. – Jarree Arham Shahid Sep 22 '14 at 6:53
  • The 'Next" does get executed and clicked i guess because the next operations are executed successfully. and when i hit the next button for the first time manually then it does click on it and navigate to the next page everyother time. – Jarree Arham Shahid Sep 22 '14 at 7:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.