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
192 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,420 points
3,057 views
0 votes
1 answer
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,090 points
969 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,090 points
772 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,090 points
1,514 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,420 points
119 views