Hello together,
is there a possibility to let Ranorex decide if an Action should be executed depending on the value of the connected Test Data Excel Sheet? I want to execute an Action only if there is a value for it in the excel file if not Ranorex should skip it.
Best regards
Michael
Execute Action depending on Data Excel Value
Re: Execute Action depending on Data Excel Value
Hi,
At the moment, the only way how to perform or skip an action based on a condition is to convert the action (or actions) to user code and create the condition in User Code.
At the moment, the only way how to perform or skip an action based on a condition is to convert the action (or actions) to user code and create the condition in User Code.
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: Execute Action depending on Data Excel Value
Hi,
that's the answer I expected...
can you show me some sample code how I can achieve this in user code?
Many thanks!
that's the answer I expected...
can you show me some sample code how I can achieve this in user code?
Many thanks!
Re: Execute Action depending on Data Excel Value
Hi,
Basically, you need to create a new module variable (e.g. varName1) and then you need to connect that variable with proper data connector.
Then all you need to do is to enclose your converted recording action(s) in If...Then condition, like this:Hope this helps?
Basically, you need to create a new module variable (e.g. varName1) and then you need to connect that variable with proper data connector.
Then all you need to do is to enclose your converted recording action(s) in If...Then condition, like this:
Code: Select all
if (varName1 == "something")
{
your_converted_action_here;
}
else if (varName1 == "somethingelse")
{
your_other_converted_action_here;
}
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: Execute Action depending on Data Excel Value
Thank you odklizec!
It's working.
It's working.
Re: Execute Action depending on Data Excel Value
you are welcome! 

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