简体   繁体   English

如何在给定的时间在一台计算机上平稳地执行多个Selenium脚本

[英]How to smoothly execute mulitple Selenium scripts on a single machine at a given time

I execute automation Selenium Scripts on remote machine which is set to perform 5 jobs at a time (5 scripts can be executed at a time by instantiating 5 browser instances).But everytime atleast 1 or 2 random scripts fail with random errors such as null pointer exception, Element not visible or not able to click the element. 我在设置为一次执行5个作业的远程计算机上执行自动化Selenium脚本(可以通过实例化5个浏览器实例来一次执行5个脚本),但是每次至少有1或2个随机脚本失败并出现诸如空指针之类的随机错误例外,元素不可见或无法单击元素。 But it won't happen if only 3 jobs are run at a time. 但是,一次只运行3个作业就不会发生。 What's the best way i can prevent the scripts from failing. 我可以防止脚本失败的最佳方法是什么。

very vague question. 非常模糊的问题。 Cant really comment on why they are failing without seeing the implementation of classes. 不能真正评论为什么他们失败而没有看到类的实现。

It can happen for a lot of things including latency in network when you are running 5 instances. 当您运行5个实例时,它可能发生在很多方面,包括网络延迟。 If that is the case you might considering using selenium grid and distribute your tests across 2 or more nodes in each of which you can run 3 instances. 如果是这种情况,您可以考虑使用Selenium网格并将测试分布在2个或更多节点上,每个节点可以运行3个实例。

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

相关问题 如何在单台计算机上使用Selenium WebDriver执行并发测试? - How to execute concurrent tests with Selenium WebDriver on a single machine? 如何在jenkins slave机器上运行selenium脚本,但脚本在Master机器中 - How to run selenium scripts in jenkins slave machine but the scripts are in Master machine 如何在已打开的浏览器上执行 selenium 脚本 - How to execute selenium scripts on an already opened browser Selenium RC,如何在远程计算机中运行Selenium RC脚本 - Selenium RC, How to run selenium RC Scripts in remote Machine 如何在不使用 Selenium 网格的情况下在虚拟机中运行 selenium 脚本? - How to run selenium scripts in virtual machine without using Selenium Grid? 如何在selenium中使用多行脚本来执行脚本 - How do I use multi line scripts in selenium to execute a script 如何在 Mac OS 中已打开的浏览器上执行 Selenium 脚本 - How to execute Selenium scripts on already opened browser in Mac OS 如何在多个测试环境中并行执行Selenium脚本? - How to execute selenium scripts parallely in multiple test environments? 如何在给定时间使用 Selenium 关闭浏览器选项卡 - How to close a browser tab with Selenium at a given time 使用NUnit使用C#的Selenium WebDriver:在一台机器上并行在多个浏览器上执行测试用例 - Selenium WebDriver with C# using NUnit: execute test cases on multiple browsers in parallel on single machine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM