- majkelos
- Posts : 1
Join date : 2010-04-13
Selenium Parametrization
Tue Apr 13, 2010 2:39 am
Hi guys,
I would like to ask you about parametrisation in Selenium, but i'll
start from beginning.
1) When i was making test cases i put some essential data into
variables (eg. user id, passes, other numbers)
2) As testsuite expanded i used include command for including separate
file containing these variables into each testcase
3) Everything was working under IDE and RC
but now i've decieded that it could be useful not to include file (in
terms of including separate lines into testcase) but to include it in
background rg. from XML file.
I have worked some time on two of selenium user extensions -
"include" and "data driven" and prepared another one that can include
values from xml and store them as variables ins selenium.
source code is here: http://wklej.org/id/314615/
XML file should look like this:
variable_name
variable_value
and everything is working OK - meaning:
1) when i start selenium IDE it is loading variables and i can use
them throughout whole test suite.
2) i can oveerwrite variables and assign new value
3) it is WAY much faster than using ordinary include command
4) there is a option called "WczytajZmienne" that enables me to
include another file during test suite
BUT !
If i try to use it under selenium RC, there are some problems and RC
doesn't see my variables all the time - i supose that Selenium RC is
working like this :
- load testsuite
- load test case (and clear all other stuff)
and by the way it clears variables located in memory.
So there is qestion to you guys. How can i solve this problem ?
i see some options but i have compeletly no idea how to make them
happen:
- first is: Add additional "command" into "load test case" so as it
will load these variables (but duno where to find it and how to put
it)
- second: Define some kind of HARD VARIABLE that can be easily used
in selenium - via ${variable_name} -> i know that i just can declare
variable in script, but than it will requires me to use some
sophisticated expressions to use them in selenium, and i want it nice,
sharp and beautiful
i'm realy counting on your help.
than u in advance
and best regards
I would like to ask you about parametrisation in Selenium, but i'll
start from beginning.
1) When i was making test cases i put some essential data into
variables (eg. user id, passes, other numbers)
2) As testsuite expanded i used include command for including separate
file containing these variables into each testcase
3) Everything was working under IDE and RC
but now i've decieded that it could be useful not to include file (in
terms of including separate lines into testcase) but to include it in
background rg. from XML file.
I have worked some time on two of selenium user extensions -
"include" and "data driven" and prepared another one that can include
values from xml and store them as variables ins selenium.
source code is here: http://wklej.org/id/314615/
XML file should look like this:
and everything is working OK - meaning:
1) when i start selenium IDE it is loading variables and i can use
them throughout whole test suite.
2) i can oveerwrite variables and assign new value
3) it is WAY much faster than using ordinary include command
4) there is a option called "WczytajZmienne" that enables me to
include another file during test suite
BUT !
If i try to use it under selenium RC, there are some problems and RC
doesn't see my variables all the time - i supose that Selenium RC is
working like this :
- load testsuite
- load test case (and clear all other stuff)
and by the way it clears variables located in memory.
So there is qestion to you guys. How can i solve this problem ?
i see some options but i have compeletly no idea how to make them
happen:
- first is: Add additional "command" into "load test case" so as it
will load these variables (but duno where to find it and how to put
it)
- second: Define some kind of HARD VARIABLE that can be easily used
in selenium - via ${variable_name} -> i know that i just can declare
variable in script, but than it will requires me to use some
sophisticated expressions to use them in selenium, and i want it nice,
sharp and beautiful
i'm realy counting on your help.
than u in advance
and best regards
Re: Selenium Parametrization
Wed Apr 14, 2010 11:43 am
hi,
checkout this thread
https://seleniumforum.forumotion.net/selenium-rc-discussion-f4/how-to-pass-parameter-in-selinium-command-in-perl-t171.htm?highlight=parameter
Best of luck.
Bye
checkout this thread
https://seleniumforum.forumotion.net/selenium-rc-discussion-f4/how-to-pass-parameter-in-selinium-command-in-perl-t171.htm?highlight=parameter
Best of luck.
Bye
- gaurang033Active particpant
- Posts : 13
Join date : 2011-03-19
Re: Selenium Parametrization
Tue Mar 29, 2011 9:24 pm
No matter what framework you are using, Junit or TestNG both provides parameterization. The only difference is Junit provides it as class level, meaning only one method of the call can be parameterized while TestNG provides it at method level, mean different method of the same class can be parameterized.
see the following post that might help u .
http://qtp-help.blogspot.com/2009/05/junit-parameterization.html
see the following post that might help u .
http://qtp-help.blogspot.com/2009/05/junit-parameterization.html
- Parametrization using Excel in JUnit or TestNG
- Can Selenium do image comparison tests; support mobile browsers; and other FAQs about Selenium
- What is the use of Selenium Core and Selenium Test Manager ? (N-Unit Procedures in VS 2010)
- Creating detail log for selenium command execution (Selenium RC Java client)?
- [Help] Problem of running selenium Testcase[Java Junit] with Selenium RC
Permissions in this forum:
You cannot reply to topics in this forum
|
|