Hi All,
Can anyone help me how to pass parameters globally through command prompt as i am creating a new item(in my application) and pass the item name using command prompt.
Thanks,
Joginder
Pass parameters globally through cmd
Re: Pass parameters globally through cmd
Hi,
You can do it via this parameter:
https://www.ranorex.com/help/latest/ran ... earguments
You can do it via this parameter:
For more details and command line parameters, check this user guide chapter:/param|pa:[global parameter name]=[value]
https://www.ranorex.com/help/latest/ran ... earguments
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 globally through cmd
Hi,
I am not able to understand as i am new to Ranorex.
Below is my userCode method and i want to pass the ("Iten35") through cmd which is name for some field in my app.
Could you please help me in this?
public void Key_sequence_Edit(RepoItemInfo argument1)
{
Report.Log(ReportLevel.Info, "Keyboard", "Key sequence 'Iten35' with focus on 'textInfo'.", argument1);
argument1.FindAdapter<Text>().PressKeys("Iten35");
}
Thanks,
Joginder
I am not able to understand as i am new to Ranorex.
Below is my userCode method and i want to pass the ("Iten35") through cmd which is name for some field in my app.
Could you please help me in this?
public void Key_sequence_Edit(RepoItemInfo argument1)
{
Report.Log(ReportLevel.Info, "Keyboard", "Key sequence 'Iten35' with focus on 'textInfo'.", argument1);
argument1.FindAdapter<Text>().PressKeys("Iten35");
}
Thanks,
Joginder
You do not have the required permissions to view the files attached to this post.
Re: Pass parameters globally through cmd
Hi,
Well, the problem is, that you probably don't know basics and diving in user code without general knowledge of passing data from command line and between modules is not a very good idea Here we go...
At first, you must create a Global Parameter at user Test Suite level (let's call it itemName).
At next, you must create a string variable in code/recording module, in which you are using your method (let's call it itemName as well).
Now you must extend the method with string parameter (you can also call it itemName), like this:
Now you must bind Global Parameter itemName with module variable itemName. If you did everything as described above, global parameter should be successfully passed to your method. Hope this helps?
I would also recommend you to read this blog post, describing sharing data between modules in more details...
https://www.ranorex.com/blog/sharing-da ... o-another/
BTW, is there a reason, why you are converting everything in recording module to user code? I would strongly recommend to stick with recording module actions wherever possible and use code only if absolutely necessary. Especially if you are new to Ranorex, you should stick with recording modules and predefined actions. Using code, without a good reason and very good knowledge of Ranorex, is a sure way to errors and confusion.
Well, the problem is, that you probably don't know basics and diving in user code without general knowledge of passing data from command line and between modules is not a very good idea Here we go...
At first, you must create a Global Parameter at user Test Suite level (let's call it itemName).
At next, you must create a string variable in code/recording module, in which you are using your method (let's call it itemName as well).
Now you must extend the method with string parameter (you can also call it itemName), like this:
Code: Select all
public void Key_sequence_Edit(RepoItemInfo argument1, string itemName)
{
Report.Log(ReportLevel.Info, "Keyboard", "Key sequence '" + itemName + "' with focus on 'textInfo'.", argument1);
argument1.FindAdapter<Text>().PressKeys(itemName);
}
I would also recommend you to read this blog post, describing sharing data between modules in more details...
https://www.ranorex.com/blog/sharing-da ... o-another/
BTW, is there a reason, why you are converting everything in recording module to user code? I would strongly recommend to stick with recording module actions wherever possible and use code only if absolutely necessary. Especially if you are new to Ranorex, you should stick with recording modules and predefined actions. Using code, without a good reason and very good knowledge of Ranorex, is a sure way to errors and confusion.
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