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, 2019 in Selenium by anonymous
1,101 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,460 points
16,030 views
0 votes
1 answer

How to open Firefox window in Incognito mode using Selenium Webdriver?

Hi Pritha, you can use this code ...READ MORE

answered May 14, 2019 in Selenium by Anvi
• 14,150 points
7,126 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 27, 2018 in Selenium by nsv999
• 5,500 points
8,115 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,500 points
3,114 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP