Rx Object Path depends on how app was started?

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Rx Object Path depends on how app was started?

Post by JohnWashburn » Mon Apr 22, 2013 11:28 pm

I have a small whetstone application to verify testing of winform controls and widgets work / don't work within an application which is much simpler than our commercial winform app that represents man-decades of software development.

if the testing code does not work with winform control within the the whetstone app, that that same testing code will certainly fail when interacting with the same type of winform controls within the commercial app. The name of the simple app is Winform Whetstone.

If the whetstone app is started within a C# program with the Thread.Start(ProcessInfo) method then the Spy states the Rx path of the Close button of the main form is:

/form[@title='Winform Whetstone']/titlebar/button[@accessiblename='Close']

If I start the whetstone application from the operating system by double clicking on the directory entry then the Spy reports the Rx path of the close button of the main form is:

/form[@controlname='Cognex.TA.WinformWhetstone']/titlebar/button[@accessiblename='Close']

Why is this? The EXE has not changed in any way, yet Spy cannot find the ControlName property and uses the Title property instead?

I would prefer the second Rx path be used since the control name and accessiblename properties are language invariant and don't depend on the English text: "Winform Whetstone", for object identification.

I get a similar behavior for the Minimize button as well.

This erratic identification is problematic as I am using the existence of the Close button of the main form as a proxy to question: "Has the application started successfully." Button exist then yes, the application has started.

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Rx Object Path depends on how app was started?

Post by Ciege » Mon Apr 22, 2013 11:46 pm

It *COULD* be that when you start the AUT from the EXE you are starting it as an Administrator (the way Ranorex requires the AUT to be run to fully recognize elements and such), and when you run the AUT from Thread.Start you are running in another context that Ranorex cannot guarantee what it is able to see or not see within your AUT.

Try setting your Process to RunAs as Admin and re-verify what Ranorex can see and how it sees it...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Rx Object Path depends on how app was started?

Post by Support Team » Tue Apr 23, 2013 9:34 am

JohnWashburn wrote:Thread.Start(ProcessInfo)
You meant Process.Start(ProcessInfo), right?

As ciege already suspected, it could be a security or a x86/x64 issue. Are you getting any technology limitation warnings when spying the application after being started from your testing code?

Also make sure that all prerequisites are installed. You can easily ensure that by starting the Ranorex setup file "Ranorex-X.X.X.X.exe" again (do not use the MSI from the unzipped package; running the MSI will not install any prerequisites).

Regards,
Alex
Ranorex Team
.
Image

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Rx Object Path depends on how app was started?

Post by JohnWashburn » Tue Apr 23, 2013 2:30 pm

Yes, Process.StartInfo followed by process.Start. The exact code fragment is:

Code: Select all

var process = new Process();
process.StartInfo.FileName = exe;
process.StartInfo.Arguments = args;
process.StartInfo.WorkingDirectory = workingDir;
process.StartInfo.UseShellExecute = true;

// receive notification of process exit
process.EnableRaisingEvents = true;
process.Exited += StartedProcessHasExited;

if (process.Start())
{
}

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Rx Object Path depends on how app was started?

Post by JohnWashburn » Tue Apr 23, 2013 2:34 pm

I will check the privilege levels. I do get a warning that the Ranorex plug-in is incompatible with Firefox, but since I don't have a web app, I have ignored it. But, that warning seems to come up in all contexts.

But I will pay more attention to security level, (admin or regular) as i am working on this today.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Rx Object Path depends on how app was started?

Post by Support Team » Thu Apr 25, 2013 9:07 am

JohnWashburn wrote: I do get a warning that the Ranorex plug-in is incompatible with Firefox, but since I don't have a web app, I have ignored it. But, that warning seems to come up in all contexts.
You can get a warning if you did not install the Firefox plugin and have Firefox open while searching for elements. As soon as Ranorex hits a Firefox window instance, it shows the technology limitation since without the plugin installed it cannot know if elements within the Firefox window could match the RanoreXPath.
JohnWashburn wrote:But I will pay more attention to security level, (admin or regular) as i am working on this today
Would be great if you could post your findings :)

Regards,
Alex
Ranorex Team
.
Image