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

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -