Unable to click on a png image using selenium webdirver -
i'm trying click on png image. following code finds image, retrieves title, doesn't click. , doesn't throw error.
while page loading, if click somewhere on page, script works. clicks on png image. i'm doing wrong here?
webdriver driver = new firefoxdriver(); driver.get("http://www1.macys.com/shop/bed-bath/bath-rugs-bath-mats?id=8240&edge=hybrid"); webdriverwait w = new webdriverwait(driver,10); webelement = w.until(expectedconditions.visibilityofelementlocated(by.xpath("//img[contains(@src,'http://assets.macys.com/navapp/web20/assets/img/socialshopping/poll_create.png')]"))); system.out.println(we.getattribute("title")); we.click();
the answer in stackoverflow question addresses issues clicking on image may or may not have action attributed it. circles around using 'perform()' method rather 'click()' execute image's action.
more here.
Comments
Post a Comment