简体   繁体   English

因此,当我通过jenkins运行python硒脚本时,应该如何编写“ driver = webdriver.Chrome()”?

[英]So when I run my python selenium script through jenkins, how should I write the 'driver = webdriver.Chrome()'?

So when I run my python selenium script through Jenkins, how should I write the driver = webdriver.Chrome() 因此,当我通过Jenkins运行python硒脚本时,应该如何编写driver = webdriver.Chrome()

How should I put the chrome webdriver EXE in jenkins? 我应该如何将Chrome webdriver EXE放入jenkins?

Where should I put it? 我应该放在哪里?

If you have added your repository path in jenkins during job configuration, Jenkins will create a virtual copy of your workspace. 如果您在作业配置期间在jenkins中添加了存储库路径,则Jenkins将创建工作空间的虚拟副本。 So, as long as the webdriver file is somewhere in your project folder structure and as long as you are using relative path to reference it in your code, there shouldn't be any issues with respect to driver in invocation. 因此,只要webdriver文件位于项目文件夹结构中的某个位置,并且只要您使用相对路径在代码中对其进行引用,就不会在驱动程序调用方面出现任何问题。

You question also depends on several params like: 1. Whether you are using Maven to run the test 2. Whether you are running tests on Jenkins locally or on a remote machine using Selenium Grid Architecture. 您的问题还取决于几个参数,例如:1.是否使用Maven运行测试2.是在Jenkins本地还是在使用Selenium Grid Architecture的远程计算机上运行测试。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在不重复打开 webdriver.Chrome() 的情况下通过 for() 循环 go? - How to I go through a for() loop without opening webdriver.Chrome() repeatedly? 如何让 python selenium webdriver 脚本 24/7 全天候运行? - How can I have a python selenium webdriver script run 24/7? Selenium webdriver.Remote 驱动程序不适用于 Tor 代理(webdriver.Chrome 可以) - Selenium webdriver.Remote driver does not work with tor proxy(webdriver.Chrome does) 当我使用IE作为驱动程序运行此Selenium / WebDriver代码时,为什么python.exe崩溃? - Why does python.exe crash when I run this Selenium/WebDriver code using IE as the driver? Selenium 的 webdriver.Chrome() 从 Python 的 CMD 实例打开就好了,但是从 Spyder 运行时抛出错误 - Selenium's webdriver.Chrome() Opens just fine from CMD instance of Python but throws error when running from Spyder 为什么我的 webdriver.chrome() 不工作? - Why is my webdriver.chrome() not working? 退出python脚本时如何退出selenium chrome驱动程序? - How to exit selenium chrome driver when exiting python script? 如何使用 selenium WebDriver Chrome 更改我的 IP - How can I change my IP using selenium WebDriver Chrome 当页面上有这么多元素时,我如何 select 页面上的特定元素? Selenium webdriver python; - How can I select a specific element on a page when there is so many of that element? Selenium webdriver python; 如何使用 selenium + chrome webdriver + python 忽略警报? - How do I ignore an alert using selenium + chrome webdriver + python?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM