How to execute multiple test cases using selenium.

2,355 views
Skip to first unread message

amol jaiswal

unread,
Nov 1, 2010, 6:44:03 AM11/1/10
to Selenium Users
Hi

I am writing test scripts in Eclipse using TestNG.

I write say two test script with name a.java and b.java in same
package then I want to execute both from third file say c.java then
what should I do for that?

Right now I am importing a and b files to that c file and executing
them but it does not give report since its not running as TestNG its
running as Java Application.

Please help me out and let me know in case anyone wants more details..

Niraj Kumar

unread,
Nov 1, 2010, 6:49:33 AM11/1/10
to seleniu...@googlegroups.com
Go through this
http://automationtricks.blogspot.com/search/label/Selenium%20and%20Junit

http://automationtricks.blogspot.com/search/label/TestNG%20and%20Selenium



--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.




--
Thanks & Regard,
Niraj Kumar

amol jaiswal

unread,
Nov 1, 2010, 6:58:59 AM11/1/10
to seleniu...@googlegroups.com
Thanks a lot.
Thanks & Regards
   Amol Jaiswal

amol jaiswal

unread,
Nov 1, 2010, 7:41:08 AM11/1/10
to seleniu...@googlegroups.com
Thanks a lot It works.

amol jaiswal

unread,
Nov 1, 2010, 9:40:34 AM11/1/10
to Selenium Users
Could you please give me more tag help...

Like
1. How to run multiple tests sequential currently its running test in random manner.
2. Need to execute Test case if one of them is failed ie if any test case failed then its stop need to execute next test case.

Please let me know if anyone have any trick....

On Mon, Nov 1, 2010 at 4:14 PM, amol jaiswal <amol...@gmail.com> wrote:

Niraj Kumar

unread,
Nov 2, 2010, 7:19:37 AM11/2/10
to seleniu...@googlegroups.com
give it a try . Create a suite like this

<suite name="Suite" >
  <test name="Test" preserve-order="true">
    <classes>
       <class name="testA" />
       <class name="testB" />
    </classes>
  </test>
</suite>



--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

amol jaiswal

unread,
Nov 2, 2010, 8:06:56 AM11/2/10
to seleniu...@googlegroups.com
Ya You Always give right solution... It works..
-- 
Amol Jaiswal
BancBridge
21 STPI, MIDC Chikalthana, Aurangabad 431001
Phone: 818-889-7000
Cell:  959-543-3238
Fax: 805-830-1682
www.bancbridge.com

amol jaiswal

unread,
Nov 2, 2010, 9:23:10 AM11/2/10
to seleniu...@googlegroups.com
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Demo1">
    <test name="Audit Log check" preserve-order="true" annotations="Test">
        <classes>
            <class name="script.Bugz.demoaudit">
                <methods>
                    <include name="login_amol"></include>
                    <include name="CEO_comp_create"></include>
                    <include name="CEO_User_create"></include>
                    <include name="CEO_User_delete"></include>
                    <include name="CEO_comp_delete"></include>
                    <include name="call_Date_extract"></include>
                    <include name="logout_amol"></include>
                    <include name="login_bancbridge"></include>
                    <include name="CEO_User_audit_check"></include>
                    <include name="CEO_comp_audit_check"></include>
                    <include name="logout_bancbridge"></include>
                </methods>
            </class>
        </classes>
    </test>
</suite>

In above xml file we want to execute included method sequential not randomly now its executing in random manner.

Please help me out..
Current execution is
1. login_bancbridge
2. CEO_comp_create
3. CEO_comp_delete
4. CEO_User_create
5. logout_bancbridge
6. CEO_Useraudit_check
7. CEO_comp_audit_check
8. login_amol
9. CEO_User_delete
10. call_Date_extract
11. logout_amol
Reply all
Reply to author
Forward
0 new messages