Running TCs parallely through TESTNG and gradle

86 views
Skip to first unread message

Akul Sharma

unread,
May 25, 2015, 11:26:08 PM5/25/15
to seleniu...@googlegroups.com
Hi,

I want to run my scripts parallely. The issue is that gradle only allows me to run files parallely. Inside that also, I want to run multiple TCs parallely. Is there any way to do that?

Krishnan Mahadevan

unread,
May 25, 2015, 11:33:33 PM5/25/15
to Selenium Users
This question is NOT related to Selenium/WebDriver. I would recommend that you please post this on the gradle forum.

To answer your question, I think all you need to do is create a TestNG suite XML file and then follow the recommendations in this thread to get this done 


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

On Mon, May 25, 2015 at 4:11 PM, Akul Sharma <mukull...@gmail.com> wrote:
Hi,

I want to run my scripts parallely. The issue is that gradle only allows me to run files parallely. Inside that also, I want to run multiple TCs parallely. Is there any way to do that?

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/19ab879b-fdde-4759-9d0e-43ab99c6d9f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Collin

unread,
May 26, 2015, 2:10:49 AM5/26/15
to seleniu...@googlegroups.com
You’ll want something like this:

task selenium(type: Test) {
def threads = Integer.getInteger('threads') ?: 1
useTestNG() {
excludeGroups
suiteXmlBuilder().suite(name: 'selenium-tests', parallel: 'methods', 'thread-count': threads) {
test(name: "all") {
...
}
}
}
}


On 25 May 2015, at 11:41, Akul Sharma <mukull...@gmail.com> wrote:

Hi,

I want to run my scripts parallely. The issue is that gradle only allows me to run files parallely. Inside that also, I want to run multiple TCs parallely. Is there any way to do that?

Akul Sharma

unread,
May 26, 2015, 5:26:12 AM5/26/15
to seleniu...@googlegroups.com
Hi Mark,

Thanks for answering. I am totally new to this field, so have no idea what you are saying. The project we have is currently using a java based framework, with gradle as integration tool and Selenium Jar for testing. We are using TestNG for testing purpose. I will really appreciate if you can please provide the details for what you just said, like where to put this code and how this will work.

Krishnan Mahadevan

unread,
May 26, 2015, 5:43:09 AM5/26/15
to Selenium Users
I think you should just try to add that task into your build.gradle and then try invoking that task viz., "selenium"

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

Akul Sharma

unread,
May 26, 2015, 7:34:37 AM5/26/15
to seleniu...@googlegroups.com
Hey Krishnan,

Thanks for replying. Actually, I am completely new to the project and am in a learning phase. So, I just found out what is build.gradle. Can you please suggest me a link from where I can learn what is a task and how the above part can be implemented. Thanks in advance.

Krishnan Mahadevan

unread,
May 26, 2015, 7:37:06 AM5/26/15
to Selenium Users
You might want to start spending some time reading about Gradle tasks here : https://docs.gradle.org/current/userguide/more_about_tasks.html

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

Reply all
Reply to author
Forward
0 new messages