SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Sep 2008
    Posts
    44
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    where to find testng.xml file

    Hi,

    i am new to selenium and i am trying to use testng and eclipse to run tests.But i doont know where to find the testng.xml file which i want to configure my tests

    Thanks
    Kiran Pol

  2. #2
    Advanced Member
    Join Date
    May 2006
    Location
    United Kingdom
    Posts
    742
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: where to find testng.xml file

    1. go to package ,src> right click > new> file. Give file name testng.xml

    2. <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
    <suite name="Your Suite name">
    <test verbose="2" name="Login104" annotations="JDK" enabled="false">
    <parameter name="testcase" value="TCID104"/>
    <parameter name="wPassword" value="wrongpassword"/>
    <groups>
    <run>

    <include name="TestCase104"/>
    </run>
    </groups>
    <classes>
    <class name="pkg.Test.LoginTests" />
    </classes>
    </test>
    </suite>



    make true to run the test.
    3. Import external jar testng.jar ( google for it) in project.

    4.
    If you are using eclipse the update software at Eclipse>help >Update software > http://beust.com/eclipse and install

    For more detail see the post:
    http://www.sqaforums.com/showflat.php?Ca...true#Post641827

  3. #3
    Member
    Join Date
    Sep 2008
    Posts
    44
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: where to find testng.xml file

    Hi

    thanks for the reply

    i am trying to execute the below code

    package org.examples;

    import java.util.*;
    import org.testng.Assert;
    import org.testng.annotations.*;


    public class NewTest {

    @Test
    @Parameters(value="number")
    public void parameterIntTest(int number) {
    System.out.println("Parameterized Number is : " + number);
    }



    }

    and my testng.xml file looks like

    <!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
    <suite name="My test suite">
    <test name="testing">

    <parameter name="number" value="2"/>

    <classes>
    <class name="NewTest" />
    </classes>
    </test>
    </suite>

    but i am getting error

    Setting connection parameters:127.0.0.1:2694
    [TestRunner] Starting executor with time out:2147483647 milliseconds.
    [TestNG] Running:
    C:\Documents and Settings\kiran.pol\Local Settings\Temp\testng-eclipse\testng-customsuite.xml

    SKIPPED: parameterIntTest

    ===============================================
    org.examples.NewTest
    Tests run: 1, Failures: 0, Skips: 1
    ===============================================


    ===============================================
    sampleproj
    Total tests run: 1, Failures: 1, Skips: 0
    ===============================================


    am i missing something ?

  4. #4
    Advanced Member
    Join Date
    May 2006
    Location
    United Kingdom
    Posts
    742
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: where to find testng.xml file

    1. I guess you are not including class correctly
    <class name="pkg.Test.LoginTests" />
    2. there is no run and group <groups>
    <run>

    <include name="TestCase104"/>
    </run>
    </groups>

    or follow format in this post.

  5. #5
    Member
    Join Date
    Sep 2008
    Posts
    44
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: where to find testng.xml file

    Hi

    i tried as below and is working fine noe

    <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >



    <suite name="Suite1" verbose="1" >

    <test name="test1" preserve-order="true">

    <classes>

    <class name="com.examples.tests.myeftest" />
    <methods>
    <parameter name="username" value="xyzabc" />
    <parameter name="password" value="654321" />
    <include name="test1" />
    <parameter name="first-name" value="mnbvcxz" />
    <include name="testSingleString" />



    </methods>



    </classes>

    </test>

    </suite>

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.11%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:28 AM.

Copyright BetaSoft Inc.