Using Module Variable

Ranorex Spy, Recorder, and Studio.
Deepak_Singh
Posts: 76
Joined: Fri Mar 14, 2014 2:37 pm

Using Module Variable

Post by Deepak_Singh » Fri Apr 18, 2014 10:57 am

Hi All,
I am using a test suite in there are Multiple Test cases. Each Test case has 2 Module Variable's URL and Browser.
Now to change the URL and Browser I have to go to Excel and change the Data and then go to each Test case and do the binding again.

This is Time consuming and Lengthy Process. Is there a way to Declare the Variable's explicitly and just by once doing Data Binding will apply to all the test cases contained in the Suite.
Please Help.


Thanks And Regards,
Deepak

mzperix
Posts: 137
Joined: Fri Apr 06, 2012 12:19 pm

Re: Using Module Variable

Post by mzperix » Fri Apr 18, 2014 1:30 pm

Hi Deepak,

Use the Global parameters option for this. Right click on the test suite name, and select Global parameters... menuitem. See screenshot.

Every test case will have a new entry in the bind variables screen with this option.

This way you only need to change the global parameter inside Test suite, and the bindings are not lost.

Kind Regards,
Zoltán
Attachments
global_parameters.png
global_parameters.png (24.98 KiB) Viewed 1108 times

Deepak_Singh
Posts: 76
Joined: Fri Mar 14, 2014 2:37 pm

Re: Using Module Variable

Post by Deepak_Singh » Fri Apr 18, 2014 1:54 pm

Hi Zoltán,
I have used that and it shows me "url: http://google.com browser: IE " in Iteration1
But in Test Case it shows:Current variable values: $url = '', $browser = ''


What should I do in this Case?


Regards,
Deepak

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Using Module Variable

Post by Support Team » Tue Apr 22, 2014 8:55 am

Hello Deepak,

Please make sure that you bind your module variables to the global parameter.
TestCaseDataBinding.png
TestCaseDataBinding.png (16.08 KiB) Viewed 1082 times
DataBinding.png
DataBinding.png (4.14 KiB) Viewed 1082 times
Regards,
Robert
.
Image

Deepak_Singh
Posts: 76
Joined: Fri Mar 14, 2014 2:37 pm

Re: Using Module Variable

Post by Deepak_Singh » Tue Apr 22, 2014 1:47 pm

Hi Robert,

I have used Data Binding as well.

Regards,
Deepak

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Using Module Variable

Post by Support Team » Wed Apr 23, 2014 1:54 pm

Hi Deepak_Singh,

May I ask you to send your generated report file to [email protected]
This would really help us in analyzing your issue.

Regards,
Robert
.
Image

Deepak_Singh
Posts: 76
Joined: Fri Mar 14, 2014 2:37 pm

Re: Using Module Variable

Post by Deepak_Singh » Fri Apr 25, 2014 1:46 pm

Hi All,

I resolved the issue.

But my question is that if I change the data in my Excel then I have to every time go to each test case and do Binding again.
I need help in reducing this pain.

Regards,
Deepak

mzperix
Posts: 137
Joined: Fri Apr 06, 2012 12:19 pm

Re: Using Module Variable

Post by mzperix » Fri Apr 25, 2014 2:31 pm

Hi Deepak,

hmm, changing the excel data should not unbind your variables. I used many times a worksheet, and changing does not looses variable. I have some questions:
- Is the excel spreadsheet in a network drive?Is it in a different folder from the Ranorex project?
- Do you use formulas in excel?
- Does different data connectors use different worksheets?
- Do you manipulate data connectors from usercode? I could imagine, that somewhere in the code the bindings get lost.
- Do you manipulate the excel sheet from code?

Best regards,
Zoltan

Deepak_Singh
Posts: 76
Joined: Fri Mar 14, 2014 2:37 pm

Re: Using Module Variable

Post by Deepak_Singh » Mon Apr 28, 2014 2:13 pm

Is the excel spreadsheet in a network drive?-No
Is it in a different folder from the Ranorex project?-No
Do you use formulas in excel?-No
Does different data connectors use different worksheets?-No
Do you manipulate data connectors from usercode?-No
Do you manipulate the excel sheet from code?-No

Regards,
Deepak

mzperix
Posts: 137
Joined: Fri Apr 06, 2012 12:19 pm

Re: Using Module Variable

Post by mzperix » Mon Apr 28, 2014 3:14 pm

OK, I tried to reproduce the issue. I could not, unfortunately. I use win7 64 bit, and Excel 2013.

Here is what I did:

1. Created an Excel connector (I checked the copy file to Project option also).
2. Added the connector to a few test cases.
3. Bind the variables.
4. opened the excel sheet
5. added some rows / edited a few rows
6. Save
7. If I went back to Ranorex studio, I got a message If I ant to Reload the Excel.
8. Clicken on Yes.

I checked the data in ranorex: everything is updated, and no variable binding is lost.

Could you tell us some more details? Can you reproduce this issue on a fresh and clean solution?

Best regards,
Zoltan