Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Geting issues in identifying the elsements in webdriver
Fri Feb 17, 2017 4:41 pm by janbaskt

» WebDriver - why not to use a singlton for it?
Fri Feb 17, 2017 4:40 pm by janbaskt

» WebDriver session when using testng annotation to invoke driver instance
Fri Feb 17, 2017 4:39 pm by janbaskt

» Selenium fails to launch Chrome
Fri Feb 17, 2017 4:39 pm by janbaskt

» why do i get this error
Fri Feb 17, 2017 4:38 pm by janbaskt

» Selenium Tutorial
Thu Feb 16, 2017 5:21 pm by Rahul

» When to use Selenium IDE, RC and WebDriver
Mon Feb 13, 2017 2:35 pm by azharuddin

» How to integrate selenium with ZAPI-Zephyr
Sat Feb 11, 2017 2:25 am by gseera002c

» Selenium Webdriver
Sat Feb 04, 2017 6:47 pm by soumyamishrav@gmail.com

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


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