I am trying to click on Sign in link on site alibaba.com
This is my test case:
public class TestCase {
public static void main(String[] args) th
public static void waitVisibilityOfElementLocated(WebDriver driver, String locator) {
String key = "";
WebElement element = null;
try {
key = Utility.fetchLocatorKey(locator);
} catch (Exception e) {
System.out.println("Exception in getText method, " + e.getMessage());
}
if (key.endsWith("id")) {
WebDriverWait wait = new WebDriverWait(driver, 60);
element = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id(locator)));
} else if (key.endsWith("cssselector")) {
WebDriverWait wait = new WebDriverWait(driver, 60);
element = wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(locator)));
} else if (key.endsWith("linktext")) {
WebDriverWait wait = new WebDriverWait(driver, 60);
element = wait.until(ExpectedConditions.visibilityOfElementLocated(By.linkText(locator)));
} else if (key.endsWith("xpath")) {
WebDriverWait wait = new WebDriverWait(driver, 60);
element = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(locator)));
}
}