Absolute Path error "Waiting on Visibility of element located By.xpath"

1,057 views
Skip to first unread message

Ma St

unread,
Jan 8, 2018, 10:58:19 AM1/8/18
to Selenium Users


The following is the application field that Selenium Web Driver is having a problem viewing ("Program" drop-down box).




The following is what displays when I right click and click Inspect.



I tried using absolute path to find this but keep getting errors that it is not visible.  Is it the special character of a period that is causing issues?  I have tried all of the options below, but it seems to have an issue with the id of "bucket.989093".


@Test(priority=3)

  public void EnterProposalInvestment() {


//wait

  WebDriverWait wait = new WebDriverWait(driver, 10);

ReuseFuncEnvestnet.func_Try(9000,driver);

//click on Program Drop-Down

    //WebElement ProgramDD = wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("#*'bucket.398'*) > div > div > table > tbody > tr:nth-child(2) > td:nth-child(2) > div > select")));

//WebElement ProgramDD = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@id=\"bucket.398093\"]")));

//WebElement ProgramDD = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//select/option[contains(text(),'<Not selected>')]")));

 //WebElement ProgramDD = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@id='bucket.398093']/div/div/table/tbody/tr[2]/td[2]/div/select")));

//*[@id="bucket.398093"]/div/div/table/tbody/tr[2]/td[2]/div/select

    // WebElement ProgramDD = wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("#bucket.398093 > div > div > table > tbody > tr:nth-child(2) > td:nth-child(2) > div > select")));

// WebElement ProgramDD = wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("#bucket.398093 > div > div > table > tbody > tr:nth-child(2) > td:nth-child(2) > div > select")));

ProgramDD.click();



This is the error I receive every time.

FAILED: EnterProposalInvestment
org.openqa.selenium.TimeoutException: Expected condition failed: waiting for visibility of element located by By.xpath: //*[@id='bucket.398093']/div/div/table/tbody/tr[2]/td[2]/div/select (tried for 10 second(s) with 500 MILLISECONDS interval)
at org.openqa.selenium.support.ui.WebDriverWait.timeoutException(WebDriverWait.java:82)

Ma St

unread,
Jan 8, 2018, 11:14:16 AM1/8/18
to Selenium Users
It looks like I can avoid this by going up one level above the bucket 398 element tag and then making that tag "div" in my absolute path, but I am curious as to why Selenium does not see bucket.398?
Reply all
Reply to author
Forward
0 new messages