Display results as :
Advanced Search

Go down
Posts : 1
Join date : 2010-06-02

How to propagate variable between tests inside a test suite in Selenium RC

on Thu Jun 03, 2010 4:32 pm

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,



[table][tr][td][b]Test suite initialization[/b][/td][/tr][tr][td][url=]Initialization[/url][/td][/tr][tr][td][url=]Login[/url][/td][/tr] [/table]

------------ init.html ------------







[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 ------------










[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]

Posts : 387
Join date : 2009-07-30
Location : India

Re: How to propagate variable between tests inside a test suite in Selenium RC

on Fri Jun 04, 2010 1:51 pm

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

Back to top
Permissions in this forum:
You cannot reply to topics in this forum