I am new to Gradle 1.4. I have a requirement to Automate the Test cases across different Browser combination which I need to run on sauce labs.I have used Selenium 2.31 and TestNG for building the scripts. I am passing the browser and platform combinations from build.gradle as System Property and within the script I am instantiating the browser on sauce labs.
ext.exeenvironments = [“RemoteWin2008firefox18”, “RemoteWin2008Gchrome24”] //smoke Test Automation tasks GParsPool.withPool(poolSize) {
exeenvironments.eachParallel { environment ->
task “${environment}Test”(type: Test) {
systemProperty “LOG_DIRECTORY”,"$buildDir/reports/tests/"
testReportDir = file("$buildDir/reports/tests/AutomationTest-report")
systemProperty “exeenvironment”, environment
useTestNG()
options.suites(“src/test/resources/nike/Wholesale/testng.xml”)
}}}
task smokeTest(overwrite: true,dependsOn: exeenvironments.collect {tasks["${it}Test"]})
The values present in exeenvironment are userdefinednames which I will split inside the selenium script to identify the platform,browser and version combinations.
Now, I want the test present in my TestNG suite to run parallel across the mentioned browsers. But the scripts are executed successfully in sequential manner but not parallel. I have also tried with maxParallelForks also but that doesn’t work.
Kindly let me know how I can run my TestNG suite with all the different browser combinations.