-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTooltip.java
More file actions
35 lines (30 loc) · 1 KB
/
Tooltip.java
File metadata and controls
35 lines (30 loc) · 1 KB
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
package VINDVG1.Vinay27;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import io.github.bonigarcia.wdm.WebDriverManager;
public class Tooltip {
public static void main(String[] args) {
WebDriverManager.chromedriver().setup();
//CASE 1: Using getAttribute
WebDriver driver = new ChromeDriver();
driver.get("https://demoqa.com/tool-tips/");
System.out.println("Tooltip web Page Displayed");
//Maximise browser window
driver.manage().window().maximize();
// Get element for which we need to find tooltip
String ageTextBox = driver.findElement(By.id("toolTipButton")).getText();
System.out.println(ageTextBox);
String srce = "Hover me to see";
if(ageTextBox.equalsIgnoreCase(srce))
{
System.out.println("Pass : Tooltip matching expected value");
}
else
{
System.out.println("Fail : Tooltip NOT matching expected value");
}
// Close the main window
//driver.close();
}
}