Question

I'm using selenium testng format for testing my UI. I want to shift my focus from my main window to another window, where i click on a link before the page on my main window has finished loading.

Était-ce utile?

La solution 2

Well i found a way around my problem. Instead of trying to shift the focus from one page to another i just ran the tests parallel to each other.

For more info you can check this link:
(http://blog.wedoqa.com/2013/07/how-to-run-parallel-tests-with-selenium-webdriver-and-testng-2/)

Autres conseils

Clicking an Element on page load is even possible on webdriver; By default, webdriver wait for the entire page to load and then picks the element. The links and texts are visible but they are not clickable; However, it works well on Selenium IDE picking elements on page load.

I hope the below Firefox profile will help you to do the same for switching windows.

Webdriver make use of the FirefoxProfile to avoid such risks; It's applicable only for Firefox browser.

FirefoxProfile fp = new FirefoxProfile();
fp.setPreference("webdriver.load.strategy", "unstable");
driver = new FirefoxDriver(fp);
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top