Issue running Gauge Tests in Parallel #2157
Replies: 3 comments 2 replies
-
wmic cpu get NumberOfCores,NumberOfLogicalProcessors |
Beta Was this translation helpful? Give feedback.
-
checking into see if anyone from Gauge Support can comment on this or suggest. |
Beta Was this translation helpful? Give feedback.
-
Static variables do not fare well in multithreaded parallel execution. You may need to use an alternate pattern, for instance you may want to try using Note that static variables are shared between all threads in a process, hence there will be no isolation between gauge execution streams. |
Beta Was this translation helpful? Give feedback.
-
Running Parallel Tests in Gauge using Selenium seems to execute in series although browser launches in parallel.
environment : Windows 10 & Ubuntu Linux container too.
Gauge version: 1.1.8
Commit Hash: b1501f4
Plugins
dotnet (0.4.1)
html-report (4.0.12)
js (2.3.15)
json-report (0.3.5)
screenshot (0.0.1)
xml-report (0.2.3)
In the default. properties file we have also added the following entry:
enable_multithreading = true
Three spec files
We are running three spec files which contain the same navigation steps.
and are running them as below:
gauge run specs -p -n=4 --verbose
We are using static webdriver instance, this appears to conflict and creates in consistency while running it. The behavior appears to be erratic, for e.g:, we notice that the data is input incorrectly to a test case as the web driver appears to be key in the test data into only the browser it has a handle instead of their respective browser instances.
Code is as below:
using System;
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using Gauge.CSharp.Lib;
using Gauge.CSharp.Lib.Attribute;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using System.Threading;
namespace DefaultProj
{
public class StepImplementation
{
private static IWebDriver seleniumDriver;
public void SearchWithName(string name)
{
try{
this.initWebDriver();
this.LaunchApp();
}
}
Beta Was this translation helpful? Give feedback.
All reactions