Selenium c# - Button click fails in Firefox...but only when using WebDriver -
here's dilemma... have button becomes un-clickable in browser window opened using webdriver.
the button:
<div class="ribbon-section"> <span class="section-title" data-bind="text: title">email</span> <div class="layout" data-bind="css: { 'vertical': isvertical ,layout:true}"> <div id="email-btn" class="ribbon-control ribbon-button ribbon-button-large" data-bind="attr: { id: id }, css: { disabled: disabled, 'ribbon-button-large': size() == 'large', 'ribbon-button-small': size() == 'small', 'ribbon-button-medium': size() == 'medium' }, click: onclick"> <img class="ribbon-icon ribbon-normal" data-bind="attr: { src: imgnormal }, visible: !disabled()" src="/_layouts/15/klscript/content/images/ribbon/normal/email-link.png" style=""> <img class="ribbon-icon ribbon-disabled" data-bind="attr: { src: imgdisabled }, visible: disabled()" src="/_layouts/15/klscript/content/images/ribbon/disabled/email-link.png" style="display: none;"> <span class="control-title" data-bind="html: title">email link</span> <span class="control-help" data-bind="text: tooltip">email link</span> </div> </div> </div>
it's not webdriver cannot locate element or that. button can't clicked, webdriver or manually. nothing happens. if open firefox manually, button clickable.
i have tried this:
driver.findelement(by.id("email-btn")).click();
and this:
iwebelement emailbtn = driver.findelement(by.id("email-btn")); actions act = new actions(driver); act.click(emailbtn);
and this:
ijavascriptexecutor js = driver ijavascriptexecutor; js.executescript("document.getelementbyid('email-btn').click()");
comparing button has no issue, see same, aside id:
<div id="email-btn" class="ribbon-control ribbon-button ribbon-button-large" data-bind="attr: { id: id }, css: { disabled: disabled, 'ribbon-button-large': size() == 'large', 'ribbon-button-small': size() == 'small', 'ribbon-button-medium': size() == 'medium' }, click: onclick"> <div id="download-item-btn" class="ribbon-control ribbon-button ribbon-button-large" data-bind="attr: { id: id }, css: { disabled: disabled, 'ribbon-button-large': size() == 'large', 'ribbon-button-small': size() == 'small', 'ribbon-button-medium': size() == 'medium' }, click: onclick">
also tried disabling images and/or css in firefox.
any ideas?
you need remove 'disabled: disabled' elements css. should set after that
Comments
Post a Comment