I need help to find the hightlight element below, I have tried use xpath and css
ID: 3598931 • Letter: I
Question
I need help to find the hightlight element below, I have tried use xpath and cssSelector and I stil Icanot find the element «body marginwidth="0" marginheight="0" topmargin-"0" leftmargin="0" bgcolor "" cellpadding-"5" > style-"text-decoration : none;" span Sites Kspan class-"nav-primary-item-sep"> /span> Ka style-"text-decoration: none;" href-"/WeysAdmDB/ispl span, class-"nav-primary-item-sep"> a href="span class-"nav-primary-item-txt">Deployments span class-"nav-primary-item-sep"> /span>Explanation / Answer
Below code can be used to find the given element:
org.openqa.selenium.support.ui.Wait<WebDriver> wait = new FluentWait<WebDriver>(
driver).withTimeout(30, TimeUnit.SECONDS)
.pollingEvery(100, TimeUnit.MILLISECONDS)
.ignoring(NoSuchElementException.class)
.ignoring(StaleElementReferenceException.class);
elements = wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.cssSelector("a[href='WevsAdmDB/jsp/deployments.jsp']")));
if(elements.size()>0){
elements = driver.findElements(By.cssSelector("a[href='WevsAdmDB/jsp/deployments.jsp']"));
wait.until(ExpectedConditions.visibilityOf(elements.get(0)));
}
If still visiblity of element throws exception then the given element is hidden and you have to make it visible by correcting the HTML. Please share the HTML file also to test it completely.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.