Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» how to connect DB in selenium webriver
Fri Oct 06, 2017 4:09 pm by anbarasi

» How find any text in browser screen and click on it?
Thu Oct 05, 2017 2:02 pm by sandeepkommineni

» Selenium Webdriver
Tue Oct 03, 2017 1:35 pm by PiyushBiswas

» GRID setup tutorial.
Wed Sep 27, 2017 4:29 pm by johnyapp

» Drag & Drop Between Windows Using Selenium Driver
Wed Sep 27, 2017 2:10 pm by 26rondel

» Check if window is closed / verify input
Sat Sep 23, 2017 10:21 pm by brainstir

» How to work on pages with AJAX in selenium?
Mon Sep 18, 2017 6:08 pm by azharuddin

» pause test until user press a key like F2
Wed Aug 09, 2017 11:10 pm by djnforce

» Selecting the input for auto populating element
Sat Jul 29, 2017 7:53 pm by kdabbara

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