- aime42
- Posts : 1
Join date : 2010-06-02
How to propagate variable between tests inside a test suite in Selenium RC
Thu Jun 03, 2010 4:32 pm
Hi,
I am using Selenium RC with HTMLSuite.
My test suite is built with a first test, that gets initial values calling webservice and stores them in variables, then a list of tests.
My question is how I can access to store variables of the first test when the following tests of the test suite are running.
Here is the illustration of my test suite and the variables expected are l_email and l_pwd.
Thanks in advance.
Best Regards,
Aime
I am using Selenium RC with HTMLSuite.
My test suite is built with a first test, that gets initial values calling webservice and stores them in variables, then a list of tests.
My question is how I can access to store variables of the first test when the following tests of the test suite are running.
Here is the illustration of my test suite and the variables expected are l_email and l_pwd.
Thanks in advance.
Best Regards,
Aime
- Code:
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
[table][tr][td][b]Test suite initialization[/b][/td][/tr][tr][td][url=http://seleniumforum.forumotion.net/./init.html]Initialization[/url][/td][/tr][tr][td][url=http://seleniumforum.forumotion.net/./login.html]Login[/url][/td][/tr] [/table]
------------ init.html ------------
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
[table border="1" cellpadding="1" cellspacing="1"][tr][td rowspan="1" colspan="3"]Initialization[/td][/tr][tr][td]open[/td][td]/ws/getUser.php?restricted=N&coef=60[/td][td][/td][/tr][tr][td]assertTable[/td][td]param.0.0[/td][td]email[/td][/tr][tr][td]storeTable[/td][td]param.0.1[/td][td]l_email[/td][/tr][tr][td]assertTable[/td][td]param.1.0[/td][td]password[/td][/tr][tr][td]storeTable[/td][td]param.1.1[/td][td]l_pwd[/td][/tr][/table]
------------ login.html ------------
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
[table border="1" cellpadding="1" cellspacing="1"][tr][td rowspan="1" colspan="3"]Login[/td][/tr][tr][td]open[/td][td]/[/td][td][/td][/tr][tr][td]type[/td][td]email[/td][td]${l_email}[/td][/tr][tr][td]type[/td][td]password[/td][td]${l_pwd}[/td][/tr][tr][td]click[/td][td]btn3[/td][td][/td][/tr][tr][td]waitForElementNotPresent[/td][td]//form[@id='login'][/td][td][/td][/tr][tr][td]waitForTextPresent[/td][td]Success[/td][td][/td][/tr][tr][td]assertTextPresent[/td][td]Success[/td][td][/td][/tr][tr][td]verifyTextPresent[/td][td]Success[/td][td][/td][/tr][/table]
Re: How to propagate variable between tests inside a test suite in Selenium RC
Fri Jun 04, 2010 1:51 pm
Hi,
If you defined some variable in a test case and you want it to retrieve that variable into other test.
For this you have to take help of any programming language that selenium support and you have to declare all your variables global which nedd to be accessed in other test case .
By declaring global you can access that variable anywhere. But for hat I think you need to convert your all html suite into a coding block of test case.
best of luck
Bye
If you defined some variable in a test case and you want it to retrieve that variable into other test.
For this you have to take help of any programming language that selenium support and you have to declare all your variables global which nedd to be accessed in other test case .
By declaring global you can access that variable anywhere. But for hat I think you need to convert your all html suite into a coding block of test case.
best of luck
Bye
Permissions in this forum:
You cannot reply to topics in this forum