Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» FlexMonkium Download Not available under Gorillalogic site
Thu Dec 08, 2016 5:40 pm by bhanu.praveen

» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

unable to switch to 'current active tab' in chrome using webdriver in java

View previous topic View next topic Go down

unable to switch to 'current active tab' in chrome using webdriver in java

Post by mnsam on Sun Mar 13, 2016 3:41 pm

I am unable to switch to the 'current active tab' in Chrome using WebDriver. I have tried the following:
We can switch to tab, however we do not know which one is the current active tab

I have tried driver.switchTo().activeElement() however it is of no help
I have tried driver.switchTo().Window(""), doesn't work
Tried the following snippet.
Set allWindowHandles = driver.getWindowHandles();  
  for (String windowHandle : allWindowHandles) {
   if (!windowHandle.equals()) {
      driver.switchTo().window(windowHandle);
   }
}
However getting the current active tab handle is the issue.

mnsam

Posts : 1
Join date : 2016-03-13

Back to top Go down

Re: unable to switch to 'current active tab' in chrome using webdriver in java

Post by murthi on Thu Apr 14, 2016 8:05 pm

Normally there will be only one tab and if you click on a click, it may open the new window or it may open in the same browser as new tab.

To switch to new window, you can use driver.switchTo().window().

To switch to new tab, you can can you use send keys with Ctrl + Tab.

driver.findElement(By.xpath("/html/body")).sendKeys(keys.chrod(keys.Ctrl+Keys.TAB));

I have used one of my test case. It worked. You can tried this way.

Regards,
Murthi. S

murthi
Active particpant
Active particpant

Posts : 11
Join date : 2016-04-14
Location : Bangalore

Back to top Go down

Re: unable to switch to 'current active tab' in chrome using webdriver in java

Post by vini546 on Thu May 12, 2016 8:50 pm

Thanks mate. I've tried and it's working perfect.

- Vinay

vini546
Active particpant
Active particpant

Posts : 10
Join date : 2012-07-15
Location : Ahmedabad

Back to top Go down

Re: unable to switch to 'current active tab' in chrome using webdriver in java

Post by Sponsored content Today at 3:51 pm


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum