WebElement Button - not able to click | Selenium Forum
M
Posted on 10/02/2017
Hi,
Below is the Inspect Element code for the site am automating. I want to click on OK() Button.

Xpath am using : //Button[@class='ui-state-default ui-corner-all'][1]

I have verified my Xpath on Firebug, xpath is correct. But its not clicking the button. Then, i have checked for Visibility of button by func isDisplayed(), which is coming as false.

why its not able to click via selenium? Am while manual am able to navigate to next page. Moreover, i checked the inspect element code, No function call is made on that button.


Inspect Element code:
<document>
<html>
<head>
<!-- <body class="general" onload="sendToStappenplanServlet()"> -->
<body class="general" style="height: 665px;">
<div class="busy ui-corner-bottom" style="display: none;">
<div id="logo">
<div id="mainButtons">
<div id="stappenplanTabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
<div id="adminerrormeldingenblock"/>
<div id="adminstepsknoppen">
<div id="debugTabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
<div class="ui-dialog ui-widget ui-widget-content ui-corner-all alert ui-draggable" style="display: none; position: absolute; overflow: hidden; z-index: 1000; outline: 0px none;" tabindex="-1" role="dialog" aria-labelledby="ui-dialog-title-errorDialog">
<div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable" style="display: none; position: absolute; overflow: hidden; z-index: 1000; outline: 0px none;" tabindex="-1" role="dialog" aria-labelledby="ui-dialog-title-editDialog">
<div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable" style="display: none; position: absolute; overflow: hidden; z-index: 1000; outline: 0px none;" tabindex="-1" role="dialog" aria-labelledby="ui-dialog-title-step-customer">
<div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable" style="display: none; position: absolute; overflow: hidden; z-index: 1000; outline: 0px none;" tabindex="-1" role="dialog" aria-labelledby="ui-dialog-title-step-parameters">
<div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable" style="display: none; position: absolute; overflow: hidden; z-index: 1004; outline: 0px none; height: auto; width: 350px; top: 177.5px; left: 453.5px;" tabindex="-1" role="dialog" aria-labelledby="ui-dialog-title-step-system-attributes">
<div class="ui-widget-overlay" style="width: 1263px; height: 665px; z-index: 1005;"/>
<div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable" style="display: block; position: absolute; overflow: hidden; z-index: 1006; outline: 0px none; height: auto; width: 350px; top: 35px; left: 453.5px;" tabindex="-1" role="dialog" aria-labelledby="ui-dialog-title-step-managers">
<div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" unselectable="on" style="-moz-user-select: none;">
<div id="step-managers" class="stepDialog ui-dialog-content ui-widget-content" style="height: 190px; min-height: 60px; width: auto;">
<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
<button class="ui-state-default ui-corner-all ui-state-focus ui-state-hover" type="button">Ga verder</button>
<button class="ui-state-default ui-corner-all" type="button">Cancel</button>
</div>
</div>
</body>
</html>
</document>

M
Replied on 11/02/2017

send me a screenshot of the button you want to click with inspect element open.


M
Replied on 15/02/2017

button could be hidden, use javascriptexecutor interface u click it.