简体   繁体   English

如何将 Selenium package 传输到客户端环境?

[英]How to transport a Selenium package to a client environment?

I need to develop a automation package using selenium and send it over to a different location and completely different environment so that it will aid in the testing's happening there.我需要使用 selenium 开发自动化 package 并将其发送到不同的位置和完全不同的环境,以便它有助于在那里进行测试。 It has to be able to be integrated with Jenkins for the build run.它必须能够与 Jenkins 集成以进行构建运行。 Also it should be a data driven package.它也应该是一个数据驱动的 package。

how will I be able to do that?我将如何做到这一点?

You need to create repository and upload the tests there and provide access to the client.您需要创建存储库并在那里上传测试并提供对客户端的访问。 You can use service like Github or Gitlab. You can have private repository for up to 3 contributors.您可以使用 Github 或 Gitlab 等服务。您可以拥有最多 3 个贡献者的私人存储库。 You can parametrize the test using property file or system property variables.您可以使用属性文件或系统属性变量对测试进行参数化。 If you need more information about how the system properties work you can check this article: https://www.baeldung.com/java-system-get-property-vs-system-getenv如果您需要有关系统属性如何工作的更多信息,您可以查看这篇文章: https://www.baeldung.com/java-system-get-property-vs-system-getenv

Something like this:是这样的:

System.getProperty("log_dir", "/tmp/log");
mvn clean test -DpropertyName=value

If you want to send the project like a jar file then it will be like:如果你想像 jar 文件一样发送项目,那么它将是这样的:

System.getProperty("baseUrl", "https://mywebsite.com");
java -jar jarName -DbaseUrl=https://someotheraddress.com

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM