java - Selenium Apply button not working on combo box? -
i have problem apply button. have combo box filter , fine, switching between squares.but when suppose apply, somehow continue not selected , test finishes successfully, there no filtering need.
can check code , part inspector bug. maybe missing something?
my java code:
if (type.equals("")) { elementlist = driver.findelements(by.xpath("//div[@id='" + id + "_menu']//a[@class='fitext']")); if (elementlist.size() > 0) { if (driver.findelements(by.xpath("//div[@id='" + id + "_menu']//div[@class='cfapplybuttoncontainer']//button[@class='tab-button']//span[@class='label'][text()='apply']/..")).size() > 0) { type = "multi_checkbox_with_apply"; }else { type = "multi_checkbox_without_apply"; } } }
inspector bug:
<div class="cfapplybuttonconatiner" style="height: 21px;"> <button class="tab-button tab-widget disabled" type="button" style="max-width: 56px" disabled=""> <span class="icon"></span> <span class="label">cancel</span> </button> <button class="tab-button tab-widget focus disabled" type="button" style="max-width: 56px" disabled=""> <span class="icon"></span> <span class="label">apply</span> </button>
can check please? don't have idea why not working? maybe has idea how test it.
br, marija
just clear, solution element displayed , click on it!!
webdriverwait wait = new webdriverwait(driver, 10); webelement element = wait.until(expectedconditions.elementtobeclickable(by.cssselector("div.cfapplybuttonconatiner")))); list<webelement> elementslist = driver.findelements(by.cssselector("div.cfapplybuttonconatiner > button"); for(webelement ele: elementslist) { if(ele.isdisplayed()) { ele.click(); } }
Comments
Post a Comment