Hi,
I am thinking to pass testcaseId parameter to AddUser code module.
So the code module could know which test case data needs to be loaded/run for the code module.
Thanks,
Betty
Pass parameters to code module
Re: Pass parameters to code module
Hi,
I'm not exactly sure what you want to achieve, but I think you should be able to use the approach described here:
http://www.ranorex.com/blog/sharing-dat ... to-another
All you need to do is to create a new module variable in your code module (via "New" menu or context menu accessible via right click in code module). Hope this helps?
I'm not exactly sure what you want to achieve, but I think you should be able to use the approach described here:
http://www.ranorex.com/blog/sharing-dat ... to-another
All you need to do is to create a new module variable in your code module (via "New" menu or context menu accessible via right click in code module). 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: Pass parameters to code module
Hi Pavel,
This is not what I am asking.
Say I have an excel sheet for testing login for a bunch of userId
testcaseId userId password
123 abc xxxx
124 svA XXYSSS
124 jdjdj dkddk
...
133 DDD SSSII
what I am thinking is pass different testcaseId to the code module, so it will know which row of data should be fetched and tested. Not all data rows in the excel files are tested, only specified rows.
For now I am using file name Testcase124_login.cs code module for the specific test case, which is not effective. I am thing a code module could be used by many test cases with a testcaseId passed when it is needed.
Regards,
Betty
This is not what I am asking.
Say I have an excel sheet for testing login for a bunch of userId
testcaseId userId password
123 abc xxxx
124 svA XXYSSS
124 jdjdj dkddk
...
133 DDD SSSII
what I am thinking is pass different testcaseId to the code module, so it will know which row of data should be fetched and tested. Not all data rows in the excel files are tested, only specified rows.
For now I am using file name Testcase124_login.cs code module for the specific test case, which is not effective. I am thing a code module could be used by many test cases with a testcaseId passed when it is needed.
Regards,
Betty
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Pass parameters to code module
Hello Betty,
To pass information to your code modules, you can create a module variable. You can then link the variable to a data connector or to a global parameter.
Since, you would have to define the data set somehow, I would recommend looking into using ranges for your data connector. Which will limit the rows that get passed into your testcases.
for more information about ranges please see the following link:
http://www.ranorex.com/support/user-gui ... html#c3272
Thanks,
Hansel
To pass information to your code modules, you can create a module variable. You can then link the variable to a data connector or to a global parameter.
Since, you would have to define the data set somehow, I would recommend looking into using ranges for your data connector. Which will limit the rows that get passed into your testcases.
for more information about ranges please see the following link:
http://www.ranorex.com/support/user-gui ... html#c3272
Thanks,
Hansel
You do not have the required permissions to view the files attached to this post.
Re: Pass parameters to code module
Thanks Hansel.
I was thinking of creating a base class with TestCaseId variable etc. since almost all test modules/cases need this variable to extract data from excel data connector. Then my code module can inherit this base class if common variables like TestCaseId is needed.
I am using Range but it is with EPPlus. That might have some difference with Ranorex Data Range.
I haven't seen a solid sample by using Ranorex data range. I suggest your company to give sample code for each class if it is possible.
Thanks,
Betty
I was thinking of creating a base class with TestCaseId variable etc. since almost all test modules/cases need this variable to extract data from excel data connector. Then my code module can inherit this base class if common variables like TestCaseId is needed.
I am using Range but it is with EPPlus. That might have some difference with Ranorex Data Range.
I haven't seen a solid sample by using Ranorex data range. I suggest your company to give sample code for each class if it is possible.
Thanks,
Betty