Query on Parameterization

Experiences, small talk, and other automation gossip.
bibhu
Posts: 5
Joined: Thu Aug 25, 2011 1:36 pm

Query on Parameterization

Post by bibhu » Thu Aug 25, 2011 2:02 pm

Hi ,

I have a query on data driven test. I am using the Sample VIP application . I hae created two recordings.
1. For Starting the VIP Applicaiton
2. Adding records into it.

For Adding records, I have used data driven with the help of simple data sheet. There are three rows of input data in the datasheet.
while running , for each iteration, Ranorex is opening a new VIP application where as I would like Ranorex is to open the application once & all the three rows of data should be added.

Please help us on this.

Thanks,
Bibhu

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Query on Parameterization

Post by Support Team » Thu Aug 25, 2011 2:42 pm

Hi,
I would like Ranorex is to open the application once & all the three rows of data should be added.
If you take a look at the sample "VIPTestSuite", especially at the "CheckValues" test case, then you will see that this works as you have written.
The key is to use a test case in a test case. The code where you start the program has to be located into a separate test case and then you have to add a new test case to the "parent" test case, then it will work.

Regards,
Markus
Ranorex Support Team

bibhu
Posts: 5
Joined: Thu Aug 25, 2011 1:36 pm

Re: can we create our own valiation script ?

Post by bibhu » Fri Aug 26, 2011 11:25 am

Hi,

Can I write my own validation code in Ranorex ?
also
Can you send the code snippet(C#) for validating text size of 'First Name' text box.

Thanks.
Bibhu

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Query on Parameterization

Post by Support Team » Fri Aug 26, 2011 11:31 am

Hi,
bibhu wrote:Can I write my own validation code in Ranorex ?
If you don't know the code to write for a specific action, just create that action with the Ranorex Recorder and have a look at the code the recorder generates.

Regards,
Peter
Ranorex Team

bibhu
Posts: 5
Joined: Thu Aug 25, 2011 1:36 pm

Re: Query on Parameterization

Post by bibhu » Fri Aug 26, 2011 12:24 pm

Hi Peter,

Thanks for the info. However we cannot make any validation through recording.
For example - for the Sample VIP application -

Lets say I have a scenario such as the First Name field should not accept aplhanumeric characters.

Could you please provide me the code for this ?

Thanks,
Bibhu

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Query on Parameterization

Post by Support Team » Mon Aug 29, 2011 10:12 am

Hi,

to make a validation on - as you mentioned - not alphanumeric characters you can work with the regular expression "\W" which matches on not alphanumeric characters.

To do so you can either add a validation step to your recording and choose "AttributeRegExpr" for method and "\W" as match value, or you can use following code snippet:
Validate.Attribute(repo.VipApp.InputFields.FirstNameInfo, "Text", new Regex("\\W"));
For more details about regular expressions please have a look at following links:
http://www.ranorex.com/support/user-gui ... xpath.html
http://msdn.microsoft.com/en-us/library/az24scfc.aspx

Regards,
Tobias
Support Team