Hello,
I have the following problem...
I want to add different parameter as variable to my base URL which is a Global Parameter. The Goal is to add parameters to the url before starting the Open Browser action.
I tried something like this as User Code:
Public void (string args1)
{
URL=URL+VarURLParameter;
}
It works for the first test case with the global parameter URL...but within the second testcase it adds "VarURLParameter" again, that the URL looks more like this:
URL=URL+VarURLParameter+VarURLParameter
..for the third Test Case it opens the URL like this
URL=URL+VarURLParameter+VarURLParameter+VarURLParameter
...so on for 4th, 5th and 6th testcase
Maybe someone has a Solution or can help me? Can i reset the global parameter to the input value after the Open Browser action for TC1?
Best regards,
Chriszzoo
Adding Variable to global parameter
Adding Variable to global parameter
Last edited by chriszzoo on Fri Dec 08, 2017 8:46 am, edited 1 time in total.
Re: Adding Variable to global parameter
Hi,
Could please post a sample solution showing the problem? I guess you need to use the global parameter somewhat differently. But it's hard to say without seeing exact implementation of the global parameter and usage of custom code. So please, create a small sample solution and share it with us. Thanks.
Could please post a sample solution showing the problem? I guess you need to use the global parameter somewhat differently. But it's hard to say without seeing exact implementation of the global parameter and usage of custom code. So please, create a small sample solution and share it with us. Thanks.
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: Adding Variable to global parameter
Hi,
thanks for your answer.
I created a little test solution:
Test Suite Overview:
Data Binding TC1:
Recording Module:
User Code of recording module:
see next reply for more screenshots...
thanks for your answer.
I created a little test solution:
Test Suite Overview:
Data Binding TC1:
Recording Module:
User Code of recording module:
Code: Select all
namespace TestURL
{
public partial class OpenURL
{
/// <summary>
/// This method gets called right after the recording has been started.
/// It can be used to execute recording specific initialization code.
/// </summary>
private void Init()
{
// Your recording specific initialization code goes here.
}
public void AddVariableURL()
{
URL=URL+VarURLParameter;
}
}
}
You do not have the required permissions to view the files attached to this post.
Re: Adding Variable to global parameter
When i open TestURL.exe through command line with parameter URL:
GIT Bash:
Test Results:
You see my problem?
Best regards,
Chriszzoo
GIT Bash:
Test Results:
You see my problem?
Best regards,
Chriszzoo
You do not have the required permissions to view the files attached to this post.
Re: Adding Variable to global parameter
Data Connector TC1:
You do not have the required permissions to view the files attached to this post.
Re: Adding Variable to global parameter
Hi,
I see. I think the easiest solution is to not replace the URL variable with merged strings, like you do it in your code. You should use another variable for merged URL and VarURLParameter strings.
Simply create a new recording module variable in OpenURL module, e.g. called 'mergedURL'. Then use this new variable in OpenBrowser and Log actions. And in custom code use this:
Hope this helps?
I see. I think the easiest solution is to not replace the URL variable with merged strings, like you do it in your code. You should use another variable for merged URL and VarURLParameter strings.
Simply create a new recording module variable in OpenURL module, e.g. called 'mergedURL'. Then use this new variable in OpenBrowser and Log actions. And in custom code use this:
Code: Select all
mergedURL=URL+VarURLParameter;
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: Adding Variable to global parameter
odklizec wrote:Hi,
I see. I think the easiest solution is to not replace the URL variable with merged strings, like you do it in your code. You should use another variable for merged URL and VarURLParameter strings.
Simply create a new recording module variable in OpenURL module, e.g. called 'mergedURL'. Then use this new variable in OpenBrowser and Log actions. And in custom code use this:Hope this helps?Code: Select all
mergedURL=URL+VarURLParameter;
Thank you very much! Works now.. as simple as it is