webdriver - Not able to click or get element due to space before and after "shetty ruat pravin ruat(pravin.uat@gmail.com)" ..please find html code below -


enter image description here tried,

xpath //h3[text()='available customers']/parent::div/following-sibling::div//li//div[@class='longtext ng-binding ng-scope']//i[@ng-show='item.selected']   

but didn't work

there space before shetty ruat pravin ruat(pravin.uat@gmail.com) cannot reach till there , or gettext

try this:

webdriverwait wait = new webdriverwait(driver, 10); webelement element = wait.until(expectedconditions.elementtobeclickable(by.cssselector("li > div.longtext")))); if(element.gettext().contains("shetty ruat pravin") { element.findelement(by.cssselector("i.fa")).click(); } 

Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -