I want to provide focus to another window in firefox while switching between two windows

0 votes
if(BrowserLaunch.browser.equalsIgnoreCase("Firefox"))

{

WebDriverWait wait = new WebDriverWait(Driver.driver, 120);

String parentWin = Driver.driver.getWindowHandle();

Thread.sleep(1000);

BookPlayer.btn_Vocabulary().click();

Thread.sleep(1000);

Driver.driver.switchTo().window(Login_Action.parentWin);

System.out.println(Driver.driver.getTitle());

for (String childWin : Driver.driver.getWindowHandles())

{

if(!Login_Action.parentWin.equals(childWin)){

Driver.driver.switchTo().window(childWin);

Driver.driver.close();

break;

}

}

Thread.sleep(5000);

Driver.driver.switchTo().window(parentWin);
Mar 27 in Selenium by anonymous
176 views
please format your code properly.
So can you tell more about what problem you are facing?

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Selenium

0 votes
1 answer

How to switch between two windows in browser using Selenium java

Yes, this is possible. First, you need ...READ MORE

answered Sep 25, 2018 in Selenium by Meci Matt
• 9,400 points
1,288 views
0 votes
1 answer
0 votes
1 answer

Selenium ChromeDriver issue - Want to run it in background, but not as headless browser

This is a flaw with ChromeDriver. Tried ...READ MORE

answered Mar 26, 2018 in Selenium by nsv999
• 5,030 points
582 views
0 votes
1 answer

Need to switch between frames in Selenium

For switching between frames, use driver.switchTo().frame(). First ...READ MORE

answered Apr 6, 2018 in Selenium by nsv999
• 5,030 points
401 views
0 votes
1 answer

How do i change the location where my file gets downloaded in Selenium Webdriver and firefox driver?

There are a couple of errors there. ...READ MORE

answered Apr 12, 2018 in Selenium by nsv999
• 5,030 points
788 views
0 votes
1 answer

How can I Install Selenium IDE in Firefox

Selenium IDE works with all Firefox versions, ...READ MORE

answered Apr 13, 2018 in Selenium by Meci Matt
• 9,400 points
43 views
0 votes
1 answer

How to open a browser windows silently in the background?

It is a little bit of a ...READ MORE

answered Apr 20, 2018 in Selenium by king_kenny
• 3,590 points
58 views
0 votes
1 answer

Need to control the file download dialog box in Mozilla Firefox

Well for Firefox, there is something called ...READ MORE

answered Apr 20, 2018 in Selenium by king_kenny
• 3,590 points
76 views
0 votes
1 answer

How to handle the popup of file upload in Windows OS with WebDriver?

The value of name locator has probably ...READ MORE

answered Apr 25, 2018 in Selenium by king_kenny
• 3,590 points
1,487 views
0 votes
1 answer

Need to know the differences between .// and //* in XPath?

The expressions your talking about, select different ...READ MORE

answered Apr 29, 2018 in Selenium by king_kenny
• 3,590 points
278 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.