Hi community,
I have a recording called "TestCase1" linked to and Excel File by an Excel Data Connector called "TestCase1.xls"
I create three variables in test case : name ,hasPhoneNumber and phoneNumber
There is the xls view :
id | name | hasPhoneNumber | phoneNumber
1| romain | yes | 0606060606
2 | paul | no |
3 | jacques | yes | 0505050505
In my script, i would like to have the same code as this:
for(i=1,i<3,i++)
{
if(hasPhoneNumber = "yes")
{
getPhoneNumber();
}
else if(hasPhoneNumber = "no")
{
text : No phone number for this people!
}
}
Can i use a variable and get his value in a C# script?
Thanks
Use variable in C# script
Re: Use variable in C# script
Hi,
Are you using code module or recording module?
In case of Code Module, you will have to create variable "hasPhoneNumber", via context (right-click) menu >> Insert New Module Variable option. Then simply connect the variable with data connector.
If you are using Recording Module, you can create new variable (in UserCode file) via Variables dialog.
Are you using code module or recording module?
In case of Code Module, you will have to create variable "hasPhoneNumber", via context (right-click) menu >> Insert New Module Variable option. Then simply connect the variable with data connector.
If you are using Recording Module, you can create new variable (in UserCode file) via Variables dialog.
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: Use variable in C# script
Thanks @odklizec : it works!