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

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

        <bdo id='fe2Hf'></bdo><ul id='fe2Hf'></ul>
    1. <legend id='fe2Hf'><style id='fe2Hf'><dir id='fe2Hf'><q id='fe2Hf'></q></dir></style></legend>
    2. <small id='fe2Hf'></small><noframes id='fe2Hf'>

      如何使用 Selenium (Java) 在瀏覽器中禁用 JavaScript

      How to disable JavaScript in browser using Selenium (Java)?(如何使用 Selenium (Java) 在瀏覽器中禁用 JavaScript?)
        <bdo id='tbV2B'></bdo><ul id='tbV2B'></ul>

          <tbody id='tbV2B'></tbody>
        1. <tfoot id='tbV2B'></tfoot>

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

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

                本文介紹了如何使用 Selenium (Java) 在瀏覽器中禁用 JavaScript?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                在我的功能自動化中,我需要在瀏覽器中禁用 JavaScript 并運行流程.如何禁用 JavaScript?

                In my feature automation, I need to disable JavaScript in browser and run the flow. How to disable JavaScript?

                嘗試了 Firefox 和 Chrome 的 DesiredCapabilities.

                Tried DesiredCapabilities for firefox and Chrome.

                DesiredCapabilities dc = new DesiredCapabilities();
                dc.setCapability(CapabilityType.SUPPORTS_JAVASCRIPT, false)
                

                DesiredCapabilities dc = new DesiredCapabilities();
                dc.setJavascriptEnabled(false);
                

                對于火狐,試過1) 為 Firefox 設置配置文件

                For firefox, tried 1) Setting up profile for firefox

                2) 添加插件 - noScript.xpi

                2) Adding add-on - noScript.xpi

                3) profile.setPreference("javascript.enabled", false);

                3) profile.setPreference("javascript.enabled", false);

                4) 通過 UI,嘗試將about:config"中的javascript.enabled"標志更改為 false.在這里,打開 Firefox 并給about:config"一個警告 - 這可能會使您的保修失效!".有一個按鈕——我會小心的,我保證!"帶有 id - 警告按鈕.應單擊此按鈕以繼續進行.要單擊此按鈕,請使用 driver.findElement(By.id("warningButton")).click();但它不起作用.

                4) Through UI, tried changing the flag - "javascript.enabled" in "about:config" to false. Here, opened firefox and gave "about:config" getting a warning - "This might void your warranty!". There is a button - "I'll be careful, I promise!" with id - warningButton. This button should be clicked to proceed further. To click this button, used driver.findElement(By.id("warningButton")).click(); but it not work.

                以上所有選項均無效.任何建議都會有所幫助.

                All the above options are not working. Any advice will be helpful.

                推薦答案

                我不懂 Java,但也許 Python 3 的解決方案會對你有所幫助.

                I don't know Java, but maybe a solution for Python 3 will help you.

                在 Python 中,您可以使用 Options() 而不是 FirefoxProfile() 來停用 JavaScript:

                in Python, you can use Options() instead of FirefoxProfile() to deactivate JavaScript:

                from selenium.webdriver.firefox.options import Options
                options = Options()
                options.preferences.update({"javascript.enabled": False})
                driver = webdriver.Firefox(options=options)
                driver.get('about:config')
                

                也許是 Java:

                FirefoxOptions options = new FirefoxOptions();
                options.preferences.update({"javascript.enabled": False});
                WebDriver driver = new FirefoxDriver(options);
                driver.get('about:config')
                

                這篇關于如何使用 Selenium (Java) 在瀏覽器中禁用 JavaScript?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                相關文檔推薦

                How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數溢出?)
                Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關系嗎?)
                How to convert Integer to int?(如何將整數轉換為整數?)
                How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內創建一個隨機打亂數字的 int 數組)
                Inconsistent behavior on java#39;s ==(java的行為不一致==)
                Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠將 0xff000000 存儲為 int?)
                <i id='un0TV'><tr id='un0TV'><dt id='un0TV'><q id='un0TV'><span id='un0TV'><b id='un0TV'><form id='un0TV'><ins id='un0TV'></ins><ul id='un0TV'></ul><sub id='un0TV'></sub></form><legend id='un0TV'></legend><bdo id='un0TV'><pre id='un0TV'><center id='un0TV'></center></pre></bdo></b><th id='un0TV'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='un0TV'><tfoot id='un0TV'></tfoot><dl id='un0TV'><fieldset id='un0TV'></fieldset></dl></div>

                  <tfoot id='un0TV'></tfoot>
                    <tbody id='un0TV'></tbody>
                  <legend id='un0TV'><style id='un0TV'><dir id='un0TV'><q id='un0TV'></q></dir></style></legend>

                  • <bdo id='un0TV'></bdo><ul id='un0TV'></ul>

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

                          主站蜘蛛池模板: 午夜婷婷激情 | 欧美www在线观看 | 亚洲免费在线观看 | 一区二区三区四区五区在线视频 | 国产日韩欧美 | 国产三区在线观看视频 | 亚洲一区二区免费电影 | 国产精品免费一区二区三区四区 | 国产成人高清 | 国产一级片免费在线观看 | 巨大荫蒂视频欧美另类大 | 成人h电影在线观看 | 久国产精品 | 欧美一区二区三区在线看 | 国产三级一区二区三区 | 最新av在线播放 | 在线国产一区二区三区 | 在线观看国产 | 国产视频91在线 | 亚洲狠狠| 久久新| 国产1区 | av毛片| 亚洲www啪成人一区二区麻豆 | 一区二区三区视频免费看 | 天天综合网天天综合 | 精品视频在线一区 | 精品在线一区 | 亚洲精品视频在线看 | 欧美日韩精品 | 91久久北条麻妃一区二区三区 | 国产成人精品久久二区二区91 | 亚洲综合一区二区三区 | 一区二区三区影院 | 一级在线视频 | 欧美精品网站 | 一区二区三区欧美 | 国产美女特级嫩嫩嫩bbb片 | 日日干干 | 日本黄色片免费在线观看 | 亚洲天堂av网 |