-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExplicitWait.java
More file actions
28 lines (24 loc) · 1.15 KB
/
ExplicitWait.java
File metadata and controls
28 lines (24 loc) · 1.15 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
package VINDVG1.Vinay27;
import java.time.Duration;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.WebElement;
public class ExplicitWait {
public static void main(String[] args) {
WebDriverManager.chromedriver().setup();
WebDriver driver = new ChromeDriver();
driver.get("https://sellglobal.ebay.in/seller-center/");
driver.manage().window().maximize();
WebElement element = driver.findElement(By.xpath("//*[@id=\"menu-header-1\"]/li[1]/a"));
Actions act = new Actions(driver);
act.moveToElement(element).perform();
WebDriverWait wait=new WebDriverWait(driver,Duration.ofSeconds(10));
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@id=\"menu-header-1\"]/li[1]/div/div/section/div/div/div/section/div/div[1]/div/div[3]/div/div/a/span/span"))).click();
System.out.println("Script sucess");
}
}