Hi,
I'm new to all this but seem to have similar issues.
If I take the example above and modify it slighty to not have the
methods alphabetical:-
package raw.code;
import org.testng.annotations.Test;
public class ShowSingleExecutionOfTestMethod {
@Test
public void z() {
System.out.println("Hello A");
}
@Test
public void t() {
System.out.println("Hello B");
}
@Test
public void h() {
System.out.println("Hello C");
}
@Test
public void a() {
System.out.println("Hello D");
}
@Test
public void x() {
System.out.println("Hello E");
}
}
The output is:-
Hello D
Hello C
Hello B
Hello E
Hello A
===============================================
Suite
Total tests run: 5, Failures: 0, Skips: 0
===============================================
and the xml file:-
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "
http://testng.org/testng-1.0.dtd">
<suite name="Suite" parallel="false">
<test name="Test" preserve-order="true">
<classes>
<class name="raw.code.ShowSingleExecutionOfTestMethod">
</class>
</classes>
</test> <!-- Test -->
</suite> <!-- Suite -->
I've obviously got something wrong as I expected the output to be:-
Hello A
Hello B
Hello C
Hello D
Hello E
Thanks for any info.
Mark
> > On Mon, May 28, 2012 at 1:52 PM, unni <
junistep...@gmail.com> wrote:
>
> >> I have created FirfoxProfile as my system does not work in normal way
> >> with Proxy...
>
> >> You can only have the below line in the setup method
> >> driver = new FirefoxDriver();
> >> driver.get(url)
>
> >> On Monday, 28 May 2012 12:44:33 UTC+5:30, Cédric Beust ♔ wrote:
>
> >>> Any small test case that I could build myself? (this one seems to depend
> >>> on Selenium)
>
> >>> --
> >>> Cédric
>
> >>> On Mon, May 28, 2012 at 12:05 AM, unni <
junistep...@gmail.com> wrote:
>
> >>>> Cedric,
>
> >>>> Please find the attached result files for the sample class.
>
> >>>> include - demonstrate the system includes all methods of class, not the
> >>>> specified ones
> >>>> preserve-order - never worked for me.. as you have asked sample i
> >>>> thought of showing that as well. It always works alphabetical order.
> >>>> sample.java - though i have used proxy setting , the above issues
> >>>> always for normal run as well.
>
> >>>> Thanks
> >>>> Unni
>
> >>>> On Friday, 25 May 2012 20:43:09 UTC+5:30, Cédric Beust ♔ wrote:
>
> >>>>> No, only the included method should run.
>
> >>>>> --
> >>>>> Cédric
>
> >>>>> On Fri, May 25, 2012 at 2:53 AM, Smita Sinha <
sayhi.gem...@gmail.com>wrote:
>
> >>>>>> Even I have experienced this.
> >>>>>> You need to explicitly write the
> >>>>>> <Exclude name="name of the method to be excluded" />
>
> >>>>>> I it does not find the Exclude by default it includes all the method
> >>>>>> for run.
>
> >>>>>> Thanks,
> >>>>>> Smita
>
> >>>>>> On Fri, May 25, 2012 at 3:12 PM, unni <
junistep...@gmail.com> wrote:
>
> >>>>>>> HI All,
>
> >>>>>>> I am using testNG 6.4 Webdriver (selenium standalone server) 2.20,
> >>>>>>> eclipse
>
> >>>>>>> I have class and which has 5 methods. I include only one test method
> >>>>>>> in my testng.xml and when i run it always execute all five test methods.
> >>>>>>> Why not it acts base on my testng.xml
>
> >>>>>>> <class name="test.aTest" >
> >>>>>>> <include name="isLinkXPresent" />
> >>>>>>> </class>
>
> >>>>>>> Thanks
> >>>>>>> Unni
>
> >>>>>>> --
> >>>>>>> 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/**ms**g/testng-users/-/**c6QmKCXVuygJ<
https://groups.google.com/d/msg/testng-users/-/c6QmKCXVuygJ>
> >>>>>>> .
> >>>>>>> To post to this group, send email to
testng...@googlegroups.com.
> >>>>>>> To unsubscribe from this group, send email to
> >>>>>>> testng-users+unsubscribe@**googl**
egroups.com<
testng-users%2Bunsu...@googlegroups.com>
> >>>>>>> .
> >>>>>>> For more options, visit this group athttp://
groups.google.com/**
> >>>>>>> group**/testng-users?hl=en<
http://groups.google.com/group/testng-users?hl=en>
> >>>>>>> .
>
> >>>>>> --
> >>>>>> You received this message because you are subscribed to the Google
> >>>>>> Groups "testng-users" group.
> >>>>>> To post to this group, send email to
testng...@googlegroups.com.
> >>>>>> To unsubscribe from this group, send email to
> >>>>>> testng-users+unsubscribe@**googl**
egroups.com<
testng-users%2Bunsu...@googlegroups.com>
> >>>>>> .
> >>>>>> For more options, visit this group athttp://
groups.google.com/**
> >>>>>> group**/testng-users?hl=en<
http://groups.google.com/group/testng-users?hl=en>
> >>>>>> .
>
> >>>>> --
> >>>> You received this message because you are subscribed to the Google
> >>>> Groups "testng-users" group.
> >>>> To view this discussion on the web visithttps://
groups.google.com/d/**
> >>>> msg/testng-users/-/**EP0Ww0Wm7LYJ<
https://groups.google.com/d/msg/testng-users/-/EP0Ww0Wm7LYJ>.
>
> >>>> To post to this group, send email to
testng...@googlegroups.com.
> >>>> To unsubscribe from this group, send email to testng-users+unsubscribe@
> >>>> **
googlegroups.com <
testng-users%2Bunsu...@googlegroups.com>.
> >>>> For more options, visit this group athttp://
groups.google.com/**
> >>>> group/testng-users?hl=en<
http://groups.google.com/group/testng-users?hl=en>
> >>>> .
>
> >> On Monday, 28 May 2012 12:44:33 UTC+5:30, Cédric Beust ♔ wrote:
>
> >>> Any small test case that I could build myself? (this one seems to depend
> >>> on Selenium)
>
> >>> --
> >>> Cédric
>
> >>> On Mon, May 28, 2012 at 12:05 AM, unni <
junistep...@gmail.com> wrote:
>
> >>>> Cedric,
>
> >>>> Please find the attached result files for the sample class.
>
> >>>> include - demonstrate the system includes all methods of class, not the
> >>>> specified ones
> >>>> preserve-order - never worked for me.. as you have asked sample i
> >>>> thought of showing that as well. It always works alphabetical order.
> >>>> sample.java - though i have used proxy setting , the above issues
> >>>> always for normal run as well.
>
> >>>> Thanks
> >>>> Unni
>
> >>>> On Friday, 25 May 2012 20:43:09 UTC+5:30, Cédric Beust ♔ wrote:
>
> >>>>> No, only the included method should run.
>
> >>>>> --
> >>>>> Cédric
>
> >>>>> On Fri, May 25, 2012 at 2:53 AM, Smita Sinha <
sayhi.gem...@gmail.com>wrote:
>
> >>>>>> Even I have experienced this.
> >>>>>> You need to explicitly write the
> >>>>>> <Exclude name="name of the method to be excluded" />
>
> >>>>>> I it does not find the Exclude by default it includes all the method
> >>>>>> for run.
>
> >>>>>> Thanks,
> >>>>>> Smita
>
> >>>>>> On Fri, May 25, 2012 at 3:12 PM, unni <
junistep...@gmail.com> wrote:
>
> >>>>>>> HI All,
>
> >>>>>>> I am using testNG 6.4 Webdriver (selenium standalone server) 2.20,
> >>>>>>> eclipse
>
> >>>>>>> I have class and which has 5 methods. I include only one test method
> >>>>>>> in my testng.xml and when i run it always execute all five test methods.
> >>>>>>> Why not it acts base on my testng.xml
>
> >>>>>>> <class name="test.aTest" >
> >>>>>>> <include name="isLinkXPresent" />
> >>>>>>> </class>
>
> >>>>>>> Thanks
> >>>>>>> Unni
>
> >>>>>>> --
> >>>>>>> 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/**ms**g/testng-users/-/**c6QmKCXVuygJ<
https://groups.google.com/d/msg/testng-users/-/c6QmKCXVuygJ>
> >>>>>>> .
> >>>>>>> To post to this group, send email to
testng...@googlegroups.com.
> >>>>>>> To unsubscribe from this group, send email to
> >>>>>>> testng-users+unsubscribe@**googl**
egroups.com<
testng-users%2Bunsu...@googlegroups.com>
> >>>>>>> .
> >>>>>>> For more options, visit this group athttp://
groups.google.com/**
> >>>>>>> group**/testng-users?hl=en<
http://groups.google.com/group/testng-users?hl=en>
> >>>>>>> .
>
> >>>>>> --
> >>>>>> You received this message because you are subscribed to the Google
> >>>>>> Groups "testng-users" group.
> >>>>>> To post to this group, send email to
testng...@googlegroups.com.
> >>>>>> To unsubscribe from this group, send email to
> >>>>>> testng-users+unsubscribe@**googl**
egroups.com<
testng-users%2Bunsu...@googlegroups.com>
> >>>>>> .
> >>>>>> For more options, visit this group athttp://
groups.google.com/**
> >>>>>> group**/testng-users?hl=en<
http://groups.google.com/group/testng-users?hl=en>
> >>>>>> .
>
> >>>>> --
> >>>> You received this message because you are subscribed to the Google
> >>>> Groups "testng-users" group.
> >>>> To view this discussion on the web visithttps://
groups.google.com/d/**
> >>>> msg/testng-users/-/**EP0Ww0Wm7LYJ<
https://groups.google.com/d/msg/testng-users/-/EP0Ww0Wm7LYJ>.
>
> >>>> To post to this group, send email to
testng...@googlegroups.com.
> >>>> To unsubscribe from this group, send email to testng-users+unsubscribe@
>
> ...
>
> read more »