Question

My problem is that the site from which I have to fetch data is taking too much time in loading which increases the execution time of my testcase. I don't want to wait for whole site to load. What can I do? I have used timeout of 30 sec but it doesn't throw exception even if time is exceeded. May be all the javascripts are called in the onload event of webpage. It is very important to decrease the execution time of the test case, I have just started working with selenium and don't have thorough knowledge, please help me out

Was it helpful?

Solution

Using FireFox you can try webdriver.load.strategy = unstable. Maybe it will suits you.
Check here.

Unfortunately usually webdriver waits for whole page to be loaded. I got similar problem with testing pages like Youku - sometimes 3min it's not enough to get content.

You can also try with:
IJavaScriptExecutor js = (IJavaScriptExecutor)Driver; js.ExecuteScript("return window.stop");
It worked for me locally although on VMs I had still the same problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top