Unable to locate an element using xpath error in selenium-java

前端 未结 4 889
忘掉有多难
忘掉有多难 2021-01-17 06:23

This is the code I am trying to execute

public WebDriver createPart() {

    try {
        driver.findElement(By.id(\"username\")).sendKeys(\"502409373\");
          


        
4条回答
  •  再見小時候
    2021-01-17 06:56

    Change visibilityOfElementLocated instead of elementToBeClickable. You can directly find the webeelement, and then click on it as shown below:

    element = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//a[@title='Part Details']")));
    

提交回复
热议问题