I am new to selenium. My application is very old application developed in 2004-2006 and every other action opens up a new window. I am using selenium web driver for internet explorer for writing the automated test cases.
I switch between opened windows using driver.switchTo().window(windowname);
however my test cases fail when my tests are run on other environments where the response time of my application differs from time to time. due to which sometimes my test cases pass and they fail other times. Currently i am using Thread.sleep(THRESHOLD)
, and i know its bad practice. I am aware of WebDriverWait
and the three waits Implicit, Explicit, Fluent. But my problem is none of them wait indefinitely till i get a response. Every wait needs a threshold value till which it will check if the page is ready and if the response is not within the threshold then it will fail. Is there anyway where i can dynamically wait for the response, where sometimes the response will be immediate and sometimes it will be delayed. I all cases i should not enter any threshold value, and test cases should wait for the response irrespective of whatever the response time might be.