The VS Integration Example references Ranorex 8. https://www.ranorex.com/help/latest/int ... tegration/
Does the example still work for 8.2? I am using C# and I have followed the steps and the calculator opens but it never clicks the buttons.
I have double checked the .NET Framework and dll's being referenced.
Visual Studio Integration Example
-
- Certified Professional
- Posts: 39
- Joined: Mon Dec 12, 2016 9:24 am
Re: Visual Studio Integration Example
Hi RobertComstock,
You are right, the sample as it is listed on the page is not working properly. Perhaps something went wrong with parsing the code in the html page.
Anyway, I have created a sample in VS as a reference
Hope that helps,
DP
You are right, the sample as it is listed on the page is not working properly. Perhaps something went wrong with parsing the code in the html page.
Anyway, I have created a sample in VS as a reference
Hope that helps,
DP
Please always include the following information to your posts
- Ranorex Version
- OS Version
-
- Posts: 5
- Joined: Fri Jul 13, 2018 2:25 pm
Re: Visual Studio Integration Example
Thanks, DP. I will give it a try.
-
- Posts: 5
- Joined: Fri Jul 13, 2018 2:25 pm
Re: Visual Studio Integration Example
DP,
Tried the solution you sent and it is still not working. Gives an error on WindowsApp calculator = Host.Local.FindSingle<WindowsApp>("winapp[@processname='" + processName + "']"); saying that it can't find that process.
I then built a quick Ranorex Studio test and followed what it was doing. Based on my findings I modified the run method and now I get this exception "No element found for path '/winapp[@packagename='Microsoft.WindowsCalculator']/?/?/button[@automationid='num8Button']'."
private static int run()
{
int error = 0;
//Start calculator and wait for UI to be loaded
try
{
Host.Local.RunApplication("C:\\Windows\\System32\\calc.exe","", "C:\\Windows\\System32", false);
Thread.Sleep(2000);
Button button =
Host.Local.FindSingle<Button>(
"/winapp[@packagename='Microsoft.WindowsCalculator']/?/?/button[@automationid='num8Button']");
button.Click();
}
catch (RanorexException e)
{
Console.WriteLine(e.ToString());
error = -1;
}
return error;
}
Tried the solution you sent and it is still not working. Gives an error on WindowsApp calculator = Host.Local.FindSingle<WindowsApp>("winapp[@processname='" + processName + "']"); saying that it can't find that process.
I then built a quick Ranorex Studio test and followed what it was doing. Based on my findings I modified the run method and now I get this exception "No element found for path '/winapp[@packagename='Microsoft.WindowsCalculator']/?/?/button[@automationid='num8Button']'."
private static int run()
{
int error = 0;
//Start calculator and wait for UI to be loaded
try
{
Host.Local.RunApplication("C:\\Windows\\System32\\calc.exe","", "C:\\Windows\\System32", false);
Thread.Sleep(2000);
Button button =
Host.Local.FindSingle<Button>(
"/winapp[@packagename='Microsoft.WindowsCalculator']/?/?/button[@automationid='num8Button']");
button.Click();
}
catch (RanorexException e)
{
Console.WriteLine(e.ToString());
error = -1;
}
return error;
}
-
- Certified Professional
- Posts: 39
- Joined: Mon Dec 12, 2016 9:24 am
Re: Visual Studio Integration Example
Well, that's odd...
I have built and tested this project on a Win10 machine. Which OS are you running?
What happens when you run the recorded test on your machine? Is it finding the elements or do you also get an error?
Best,
DP
I have built and tested this project on a Win10 machine. Which OS are you running?
What happens when you run the recorded test on your machine? Is it finding the elements or do you also get an error?
Best,
DP
Please always include the following information to your posts
- Ranorex Version
- OS Version
-
- Posts: 5
- Joined: Fri Jul 13, 2018 2:25 pm
Re: Visual Studio Integration Example
Yes, I am on Windows 10. When I run the recorded test it does find the elements.
-
- Posts: 5
- Joined: Fri Jul 13, 2018 2:25 pm
Re: Visual Studio Integration Example
So an interesting development. I have had Ranorex 6.1.1 installed on my machine for some time and Ranorex Spy was working. After upgrading to 8.2 Ranorex Spy would no longer capture elements (tracking or Ctrl + Left Windows). I decided to restore defaults in the settings and then Ranorex Spy started working. I also ran the project you sent me and that started working as well. Is there something in 6.1.1 settings that do not transfer over to 8.2 correctly and would cause this type of behavior?
-
- Posts: 1
- Joined: Fri Oct 05, 2018 1:17 pm
Re: Visual Studio Integration Example
Thanks for the link.RobertComstock wrote: ↑Mon Sep 24, 2018 9:23 pmThe VS Integration Example references Ranorex 8. https://www.ranorex.com/help/latest/int ... tegration/
Does the example still work for 8.2? I am using C# and I have followed the steps and the calculator opens but it never clicks the buttons.
I have double checked the .NET Framework and dll's being referenced.