Hi Please explain whether below sample scenario is possible with ranorex, Im dealing with an android app and with beginner knowledge on ranorex
there is username and password two text fields and login button.
I need to try different invalid combinations on it and validate the "Invalid credentials" message.
I need to bind excel data set and execute it.
but with my approach for each data combination row it needs to exit and re launch the application. is it possible to fetch the data without re launching the application like below.
[launch application]
{loop excel sheet each data row}
enter user name
enter password
press login button
validate error message
{end of last data row}
[exit]
How to loop test data set within a recording module
Re: How to loop test data set within a recording module
It isn't possible inside a single module without going into user-code.
However, you should probably consider re-configuring your modules by splitting the individual, atomic actions in your current module into their own modules. Then just add them in the test case where you need them and use the test case to loop through what you want.
Remember, test cases in Ranorex Studio's Test Suite are nothing more than for-each loops that iterate over each row of data in the connected data set.
So, you could have these modules instead:
1. Enter_UserName (takes UserName as a variable)
2. Enter_Password (takes Password as a variable)
3. Click_LoginButton
4. Validate_ErrorMessage
5. Validate_SuccessfulLogin
Then, in your test suite it would look like this:
TEST-SUITE
-TestCase1: Failed_Login -> DataConnector (each row is one INVALID login attempt)
---Enter_UserName -> Bind to DataConnector.UserName
---Enter_Password -> Bind to DataConnector.Password
---Click_LoginButton
---Validate_ErrorMessage
-TestCase2: Successful_Login -> DataConnector (each row is one VALID login attempt)
---Enter_UserName -> Bind to DataConnector.UserName
---Enter_Password -> Bind to DataConnector.Password
---Click_LoginButton
---Validate_SuccessfulLogin
---{Logout here to setup for next attempt}
Your dataset (DataConnector) can contain all rows and you can limit each test case to just the rows it should use by using the filter settings at the bottom of the data connector's dialog. Or you can create individual data sets for each test case.
Doing the above will allow you to drop in these modules wherever you need them. You can also drop them into groups and use the groups instead.
However, you should probably consider re-configuring your modules by splitting the individual, atomic actions in your current module into their own modules. Then just add them in the test case where you need them and use the test case to loop through what you want.
Remember, test cases in Ranorex Studio's Test Suite are nothing more than for-each loops that iterate over each row of data in the connected data set.
So, you could have these modules instead:
1. Enter_UserName (takes UserName as a variable)
2. Enter_Password (takes Password as a variable)
3. Click_LoginButton
4. Validate_ErrorMessage
5. Validate_SuccessfulLogin
Then, in your test suite it would look like this:
TEST-SUITE
-TestCase1: Failed_Login -> DataConnector (each row is one INVALID login attempt)
---Enter_UserName -> Bind to DataConnector.UserName
---Enter_Password -> Bind to DataConnector.Password
---Click_LoginButton
---Validate_ErrorMessage
-TestCase2: Successful_Login -> DataConnector (each row is one VALID login attempt)
---Enter_UserName -> Bind to DataConnector.UserName
---Enter_Password -> Bind to DataConnector.Password
---Click_LoginButton
---Validate_SuccessfulLogin
---{Logout here to setup for next attempt}
Your dataset (DataConnector) can contain all rows and you can limit each test case to just the rows it should use by using the filter settings at the bottom of the data connector's dialog. Or you can create individual data sets for each test case.
Doing the above will allow you to drop in these modules wherever you need them. You can also drop them into groups and use the groups instead.
Shortcuts usually aren't...
Re: How to loop test data set within a recording module
Hi,
You need to use data-driven approach. I would suggest you to start with this screencast:
http://www.ranorex.com/support/screencasts.html#c3896
And this user guide chapter:
http://www.ranorex.com/support/user-gui ... sting.html
Basically, you need to create test structure like this:
Excel sheet should have two columns (e.g. UserName and Password) and as many lines as you like (where each line represents one iteration).
Hope this helps?
You need to use data-driven approach. I would suggest you to start with this screencast:
http://www.ranorex.com/support/screencasts.html#c3896
And this user guide chapter:
http://www.ranorex.com/support/user-gui ... sting.html
Basically, you need to create test structure like this:
Code: Select all
[Test Suite]
|_launch application - recording module - this module should be outside TC
|_[LoopTestCase] <------------ here should be attached your excel data connector
| |_enter user name - recording module
| |_enter password - recording module
| |_press login button - recording module
| |_validate error message - recording module
|_exit - recording module - this module should be outside TC
Hope this helps?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: How to loop test data set within a recording module
Thanks, that also made it clear. I had the same question
The "DATA" source is attached to the Testcase that you want to have run in a loop. All actions or step in that Testcase will get run for as many times as your data has rows. It was very easy in the UI for me to properly refactor my test case.
Makes perfect sense now.
The "DATA" source is attached to the Testcase that you want to have run in a loop. All actions or step in that Testcase will get run for as many times as your data has rows. It was very easy in the UI for me to properly refactor my test case.
Makes perfect sense now.
pros:Powershell automation guru
cons:UI automation hacker/n00b
Conrad Braam
cons:UI automation hacker/n00b
Conrad Braam