-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImplictWait.java
30 lines (26 loc) · 1.29 KB
/
ImplictWait.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
package VINDVG1.Vinay27;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import io.github.bonigarcia.wdm.WebDriverManager;
public class ImplictWait {
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();
//driver.manage().timeouts().implicitlyWait(50,TimeUnit.SECONDS);
//driver.manage().timeouts().pageLoadTimeout(50,TimeUnit.SECONDS);
driver.manage().timeouts().setScriptTimeout(10,TimeUnit.SECONDS);
//it will search for elements and check for overall browser its global applicable to all elements present in script
WebElement element = driver.findElement(By.xpath("//*[@id=\"menu-header-1\"]/li[1]/a"));
Actions act = new Actions(driver);
act.moveToElement(element).perform();
WebElement ele = driver.findElement(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"));
ele.click();
System.out.println("Script sucess");
}
}