zoukankan      html  css  js  c++  java
  • 自动化测试归纳总结

    隐藏掉chromdriver在控制台的输出
    stackoverflow 的 答案如下:

    
    6
    down vote
    You will have to edit Selenium Source code to achieve this. I am a noob too, and I dont fully understand the overall consequences of editing source code but here is what I did to achieve hiding the webdriver console window on Windows 7, Python 2.7.
    
    Locate and edit this file as follows: located at Libsite-packagesseleniumwebdrivercommonservices.py in your Python folder.
    
    Edit the Start() function by adding the creation flags this way: creationflags=CREATE_NO_WINDOW
    
    The edited method will be as below:
    
    def start(self):
        """
        Starts the Service.
    
        :Exceptions:
         - WebDriverException : Raised either when it can't start the service
           or when it can't connect to the service
        """
        try:
            cmd = [self.path]
            cmd.extend(self.command_line_args())
            self.process = subprocess.Popen(cmd, env=self.env,
                                            close_fds=platform.system() != 'Windows',
                                            stdout=self.log_file, stderr=self.log_file, creationflags=CREATE_NO_WINDOW)
        except TypeError:
            raise
    You will have to add the relevant imports:
    
    from win32process import CREATE_NO_WINDOW
    This should also work for Chrome webdriver as they import the same file to start the webdriver process.
    
    如果有来生,一个人去远行,看不同的风景,感受生命的活力。。。
  • 相关阅读:
    火狐显示不安全链接
    signal信号
    I/O缓冲
    [pe530]GCD of Divisors
    学校寒假集训作业
    纳克萨玛斯「GDOI2007」(网络流)
    [清华集训2016] 汽水
    有上下界网络流
    [AHOI2014]支线剧情(有上下界的网络流)
    [SCOI2016]妖怪
  • 原文地址:https://www.cnblogs.com/Frank99/p/9888121.html
Copyright © 2011-2022 走看看