0
0
Selenium Javatesting~10 mins

Parallel execution configuration in Selenium Java - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the number of threads for parallel execution in TestNG.

Selenium Java
<suite name="ParallelSuite" parallel="tests" thread-count="[1]">
</suite>
Drag options to blanks, or click blank then click option'
A1
B5
C3
D10
Attempts:
3 left
💡 Hint
Common Mistakes
Setting thread-count to 0 or negative numbers causes errors.
Forgetting to set thread-count disables parallelism.
2fill in blank
medium

Complete the TestNG XML to run methods in parallel.

Selenium Java
<suite name="MethodParallelSuite" parallel="[1]" thread-count="4">
</suite>
Drag options to blanks, or click blank then click option'
Ainstances
Bmethods
Cclasses
Dtests
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'tests' runs entire test tags in parallel, not methods.
Using 'classes' runs classes in parallel, not individual methods.
3fill in blank
hard

Fix the error in the Java code to enable parallel execution with Selenium WebDriver.

Selenium Java
WebDriver driver = new [1]();
driver.get("https://example.com");
Drag options to blanks, or click blank then click option'
AChromeDriver
BFirefoxDriver
CWebDriver
DRemoteWebDriver
Attempts:
3 left
💡 Hint
Common Mistakes
Using ChromeDriver or FirefoxDriver directly limits parallelism to local machine.
Using WebDriver interface directly cannot instantiate an object.
4fill in blank
hard

Fill both blanks to configure TestNG to run classes in parallel with 2 threads.

Selenium Java
<suite name="ClassParallelSuite" parallel="[1]" thread-count="[2]">
</suite>
Drag options to blanks, or click blank then click option'
Aclasses
Bmethods
C2
D4
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'methods' instead of 'classes' changes parallelism level.
Setting thread-count too high may overload the system.
5fill in blank
hard

Fill all three blanks to create a TestNG XML snippet that runs tests in parallel with 3 threads and preserves order.

Selenium Java
<suite name="ParallelSuite" parallel="[1]" thread-count="[2]" preserve-order="[3]">
</suite>
Drag options to blanks, or click blank then click option'
Atests
B3
Ctrue
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Setting preserve-order to false may cause tests to run in any order.
Using thread-count less than 1 disables parallelism.