问题标签 [parallel-testing]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
selenium-webdriver - Selenium Grid running tests in parallel
Currently, I have a Selenium grid setup, with 1 local hub and 2 local nodes. The hub is capable of distributing the tests to run in parallel and distribute it over to the nodes. I am running the tests in parallel.
The following is the base test
The following is the class to get the RemoteWebDriver:
My test suite is like :
Tests are like :
While running these tests, I get the following errors
Build info: version: '2.44.0', revision: '76d78cf323ce037c5f92db6c1bba601c2ac43ad8', time: '2014-10-23 13:11:40' Driver info: driver.version: RemoteWebDriver org.openqa.selenium.remote.SessionNotFoundException: Session ID is null. Using WebDriver after calling quit()? Build info: version: '2.44.0', revision: '76d78cf323ce037c5f92db6c1bba601c2ac43ad8', time: '2014-10-23 13:11:40' Driver info: driver.version: RemoteWebDriver at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:572) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:352) at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:393) at org.openqa.selenium.By$ById.findElement(By.java:214) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:344) at org.openqa.selenium.support.pagefactory.DefaultElementLocator.findElement(DefaultElementLocator.java:59) at com.sun.proxy.$Proxy25.sendKeys(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80) at org.testng.internal.Invoker.invokeMethod(Invoker.java:673) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:842) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1166) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) TEST FAILED: test2 FAILED REASON: Session ID is null. Using WebDriver after calling quit()?
Is it something anyone aware of?
Thanks in advance!
selenium-webdriver - Selenium Grid DriverSafe 测试分发
我已经设置了这篇文章中提到的网格。另外,我在这篇文章中设置了测试类。
因为我希望每个driverInstance
人都使用自己的someController
and someData
,所以我改变了BaseTest
如下:
为了获取每个单独的实例,我创建了以下类
类似的事情someController
。以下测试将使用它自己的 , 实例,someData
如下所示。someController
driver
TestClass
这是获取每个 someData、someController 或驱动程序的线程安全实例的好方法,还是可以在 BaseTest 本身中完成一些操作以返回每个这些的 threadlocal 实例?
cookies - 每个 Firefox 驱动程序实例的 Cookie 共享
我有多个测试可以在具有多个 Firefox 驱动程序的单台机器上并行运行。鉴于应用程序还将写入/读取 cookie,是否有任何现有的解决方案可以处理 cookie 共享?
selenium - 为并行 Selenium 测试设置单独的配置文件
我正在研究如何使用 RemoteWebDriver 设置个人配置文件。我一直在以下线程上阅读它。
我试图解决它如下:
}
我收到以下错误:
更新:我在下面的 BaseTest 类中注入方法名称
testng - 运行并行和顺序测试
我有一个设置,其中很少有测试被编写为并行运行,其余的测试被编写为按顺序运行。我们正在从按顺序运行这些测试转变为并行运行。由于我们不能一次移动所有这些测试,我们需要能够以两种方式运行它们。编写为并行运行的测试使用不同的 baseTest 类和不同的远程驱动程序。有人可以建议是否有办法设置测试套件以同时运行它们。
谢谢!
桑迪普
parallel-testing - 使用 NUnit v3 alpha 在注意到 [Parallelizable(ParallelScope.Fixtures)] 后如何让我的 TestFixtures 并行运行
使用 NUnit v3,我将 [Parallelizable(ParallelScope.Fixtures)] 添加到 2 个单独的 [TestFixtures]。
积极的是它们运行,消极的是它们不并行运行,我是否缺少需要在代码中注明的语法?我已经看过并且目前处于 alpha 阶段,它们支持并行运行 TestFixtures,而不是在 Fixture 中进行测试。
但是我没有看到我的测试并行运行。我的目标是酱实验室。
和
每个测试都线性运行并成功,为我的目的在 TestFixture 级别运行有效。但是我觉得我在这里错过了一个概念。
任何帮助都会很好地帮助我弄清楚为什么这不起作用。
谢谢任
jenkins - How to run the same job multiple times in parallel with Jenkins?
I'm testing Jenkins to see if it will fit our build and testing framework. I found that Jenkins and its available plugins fit most of our needs. Except that I can't seem to find help on how to do one particular type of task.
We are creating application for embedded devices. We have 100s of tests that need to be run on these devices. If we run all the tests on one device after a build then it will take several hours to get the results. However, if we run the tests on 100 of the devices in parallel then we can get results in much shorter time.
All the tests will have very similar starting point. A test script is called with IP address of device to run the test on and user name/pw. The script would do the necessary test on the device and report back pass/fail for each test item.
I think the long/painful way of doing this is writing 100 jobs in Jenkins, each will be a different test script directly (with above parameters) and run these in parallel using available plugins. However, maintaining all these jobs will be very difficult in the long run.
So, the better way to do this would be to create a Job (let's call it child_tester) that can take parameters such as: test script name, IP address of device, user name/pw, etc. Then use another job (let's call it mother_tester) to call child_tester job 100 times with different IP addresses and run them in parallel. I would need some way of accumulating all the test results of each individual run of the child_tester jobs and report them back to mother_tester.
My question is there a plugin or any way of accomplishing this in Jenkins? I have looked into the information of the plugins called "Build Flow", "Parallel Test Executor", and "Parameterized Trigger". However, they don't seem to fit my needs.
jenkins - 与 surefire 并行运行测试并使用 TestNG Jenkins 插件正确显示它们
我正在使用surefire运行并行执行的测试,这一切似乎都很好。
但是,在 target/surefire-reports/ 文件夹中只生成了一个 testng-results.xml,其中...仅包含最后运行的测试结果。
我发现了一个针对旧版本的surefire报告的问题,它在这里说“不会修复”:
但是,我怀疑我是这个星球上第一个尝试与 Jenkins 并行运行单元测试并希望使用 TestNG Jenkins 插件正确显示结果的人,所以我很确定必须有一个解决方案, 正确的?
这是我的万无一失的插件配置:
这是surefire配置顺便说一句的链接:
sqlite - 在使用 SQLite 数据库时并行化功能测试
我在我的 Symfony2 项目中添加了许多测试,但现在有 53 个测试和 176 个断言大约需要一分钟。我试图减少这个时间,因为如果我启用代码覆盖率报告,它需要 15 分钟。
$ phpunit -c app/phpunit.xml.dist PHPUnit 4.3.5 由 Sebastian Bergmann 编写。
从 app/phpunit.xml.dist 读取配置
.......................... .............
时间:59.1 秒,内存:361.00Mb
OK(53 次测试,176 次断言)
我已正确配置LiipFunctionalTestBundle以在环境中使用 SQLite 数据库test
(这是LiipFunctionalTestBundle推荐的):
app/config/config_test.yml
我已经用DoctrineFixturesBundle添加了固定装置。
现在我必须创建测试套件或组来启动几个 PHPUnit 实例。但是我看到了一个未来的问题:如果两个或多个 phpunit 实例在同一个 SQLite 文件中写入和读取数据,如何并行化测试(例如使用paratest )?
我可以将变量传递给 PhpUnit以更改kernel.cache_dir
值并cache
为每个 phpunit 实例创建一个目录。但它不能从命令行完成,所以如果我选择这个解决方案,我将不得不创建几个phpunit.xml.dist
. 我正在寻找更方便的解决方案。
maven - 在单独的工作目录中运行并行集成测试
我想通过并行运行它们来加速我的集成测试。maven-failsafe-plugin 中的配置实现了这一点,将我的所有测试分配给多个并行测试运行器,但我的应用程序将各种数据放在工作目录中,并且测试相互影响。如何在单独的目录中运行每个测试/测试线程?
如果我可以根据测试运行器的系统属性以某种方式设置工作目录,那么surefire/failsafe${surefire.forkNumber}
会提供一个看起来是解决方案的占位符,但这并没有在简单的<workingDirectory>
属性中扩展(而是所有线程都在一个字面上命名为 $ 的目录中运行测试{surefire.forkNumber})。