Linux下部署python selenium UI自动化测试踩坑

安装好后执行脚本一直报错



selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)


修改代码加入

意思是让chromedriver能在root权限下运行


self.chrome_options.add_argument('--no-sandbox')

self.chrome_options.add_argument('--disable-dev-shm-usage')

后解决。

你可能感兴趣的:(Linux下部署python selenium UI自动化测试踩坑)