Watir-webdriver click action returns true/success but does not really do the click action -


i have span element cascades div, @ button text "okay,got it." . html follows:

<span class="dijit dijitreset dijitinline defaultbutton xwtbutton xwt-textbutton xwt-textbuttonfocused dijitfocused" role="presentation" widgetid="xwt_widget_form_textbutton_2">     <span class="dijitreset dijitinline dijitbuttonnode" role="presentation" data-dojo-attach-event="ondijitclick:__onclick">       <span id="xwt_widget_form_textbutton_2" class="dijitreset dijitstretch dijitbuttoncontents" aria-labelledby="xwt_widget_form_textbutton_2_label" role="button" data-dojo-attach-point="titlenode,focusnode" tabindex="0">          <span class="dijitreset dijitinline dijiticon dijitnoicon" data-dojo-attach-point="iconnode"></span>          <span class="dijitreset dijittogglebuttoniconchar">\u25cf</span>          <span id="xwt_widget_form_textbutton_2_label" class="dijitreset dijitinline dijitbuttontext" data-dojo-attach-point="containernode">okay, got it.</span> </span> 

so tried types of click:

@browser.span(:text => /okay/).click @browser.span(:text => /okay/).fire_event("onclick") @browser.span(:text => /okay/).double_click @browser.span(:text => /okay/).send_keys :enter etc 

i used, focus, hover..i see these locates element , click (as see element kind shows reaction on clicking webdriver, button kind of fades , thats it, nothing happens further, no error) noticed html changes on 1 click, nothing happens if try again click :

<span class="dijit dijitreset dijitinline defaultbutton xwtbutton xwt-textbutton xwt-textbuttonhover digithover xwt-textbuttonfocused xwt-textbuttonhoverfocused dijithoverfocused dijitfocused" role="presentation" widgetid="xwt_widget_form_textbutton_2"> 

please me how handle ui click

when have nested spans that, innermost has text, spans have same text. if try select text alone, watir going return first 1 finds matches, outer level container. may not 1 needs receive click action.

so need select other parameter, such perhaps class (which based on comments ended doing)

@browser.span(:class => "dijitreset dijitinline dijitbuttonnode").click 

the tricky part structure finding of set of nested spans 1 needs clicked.. experimentation.. irb friend there.

btw, whatever library developers using.. man resulting html , dom structure makes brain hurt..


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -