I need to write code module in ranorex which should open the command prompt and run a command inside command prompt.
For example :- To run the file located in the below location through command prompt. Users\Administrator\visualize.py
Can someone help me out.
Ranorex code which should run command through command prompt
Re: Ranorex code which should run command through command prompt
Hi,
You don't need to use code module for this. You should be able to run the py file by using Run action. Eventually, convert the Run action to user code and do whatever you want in code.
You don't need to use code module for this. You should be able to run the py file by using Run action. Eventually, convert the Run action to user code and do whatever you want in 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: Ranorex code which should run command through command prompt
Hi ,
I am new to Ranorex.
Basically the intention here is I have few commands to be executed in the command prompt using Ranorex code.
The py file is just the example which I have given above but there are other huge lines of commands which I'm supposed to run through command prompt.
Below is the actual example which needs to be executed in command prompt using Ranorex code:
C:\Program Files\GEO\QC\GQC.exe" -N C:\Temp\Results\Cluster_Cluster01_2\20211123_121414
Can you help me with below queries:
1) How can we execute command in command prompt using Ranorex code. Could you help with me this.
2) Lastly, by the Run action, do you mean to use the Recording module and then convert it to the user code? If that is the case, I tried the recording module but unable to click on the command prompt option in the start menu using recording. Unable to click the cmd prompt while recording.
I am new to Ranorex.
Basically the intention here is I have few commands to be executed in the command prompt using Ranorex code.
The py file is just the example which I have given above but there are other huge lines of commands which I'm supposed to run through command prompt.
Below is the actual example which needs to be executed in command prompt using Ranorex code:
C:\Program Files\GEO\QC\GQC.exe" -N C:\Temp\Results\Cluster_Cluster01_2\20211123_121414
Can you help me with below queries:
1) How can we execute command in command prompt using Ranorex code. Could you help with me this.
2) Lastly, by the Run action, do you mean to use the Recording module and then convert it to the user code? If that is the case, I tried the recording module but unable to click on the command prompt option in the start menu using recording. Unable to click the cmd prompt while recording.
-
- Certified Professional
- Posts: 455
- Joined: Tue Feb 18, 2014 2:14 pm
- Location: Co Louth, Ireland
- Contact:
Re: Ranorex code which should run command through command prompt
A recording module like this may work for you:
The XPath for the CMD Text Area is:
Code: Select all
/form[@title>'Administrator: C:\Windows']/text[@automationid='Text Area']
Code: Select all
public void MergedUserCodeMethod(RepoItemInfo textInfo)
{
Report.Log(ReportLevel.Info, "Application", "Run application 'cmd.exe' in normal mode.");
Host.Local.RunApplication("cmd.exe", "", "C:\\Windows\\system32", false);
Report.Log(ReportLevel.Info, "Keyboard", "Key sequence 'cd..' with focus on 'textInfo'.", textInfo);
textInfo.FindAdapter<Text>().PressKeys("cd..");
Report.Log(ReportLevel.Info, "Keyboard", "Key sequence '{Return}' with focus on 'textInfo'.", textInfo);
textInfo.FindAdapter<Text>().PressKeys("{Return}");
}
You do not have the required permissions to view the files attached to this post.