plz give me suggestion how to achive this.???
one more problem i face like
i have 5 method in the testing file (method1,method2...method5)..
and i want to excute method in the order
method3,method1,method4,method2,method5 and also no of invocation of
the methods like method5 have 3 times method2 have 8 times.
i done it like that
/**
*@testng.test invocationCount="3"
*/
method5()
{
}
/**
*@testng.test invocationCount="8"
*/
method2()
{
}
i apply beforecount="method1 " for sequence of excution the method .but
from this i achive the sequence of excution but ca't get the no of the
excution coz when same method call again due to invocationCount="3"
before method again calls..
my motto is to achive
like this scenario
method3 invocationCount="1"
method1 invocationCount="1"
method4 invocationCount="1"
method2 invocationCount="3"
method5 invocationCount="8"
but i cant find the solution for this..
have any body idea this..???
plz give me suggestion
thanks in advance
ram
first problem that i mention is i excute more then once that method..
coz i want to generate data in the database...
for that i call it no of times.. if i call in the loop then it takes
more times...!!!!
my motto is that generate bulk data in short span of times.. if i
excute it in the loop then it is taking more times...
is there any other solution through TestNG that i can generate data in
the configurable manner...
like suppose i enter usename =user1..user2....user1000 for that i have
one method createUser() method (it create user) for that i use the
TestNG and i excute createUser() 1000 times.. for 1000 users...
and second problem is also related to that i excute createUsers() 1000
times but i want to initilize the properties by excute other method
initilize() only one times..this is my problem and my motto..
plz give me the suggestion how to solve this problem..
thanks in advance....
ram....
is there any other solution that fix my problem..??
plz suggest me...
thanks in advance ..
ram...
i put java annotation jdk1.4 for TestNG
i pass both paramter and invocationCount=5 like that
/**
*@testng.test invocationCount="5"
*@testng.parameters value="user-name group-name "
*/
i pass two paramter(username and groupname ) and invocationcount ="5"
but it is excuted only once...
any idea.. about that why it is excuted only once it should excuted 5
times...
plz give me suggestion..
thanks in advance
ram....
Hello,
my problem is like i want to excute method more then one for that i
use
/**
*@testng.test invocationCount="10"
*/
but i want to change the value inplace of 10 to 15 i have to again
compile the java file and then run it..
but i want this value as the configurable like from testing.xml or i
like to call one properties file in that i put count="10"
then in the test file like that
/**
*@testng.test invocationCount="count"
*/
one more problem i face like
i have 5 method in the testing file (method1,method2...method5)..
and i want to excute method in the order
method3,method1,method4,method2,method5 and also no of invocation of
the methods like method5 have 3 times method2 have 8 times.
*/
and then define the value in testng.xml:
<parameter name="count" value="5" />
exception is throwing when i run this..
===============================================
userprofileaudit.UsersTestNG
Total tests run: 0, Failures: 0, Skips: 0
===============================================
java.lang.NumberFormatException: For input string: "${count}"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.<init>(Unknown Source)
at
org.testng.internal.jdk14.AnnotationHelper.createTestMap(AnnotationHelper.java:292)
at
org.testng.internal.jdk14.AnnotationHelper.createAnnotation(AnnotationHelper.java:153)
at
org.testng.internal.jdk14.QDoxAnnotationFinder.createMethodAnnotation(QDoxAnnotationFinder.java:249)
at
org.testng.internal.jdk14.QDoxAnnotationFinder.findAnnotation(QDoxAnnotationFinder.java:157)
at
org.testng.internal.jdk14.QDoxAnnotationFinder.findAnnotation(QDoxAnnotationFinder.java:168)
at
org.testng.internal.TestNGClassFinder.isTestNGClass(TestNGClassFinder.java:158)
at
org.testng.internal.TestNGClassFinder.<init>(TestNGClassFinder.java:49)
at org.testng.TestRunner.initMethods(TestRunner.java:240)
at org.testng.TestRunner.init(TestRunner.java:188)
at org.testng.TestRunner.init(TestRunner.java:160)
at org.testng.TestRunner.<init>(TestRunner.java:116)
at
org.testng.eclipse.runner.RemoteTestNG$2.newTestRunner(RemoteTestNG.java:81)
at
org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:347)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:151)
at org.testng.SuiteRunner.run(SuiteRunner.java:117)
at org.testng.eclipse.runner.RemoteTestNG.run(RemoteTestNG.java:99)
at org.testng.eclipse.runner.RemoteTestNG.main(RemoteTestNG.java:138)
Exception in thread "main"
i changed the parameter value
<parameter name="count" value=5 />
but is not working it required the string value..
i changed in the code also
/**
*@testng.test invocationCount=${count}
*/
but it not accepting..
any more idea abut that how to solve this..
thanks in advance..
ram.
hello Credic,
i apply ur suggestion but it is throwing the exception .
my code like
/**
*@testng.test invocationCount="${count}"
*/
and then define the value in testng.xml:
<parameter name="count" value="5" />
exception is throwing when i run this..
===============================================
userprofileaudit.UsersTestNG
Total tests run: 0, Failures: 0, Skips: 0
===============================================
java.lang.NumberFormatException: For input string: "${count}"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.<init>(Unknown Source)
at
org.testng.internal.jdk14.AnnotationHelper.createTestMap (AnnotationHelper.java:292)
at
org.testng.internal.jdk14.AnnotationHelper.createAnnotation(AnnotationHelper.java:153)
at
org.testng.internal.jdk14.QDoxAnnotationFinder.createMethodAnnotation(QDoxAnnotationFinder.java :249)
at
org.testng.internal.jdk14.QDoxAnnotationFinder.findAnnotation(QDoxAnnotationFinder.java:157)
at
org.testng.internal.jdk14.QDoxAnnotationFinder.findAnnotation(QDoxAnnotationFinder.java:168)
at
org.testng.internal.TestNGClassFinder.isTestNGClass(TestNGClassFinder.java:158)
at
org.testng.internal.TestNGClassFinder.<init>(TestNGClassFinder.java:49)
at org.testng.TestRunner.initMethods (TestRunner.java:240)
at org.testng.TestRunner.init(TestRunner.java:188)
at org.testng.TestRunner.init(TestRunner.java:160)
at org.testng.TestRunner.<init>(TestRunner.java:116)
at
org.testng.eclipse.runner.RemoteTestNG$2.newTestRunner(RemoteTestNG.java:81)
at
org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:347)
at org.testng.SuiteRunner.privateRun (SuiteRunner.java:151)
at org.testng.SuiteRunner.run(SuiteRunner.java:117)
at org.testng.eclipse.runner.RemoteTestNG.run(RemoteTestNG.java:99)
at org.testng.eclipse.runner.RemoteTestNG.main (RemoteTestNG.java:138)
Exception in thread "main"
i changed the parameter value
<parameter name="count" value=5 />
but is not working it required the string value..
i changed in the code also
/**
*@testng.test invocationCount=${count}
*/
but it not accepting..
any more idea abut that how to solve this..
thanks in advance..
ram.
Hello Cedric,
any luck on the how to pass the invocationCount to the test class from
testing.xml .
hello Credic,
i apply ur suggestion but it is throwing the exception .
my code like
/**
*@testng.test invocationCount="${count}"
*/
and then define the value in testng.xml:
<parameter name="count" value="5" />
exception is throwing when i run this..
===============================================
userprofileaudit.UsersTestNG
Total tests run: 0, Failures: 0, Skips: 0
===============================================
java.lang.NumberFormatException: For input string: "${count}"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.<init>(Unknown Source)
at
org.testng.internal.jdk14.AnnotationHelper.createTestMap (AnnotationHelper.java:292)
at
org.testng.internal.jdk14.AnnotationHelper.createAnnotation(AnnotationHelper.java:153)
at
org.testng.internal.jdk14.QDoxAnnotationFinder.createMethodAnnotation(QDoxAnnotationFinder.java :249)
at
org.testng.internal.jdk14.QDoxAnnotationFinder.findAnnotation(QDoxAnnotationFinder.java:157)
at
org.testng.internal.jdk14.QDoxAnnotationFinder.findAnnotation(QDoxAnnotationFinder.java:168)
at
org.testng.internal.TestNGClassFinder.isTestNGClass(TestNGClassFinder.java:158)
at
org.testng.internal.TestNGClassFinder.<init>(TestNGClassFinder.java:49)
at org.testng.TestRunner.initMethods (TestRunner.java:240)
at org.testng.TestRunner.init(TestRunner.java:188)
at org.testng.TestRunner.init(TestRunner.java:160)
at org.testng.TestRunner.<init>(TestRunner.java:116)
at
org.testng.eclipse.runner.RemoteTestNG$2.newTestRunner(RemoteTestNG.java:81)
at
org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:347)
at org.testng.SuiteRunner.privateRun (SuiteRunner.java:151)
at org.testng.SuiteRunner.run(SuiteRunner.java:117)
at org.testng.eclipse.runner.RemoteTestNG.run(RemoteTestNG.java:99)
at org.testng.eclipse.runner.RemoteTestNG.main (RemoteTestNG.java:138)
Exception in thread "main"
i changed the parameter value
<parameter name="count" value=5 />
but is not working it required the string value..
i changed in the code also
/**
*@testng.test invocationCount=${count}
*/
but it not accepting..
any more idea abut that how to solve this..
thanks in advance..
ram.
Hi Ram,
Well, actually there's a slight problem and parameter substitution is not going to work in this case, because this attribute is typed: it's an integer.
You are not seeing this since you are using the JDK 1.4 version and everything is a String, but the annotation is really:
@Test(invocationCount = 10, successPercentage = 80)
... and right now, I can't find any good way of being able to replace 10 with the value of a parameter...
Any suggestion?
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users+unsubscribe@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.