Re: [testng-users] Various Tests using TestNG Run One After the Other

36 views
Skip to first unread message

Krishnan Mahadevan

unread,
Aug 9, 2012, 9:57:19 AM8/9/12
to testng...@googlegroups.com
Kumar,
Can you please share your code ?


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"



On Thu, Aug 9, 2012 at 7:02 PM, Kumar <your...@gmail.com> wrote:
Hi,

I am working on Selenium WebDriver with TestNG in Eclipse.
I have written a class and various test cases under @Test annotation.
I am trying to run all the test cases one after the other, but it doesn't run. I have used an object to open the web browser and normally, we use the same object to create several other objects to find xpath and perform action on them.

It is unable to use the object that I created as a public for opening the web browser and it is not able to find the xpath as no action is performed.

I don't want to use  'depends' as the current test/method wont execute if its predecessor method fails.

Please help

Thanks,
Kumar

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/BbuMQDysxfcJ.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.

Kumar

unread,
Aug 9, 2012, 9:59:19 AM8/9/12
to testng...@googlegroups.com
Here it is attached.

Thanks,
Kumar
Code.txt

Krishnan Mahadevan

unread,
Aug 9, 2012, 10:36:46 AM8/9/12
to testng...@googlegroups.com
Kumar,
The code looks ok to me. What is the issue you are facing ?

Can you please provide any stacktrace or add more details as to where you are stuck ?

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"



To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/-OR4kv6wzRUJ.

Kumar

unread,
Aug 9, 2012, 10:46:49 AM8/9/12
to testng...@googlegroups.com
Thanks for reviewing the code. :)

I don't know what is stack trace, don't know how to get it nor I know if it is useful for me. Can you explain more about it?

My problem is this..

For example, in my code, my test "changesinproperties" fails, then subsequent tests are not running and I dont want that to happen.

Thanks,
Kumar

Kumar

unread,
Aug 9, 2012, 11:09:05 AM8/9/12
to testng...@googlegroups.com
The reason I have dependencies used because of the sequence of the tests. They should run in a sequence and if any test fails in between, the next test case should run without any problem.

Thanks,
Kumar

Tomek Kaczanowski

unread,
Aug 9, 2012, 11:50:58 AM8/9/12
to testng...@googlegroups.com
Hi Kumar,

the behaviour you are observing is exactly what dependsOnMethods was
meant for. Maybe "priority" is what you are after - please see
http://testng.org/doc/documentation-main.html

--
Regards / Pozdrawiam
Tomek Kaczanowski
http://practicalunittesting.com


2012/8/9 Kumar <your...@gmail.com>:
> https://groups.google.com/d/msg/testng-users/-/cL6parGqsmsJ.
Reply all
Reply to author
Forward
0 new messages