-
Notifications
You must be signed in to change notification settings - Fork 0
/
ToolTip1.java
36 lines (30 loc) · 1.04 KB
/
ToolTip1.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package VINDVG1.Vinay27;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
import io.github.bonigarcia.wdm.WebDriverManager;
public class ToolTip1 {
public static void main(String[] args) throws InterruptedException {
WebDriverManager.chromedriver().setup();
WebDriver driver = new ChromeDriver();
driver.navigate().to("https://jqueryui.com/tooltip/");
driver.manage().window().maximize();
WebElement iframe = driver.findElement(By.xpath("//*[@id=\"content\"]/iframe"));
driver.switchTo().frame(iframe);
String Srr = driver.findElement(By.xpath("/html/body/p[4]/label")).getText();
System.out.println(Srr);
String dr = "Your age:";
if(Srr.equals(dr))
{
System.out.println("Pass - Tooltip title matched");
}
else
{
System.out.println("Fail - Tooltip title not matched");
}
System.out.println("Script sucess");
driver.quit();
}
}