Live Tracking elements that disappear when lose focus

Ranorex Studio, Spy, Recorder, and Driver.
uhmdown
Posts: 54
Joined: Mon Apr 03, 2017 12:00 pm

Re: Live Tracking elements that disappear when lose focus

Post by uhmdown » Fri May 19, 2017 3:27 pm

I had another followup Session with Ranorex on this that produced two awesome learning points that I thought I'd share.

First:
It turns out that tweaking the Wpf preset or creating a new one was too complex and would mess up alot of other xpaths. So Ranorex abandoned that idea.

An alternative solution was provided though; one that I actually really like: it's possible to change the Wpf mode programmatically during runtime.

It goes like this:

Code: Select all

Ranorex.Plugin.WpfConfiguration.WpfApplicationTrees = Ranorex.Plugin.WpfTreeSelection.WpfImprovedOnly;

Ranorex.Plugin.WpfConfiguration.WpfApplicationTrees = Ranorex.Plugin.WpfTreeSelection.WpfOnly;
Using these, you can have a hybrid repository where some Appfolders and their descendants use Xpaths generated with a different plugin (if it's the only option, or more convenient) than the rest of the repository. Then, just temporarily change the Wpf mode while accessing these repository items.
(But don't mix modes within an AppFolder as that will probably get too messy).

Since the tooltips I want to access work fine in WpfImproved, I switch to that before I access the tooltip variable, and restore the WpfOnly mode afterwards.


Second:
There is a shortcut key for starting Snapshot generation in Ranorex Spy: its the Scroll Lock key.
it will generate a snapshot for the previously selected item in the overview pane in Ranorex Spy.
it's just a faster alternative to setting up a recording module that generates a snapshot.

So, in my case:
1. Make the tooltip visible and then press LeftCtrl + Windows key: that forces the tooltip item to appear in the RanorexSpy overview.
2. Select the tooltip in Ranorex Spy.
3. Make the tooltip appear again, and then press the ScrollLock key.
Result: BAM, you have a snapshot of the tooltip.