« first day (106 days earlier)    last day (14 days later) » 

5:52 AM
Hi @paul, Greetings
Welcome to the selenium Community !
 
Hey karthik,
 
@paul, i am looking to the issue,
 
thanks
 
So you script prints the title as you wanted right ?
 
yes, but the problem is I want webdriver to actually switch to the new tab, but thats not happening. Mark is saying that it wouldn't happen, but then I pasted another where switch to another window is happening.
Whats wrong in here?
 
6:08 AM
Just do me a favor, After switching to the tab, do at least one action , say clicking an element .
And see, whether it switches or not
 
gimme 5 - 10 minutes, lemme try that.
 
6:24 AM
Sure, Take you time
 
6:40 AM
I tried, but it stayed on the "parent tab" (the focus stayed there)and gave the element not found exception, as the element I wanted to click was for new tabs only not for parent window.
 
Is it possible to share the code snippet that can reproduce this issue
 
Yes
import java.util.ArrayList;
import java.util.List;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.events.EventFiringWebDriver;

public class Checklist {

public static WebDriver driver;

public static void main(String[] args) {
 
I need complete working copy dude,
In case, i f can not share them, create a mock on with public sites like google are somthing else
 
you meant you want the website name?
 
6:55 AM
it can be flipkart.com, just open four links in different tabs of same browser window.
 
Do you want me to build my own example
?
 
oh I am sorry, let me give you working code, using which you can reproduce the error at your end.
gimem some time
 
@paul, Thanks dude, Hope you understand me. Take your time and show me the code, Let's see how can i possibly help you in this issue
 
Ok
 
7:22 AM
private static void flipkartexample() {
// TODO Auto-generated method stub
EventFiringWebDriver efw = new EventFiringWebDriver(driver);
driver.get("http://www.flipkart.com/");
List<WebElement> list = driver.findElements(By
.xpath(".//*[@id='fk-mainbody-id']/div/div[1]/ul/li"));
System.out.println(list.size());
for (int i = 2; i <5; i++) {
efw.getKeyboard().pressKey(Keys.CONTROL);
driver.findElement(By
.xpath("//*[@id='fk-mainbody-id']/div/div[1]/ul/li["+i+"]/a")).click();
efw.getKeyboard().releaseKey(Keys.CONTROL);
code should move to tabs and for each tab it should click the logo of the website, but instead it stayed on the parenttab and keep clickcing logo there.
 
7:44 AM
karthik, you there?
 
 
3 hours later…
10:51 AM
@paul, i am sorry, i caught up with something here
I will check and let you know !
 

« first day (106 days earlier)    last day (14 days later) »