Println not printing value | Selenium Forum
M
Posted on 17/05/2016
public class test1 {


public void method() {
WebDriver d= new FirefoxDriver();
d.get("https://www.google.com/intl/en/mail/help/about.html");
String w1=d.findElement(By.xpath("html/body/div/div/div[2]")).getText();
System.out.println("String name is"+w1);


String w2=d.findElement(By.xpath("html/body/div/div/div[2]/a ")).getText();
System.out.println("String name is"+w2);

}
}

M
Replied on 18/05/2016

w1 and w2 must be empty please check the xpath of web element.


M
Replied on 23/05/2016

No I don't see it ...
I have pasted the code also.


M
Replied on 24/05/2016

[quote:2cfu601f]No I don't see it ...
[/quote:2cfu601f]

what don't you see?


M
Replied on 24/05/2016

there is not text where your xpath is pointing.

Responsive image