0
我有一個從div級聯的span元素,它看起來像一個帶有文本的按鈕「好吧,明白了」。 。它的HTML如下:Watir-webdriver點擊操作返回true /成功,但並沒有真正做點擊動作
<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>
所以,我想大多數類型點擊:
@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
我也用過,突出重點,hover..I看到,所有這些元素所處並執行點擊(我看到元素種類顯示由webdriver點擊反應,但按鈕類型的淡入淡出,這是什麼,沒有進一步發生,沒有錯誤) 但我注意到它的HTML更改爲一次點擊,但沒有任何反應,如果我試圖再次點擊:
<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">
請幫助我如何處理這個用戶界面點擊
沒關係,我發現它的工作使用:跨度類=「dijitReset dijitInline dijitButtonNode」 – Jade
出好奇心,你在用什麼瀏覽器?這是Firefox嗎? –