I am trying to run parallel test using selenium grid setup
The test runs successfully on bitbucket pipelines but doesn't execute in parallel however the same scripts runs fine on my local docker setup
Below is how my bitbucket-pipelines.yml file looks like
image: maven:3.6.1-jdk-8
pipelines:
default:
- step:
name: E2E tests
size: 2x
caches:
- maven
script:
- mvn -B clean install # -B batch mode makes Maven less verbose
services:
- chrome
- firefox
- hub
definitions:
services:
chrome:
environment:
HUB_PORT_4444_TCP_ADDR: localhost
HUB_PORT_4444_TCP_PORT: 4444
NODE_MAX_INSTANCE: 8
NODE_MAX_SESSION: 8
image: selenium/node-chrome-debug
memory: 2048
firefox:
environment:
DISPLAY: :88
HUB_PORT_4444_TCP_ADDR: localhost
HUB_PORT_4444_TCP_PORT: 4444
NODE_MAX_INSTANCE: 8
NODE_MAX_SESSION: 8
SE_OPTS: -port 5556
image: selenium/node-firefox-debug
memory: 1536
hub:
environment:
SE_OPTS: -host 127.0.0.1
image: selenium/hub
memory: 2048
Hello @Ronald Faizaan Shaikh,
I'm not an expert in Pipelines configuration, but I don't see anything related to parallelisation in the script you posted. There can be two ways to parallelise the tests you're running:
Hope this helps. Let me know if you have any questions.
Cheers,
Daniil
Hi @Daniil Penkin ,
Thanks for the quick response.
I am using the second method. Maven surefire plugin is handling the parallelisation. When I execute the exact same code on my local docker setup it runs the suite files in parallel however the same doesn't work using bitbucket pipeline it runs sequentially one thread at a time. Is there a thread limit ?
Below is Maven surefire plugin configuration for your reference
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
<configuration>
<systemPropertyVariables>
<environment>${env.USER}</environment>
<selenium-hub.host>localhost</selenium-hub.host>
</systemPropertyVariables>
<forkCount>0</forkCount>
<suiteXmlFiles>
<!-- TestNG suite XML files -->
<suiteXmlFile>test1.xml</suiteXmlFile>
<suiteXmlFile>test2.xml</suiteXmlFile>
<suiteXmlFile>test3.xml</suiteXmlFile>
<suiteXmlFile>test4.xml</suiteXmlFile>
<suiteXmlFile>test5.xml</suiteXmlFile>
<suiteXmlFile>test6.xml</suiteXmlFile>
<suiteXmlFile>test7.xml</suiteXmlFile>
</suiteXmlFiles>
<properties>
<property>
<name>suitethreadpoolsize</name>
<value>3</value>
</property>
</properties>
</configuration>
</plugin>
</plugins>
Below is docker-compose.yml that I run locally for your reference
Ignore the environment variable in the mvn command
version: "3"
services:
hub:
image: selenium/hub
ports:
- "4444:4444"
chrome:
image: selenium/node-chrome-debug
volumes:
- /dev/shm:/dev/shm
depends_on:
- hub
links:
- hub
ports:
- "5900:5900"
environment:
- HUB_HOST=hub
- HUB_PORT=4444
- NODE_MAX_SESSION=8
- NODE_MAX_INSTANCES=8
firefox:
image: selenium/node-firefox-debug
volumes:
- /dev/shm:/dev/shm
depends_on:
- hub
links:
- hub
ports:
- "5901:5900"
environment:
- HUB_HOST=hub
- HUB_PORT=4444
- NODE_MAX_SESSION=8
- NODE_MAX_INSTANCES=8
mvn:
# Run pre-built maven image from docker library
image: maven:3.6.1-jdk-8
volumes:
# Cache maven dependencies
#- $HOME/.m2:/root/.m2
# Mount the application source and target directories
- ./:/usr/src/mvn-src
# Run maven inside the application directory
working_dir: /usr/src/mvn-src
command: mvn clean install -Dselenium-hub.host=hub
links:
- hub
- firefox
- chrome
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ronald Faizaan Shaikh Were you able to find a solution to run the scripts parallely?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.