I tried:
ExpectedConditions.presenceOfElementLocated(By.cssSelector("[id='StandardSave'][aria-disabled='true']"
but still won't work.
I tried:
ExpectedConditions.presenceOfElementLocated(By.cssSelector("[id='StandardSave'][aria-disabled='true']"
but still won't work.
To check the value of the attribute aria-disabled you you have to induce WebDriverWait for the visibilityOfElementLocated()
and you can use either of the following Locator Strategies:
Using id
:
System.out.println(new WebDriverWait(driver, 20).until(ExpectedConditions.visibilityOfElementLocated(By.id("StandardSave"))).getAttribute("aria-disabled"));
Using cssSelector
:
System.out.println(new WebDriverWait(driver, 20).until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("#StandardSave"))).getAttribute("aria-disabled"));
Using xpath
:
System.out.println(new WebDriverWait(driver, 20).until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@id='StandardSave']"))).getAttribute("aria-disabled"));