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

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

      <legend id='NyUXD'><style id='NyUXD'><dir id='NyUXD'><q id='NyUXD'></q></dir></style></legend>
    1. <tfoot id='NyUXD'></tfoot>

      1. 如何摆脱信息栏“Chrome 正在被自动化测试软件控

        时间:2023-10-08

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

            <legend id='waoJT'><style id='waoJT'><dir id='waoJT'><q id='waoJT'></q></dir></style></legend>

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

                    <tbody id='waoJT'></tbody>
                  <tfoot id='waoJT'></tfoot>
                  本文介绍了如何摆脱信息栏“Chrome 正在被自动化测试软件控制"通过硒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  搜索了一段时间并尝试了所有现有的解决方案,但似乎没有一个有效.我创建了一个幻灯片放映",它将首先登录,然后在选项卡之间交替.所有这些都有效,但我无法摆脱

                  Been searching for a while and tried all the solutions present but none appear to be working. I created a "slide show" that will first log in, then alternate between tabs. All of that is working but i cannot get rid of the

                  Chrome 正在被自动化测试软件控制"栏.有什么建议吗?

                  "Chrome is being controlled by automated test software" bar. Any advise?

                  代码

                  from selenium import webdriver
                  from selenium.webdriver.common.by import By
                  from selenium.webdriver.support.ui import WebDriverWait
                  from selenium.webdriver.support import expected_conditions as EC
                  usernameStr = 'test'
                  passwordStr = 'test'
                  browser = webdriver.Chrome()
                  
                  #first tab
                  browser.get(('www.testwebsite.com?'))
                  # fill in username and hit the next button
                  username = browser.find_element_by_id('username')
                  username.send_keys(usernameStr)
                  password = WebDriverWait(browser, 10).until(
                      EC.presence_of_element_located((By.ID, 'password')))
                  password.send_keys(passwordStr)
                  nextButton = browser.find_element_by_class_name('emp-submit')
                  nextButton.click()
                  
                  #second tab
                  browser.execute_script("window.open('about:blank', 'tab2');")
                  browser.switch_to.window("tab2")
                  browser.get('www.testwebsite.com')
                  

                  推荐答案

                  当您通过 ChromeDriver 打开 Chrome 浏览器 时,此信息栏包含 通知 嵌入如下:

                  When you open Chrome Browser in through ChromeDriver this infobar containing the notification is embedded as follows:

                  Chrome is being controlled by automated test software
                  

                  • 不带参数disable-infobars的浏览器快照:
                    • Browser snapshot without the argument disable-infobars:
                    • 但是,如果您通过 ChromeOptions 的实例添加参数 disable-infobars,您可以按如下方式删除此信息栏:

                      But if you add the argument disable-infobars through an instance of ChromeOptions you can get rid of this infobar as follows:

                      • 代码块:

                      • Code Block:

                      from selenium import webdriver
                      from selenium.webdriver.chrome.options import Options
                      
                      options = Options()
                      options.add_argument('start-maximized')
                      options.add_argument('disable-infobars')
                      driver = webdriver.Chrome(chrome_options=options, executable_path=r'C:WebDriverschromedriver.exe')
                      driver.get('https://www.google.com/')
                      

                    • 应用参数disable-infobars的浏览器快照:

                      这篇关于如何摆脱信息栏“Chrome 正在被自动化测试软件控制"通过硒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何使用 Python 将选项传递给 Selenium Chrome 驱动程 下一篇:selenium.common.exceptions.ElementNotVisibleException:消息:元

                  相关文章

                  最新文章

                  1. <i id='dl98a'><tr id='dl98a'><dt id='dl98a'><q id='dl98a'><span id='dl98a'><b id='dl98a'><form id='dl98a'><ins id='dl98a'></ins><ul id='dl98a'></ul><sub id='dl98a'></sub></form><legend id='dl98a'></legend><bdo id='dl98a'><pre id='dl98a'><center id='dl98a'></center></pre></bdo></b><th id='dl98a'></th></span></q></dt></tr></i><div id='dl98a'><tfoot id='dl98a'></tfoot><dl id='dl98a'><fieldset id='dl98a'></fieldset></dl></div>
                    • <bdo id='dl98a'></bdo><ul id='dl98a'></ul>
                    <tfoot id='dl98a'></tfoot>
                    <legend id='dl98a'><style id='dl98a'><dir id='dl98a'><q id='dl98a'></q></dir></style></legend>
                    1. <small id='dl98a'></small><noframes id='dl98a'>