Вопрос

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.

Это было полезно?

Решение 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/)

Другие советы

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);
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top