久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <legend id='yRfh8'><style id='yRfh8'><dir id='yRfh8'><q id='yRfh8'></q></dir></style></legend>

      1. <i id='yRfh8'><tr id='yRfh8'><dt id='yRfh8'><q id='yRfh8'><span id='yRfh8'><b id='yRfh8'><form id='yRfh8'><ins id='yRfh8'></ins><ul id='yRfh8'></ul><sub id='yRfh8'></sub></form><legend id='yRfh8'></legend><bdo id='yRfh8'><pre id='yRfh8'><center id='yRfh8'></center></pre></bdo></b><th id='yRfh8'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='yRfh8'><tfoot id='yRfh8'></tfoot><dl id='yRfh8'><fieldset id='yRfh8'></fieldset></dl></div>

        <tfoot id='yRfh8'></tfoot>
        • <bdo id='yRfh8'></bdo><ul id='yRfh8'></ul>

      2. <small id='yRfh8'></small><noframes id='yRfh8'>

      3. Selenium WebDriver 點擊隱藏元素

        Selenium WebDriver clicking on hidden element(Selenium WebDriver 點擊隱藏元素)

        <small id='u3puw'></small><noframes id='u3puw'>

              <bdo id='u3puw'></bdo><ul id='u3puw'></ul>
                <i id='u3puw'><tr id='u3puw'><dt id='u3puw'><q id='u3puw'><span id='u3puw'><b id='u3puw'><form id='u3puw'><ins id='u3puw'></ins><ul id='u3puw'></ul><sub id='u3puw'></sub></form><legend id='u3puw'></legend><bdo id='u3puw'><pre id='u3puw'><center id='u3puw'></center></pre></bdo></b><th id='u3puw'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='u3puw'><tfoot id='u3puw'></tfoot><dl id='u3puw'><fieldset id='u3puw'></fieldset></dl></div>
              • <legend id='u3puw'><style id='u3puw'><dir id='u3puw'><q id='u3puw'></q></dir></style></legend>

                <tfoot id='u3puw'></tfoot>
                  <tbody id='u3puw'></tbody>
                • 本文介紹了Selenium WebDriver 點擊隱藏元素的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  您好,我想知道如何使用 Selenium WebDriver 點擊隱藏元素和/或禁用元素.

                  Hi I would like to know how to click on hidden element and/or disable element by using Selenium WebDriver.

                  我知道使用 selenium 1 我可以這樣做:

                  I know with selenium 1 I can do this as below:

                  selenium.click(id="idOfHiddenField");
                  

                  這會起作用,但是對于 selenium 2 (WebDriver),這不起作用.我不想使用 jquery 來啟用或顯示隱藏字段或 JavaScript.這是因為大部分測試都使用 xpath.

                  and this would work, but with selenium 2 (WebDriver), this doesn't. I do not want to use jquery to enable or show hidden fields , or JavaScript. This is because most of the test are using xpath.

                  還是我只需要使用舊的 selenium,它允許您點擊隱藏字段?

                  Or do I just have to stay with old selenium which allows you to click on hidden fields?

                  推薦答案

                  有一種更簡單的方法可以使用 JavascriptExecutor 解決該問題.

                  There is a easier way to work around the problem using JavascriptExecutor.

                  例如:

                  document.getElementsByClassName('post-tag')[0].click();
                  

                  上面的 javascript 會點擊此頁面右上角的Selenium"標簽(在您的問題旁邊),即使它被隱藏(假設地).

                  The above javascript would click on the "Selenium" tag on the top right of this page (next to your question), even if it were hidden (hypothetically).

                  您需要做的就是通過 JavascriptExecutor 接口發出這條 JS 指令,如下所示:

                  All you need to do is issue this JS instruction via the JavascriptExecutor interface like so:

                  (JavascriptExecutor(webdriver)).executeScript("document.getElementsByClassName('post-tag')[0].click();");
                  

                  這將使用 JS 沙箱和合成點擊事件來執行點擊操作.雖然它違背了 WebDriver 用戶活動模擬的目的,但您可以在小眾場景中使用它,例如在您的案例中取得良好效果.

                  This would use the JS sandbox and synthetic click event to perform the click action. Although it defeats the purpose of WebDriver user activity simulation, you can use it in niche scenarios like in your case to good effect.

                  這篇關于Selenium WebDriver 點擊隱藏元素的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調用完成)
                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標頭) - IT屋-程序員軟件開發技術分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)
                  Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)
                  <tfoot id='L0gdo'></tfoot>

                • <i id='L0gdo'><tr id='L0gdo'><dt id='L0gdo'><q id='L0gdo'><span id='L0gdo'><b id='L0gdo'><form id='L0gdo'><ins id='L0gdo'></ins><ul id='L0gdo'></ul><sub id='L0gdo'></sub></form><legend id='L0gdo'></legend><bdo id='L0gdo'><pre id='L0gdo'><center id='L0gdo'></center></pre></bdo></b><th id='L0gdo'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='L0gdo'><tfoot id='L0gdo'></tfoot><dl id='L0gdo'><fieldset id='L0gdo'></fieldset></dl></div>
                  • <bdo id='L0gdo'></bdo><ul id='L0gdo'></ul>
                      <tbody id='L0gdo'></tbody>
                      1. <legend id='L0gdo'><style id='L0gdo'><dir id='L0gdo'><q id='L0gdo'></q></dir></style></legend>

                          <small id='L0gdo'></small><noframes id='L0gdo'>

                            主站蜘蛛池模板: 中文成人无字幕乱码精品 | 日本一区二区三区四区 | 成年免费在线观看 | 91免费视频 | 91精品国产一区二区 | 精品麻豆剧传媒av国产九九九 | 在线男人天堂 | 四虎永久免费影院 | 欧美一区二区小视频 | 精品一区二区视频 | 91精品久久久久久久 | 高清av电影 | 国产成人精品一区二 | 香蕉久久久 | 国产色网站 | 国产精品久久性 | 亚洲午夜精品视频 | 日韩精品在线免费 | 日韩欧美在线不卡 | 久久久久成人精品 | 中文字幕乱码亚洲精品一区 | 久久9999久久| 亚洲成人一级片 | 精品久久电影 | 狠狠操av | 久久久91精品国产一区二区三区 | 色婷婷综合在线观看 | 欧美亚洲国产一区 | 久久久久久一区 | 久久国产一区二区三区 | 91视频一88av| 成人免费视频播放 | 欧美不卡在线 | 国产精品特级毛片一区二区三区 | 国产亚洲欧美另类一区二区三区 | 午夜免费影视 | 国产一区二区三区 | 久久久.com | 成人av一区二区在线观看 | 亚洲一本 | 成年人网站在线观看视频 |