[jawsscripts] Re: UIA - creating FSUIAConditions

  • From: Soronel Haetir <soronel.haetir@xxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Thu, 9 Jul 2015 07:18:52 -0800

The one downside is that it is a bit slow, even finding elements that
are only a few levels down the tree. (Finding an ancestor is actually
pretty fast).

On 7/9/15, Roth <travis@xxxxxxxxxxxxxx> wrote:

That sounds really useful.
I don't know what the licensing is but if permissible I'd suggest putting it
on Github if you don't get a response from the maintainers.


-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel Haetir
Sent: Thursday, July 09, 2015 1:04 AM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: UIA - creating FSUIAConditions

Well, I've succeeded in implementing a simple property based find (meaning
base properties only, not pattern property values) and no combinations. I
even have parent and ancestor scope working even though FindFirst does not
work with those values (I simply walk up the element tree and then try
TreeScope.Element scope at each level until I get a match or the specified
scope is exceeded).

Advanced find is going to take quite a lot more work.

I hope that the code maintainers would actually be interested.


On 7/7/15, Soronel Haetir <soronel.haetir@xxxxxxxxx> wrote:
The tree view is not necessarily populated.

By that I mean until a tree view node is expanded you don't know what
children it has. Using the existing UIA find capability then walking
up to find the path (of automation elements) then back down (the path
of tree view nodes) seems like it would be way less prone to mistake
than re-implementing the UIA property match logic.

Especially because I am looking to implement both simple find (where a
single property is matched) as well as combined conditions using
('and', 'or and 'not').

Expanding tree nodes on the way down and selecting the correct item
for that level should not be terribly difficult.

On 7/7/15, Roth <travis@xxxxxxxxxxxxxx> wrote:
What about just searching the tree nodes themselves? This would only
work for the name search but would be better than nothing.

-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel Haetir
Sent: Tuesday, July 07, 2015 2:03 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: UIA - creating FSUIAConditions

Okay, I do see why adding a find capability is somewhat complicated.
Performing a find from a particular element is easy enough, but then
finding the tree node that corresponds to that element is not.

On 7/7/15, Soronel Haetir <soronel.haetir@xxxxxxxxx> wrote:
The find idea is actually pretty good, I am taking a look at the
visual UIA verify source to see how hard that would be to add.

On 7/7/15, Travis Roth <travis@xxxxxxxxxxxxxx> wrote:
I find uses for both ways.
But can either way automatically record the path? And I also wish
Visual UIA Verify had a search feature as it is very tedious to
hunt for an element when I already do know its name.


-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel
Haetir
Sent: Tuesday, July 7, 2015 10:20 AM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: UIA - creating FSUIAConditions

But I still don't find advanced navigation as useful as having a
program that show a tree of all the elements that are available.
And then a list of property values.

With touch navigation (even in advanced mode) I find myself doing
far more hunting around trying to find a path from one object to
whatever it is I am trying to reach. With a tree view instead of
touch navigation I don't for instance waste time trying to go down
into a pane that doesn't actually have any children, with a tree
that information is simply part of the navigation experience.

On 7/7/15, Bissett, Tom <tom.bissett@xxxxxxx> wrote:
It is in the help under using the touch cursor Tom Bisset
-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Roth
Sent: Tuesday, July 07, 2015 8:42 AM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: UIA - creating FSUIAConditions I know
about touch navigation, however I have not used Advanced. Is that
in the help system somewhere?
What it seems we need then with touch navigation, is when find an
object we're interested in for scripting, a utility to record how
to programmatically locate it. Wouldn't solve everything but would
speed up some things.



-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Jim
Snowbarger
Sent: Monday, July 06, 2015 9:03 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: UIA - creating FSUIAConditions

Right. This point was raised to me when I suggested to FS that
they have all the tools to make object navigation, which is what
the NVDA enthusiasts like to brag about, a regular part of jaws.
They already have it! It was just called something else.
I bet most people don't understand that. It escaped me.




-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Jim Bauer
Sent: Monday, July 06, 2015 5:54 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: UIA - creating FSUIAConditions

I'm a UIA newbie and I like using the JAWS touch cursor for
discovering basics. With advanced mode enabled, you're exploring a
raw view tree walker.
You can press alt+enter on an element to get a user buffer of
properties.
This doesn't let you test conditions or patterns against your
navigable tree though.

Credit to Doug Lee (for bringing to light the fact that you don't
need a touch device to use the touch cursor, which is what I just
naturally assumed). :-)

On 7/6/2015 4:59 PM, Travis Roth wrote:
Ok, thanks.
I downloaded the latest 8.1 SDK and found it there. It is not the
same program as I already had, which was something older I think.


-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel
Haetir
Sent: Monday, July 6, 2015 4:11 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: UIA - creating FSUIAConditions

What I use is found at C:\Program Files (x86)\Windows
Kits\8.1\bin\x64\UIAVerify\VisualUIAVerifyNative.exe

When I start the program focus is in a tree view that is rooted
at the desktop and can be expanded to show all of the UIA
elements available.
If I hit tab focus changes to the property view window. Tabbing
twice from there switches to the test selection view. Tab again
from there takes me to the test run result pane.

Getting out of the test result pane is always trouble, the only
reliable way I have found for doing that is to use the jaws
cursor and click on one of the other windows, usually the element
tree.

On 7/6/15, Travis Roth <travis@xxxxxxxxxxxxxx> wrote:
Hmm, I wonder if there is more than one app masquerading with
the same name as I got this one from the Windows SDK but it does
not quite match what you have.


-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel
Haetir
Sent: Monday, July 6, 2015 3:11 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: UIA - creating FSUIAConditions

I find the ClassName property listed under the Identification
group along with AutomationId, ControlType etc. You do not need
to run a test in order to get that info. All I do is select the
element I want the properties for from the tree hit tab then go
up and down the list.

There are groups for General, Identification, Patterns, State
and Visibility. Perhaps the group is collapsed and you didn't
notice that?

On 7/6/15, Travis Roth <travis@xxxxxxxxxxxxxx> wrote:
Hi,
Soronel you mentioned using Visual UIA Verify to find the
UIA_ClassNamePropertyId. Where is this shown in the application?
When I run a verification and get to the UIA Tree tab I do not
find this?
I find things such as name, value, control type? Must I select
a specific test?

I am attempting a test script in order to get the idea of UIA.
For this I am trying to find the "Message Bars" notification
area in Outlook 2013.
Since I don't know the UIA_ClassNamePropertyId but do have the
name "Message Bars" I tried creating a StringPropertyCondition
using UIA_NamePropertyId but this is failing.
Any ideas?
Sample code:
var object UIA = CreateObjectEx ("FreedomSci.UIA", false,
"UIAScriptAPI.x.manifest" ); var object appObject =
UIA.GetElementFromHandle(GetAppMainWindow
(GetCurrentWindow ()));
var object messageCondition =
UIA.CreateStringPropertyCondition(UIA_NamePropertyId, "Message
Bars"); assert(messageCondition, "Failed to create message
condition"); //this passes var object element =
appObject.FindFirst(TreeScope_Children,
messageCondition);
assert(element, "Failed to find message condition") ;//this
fails var object treewalker =
UIA.CreateTreeWalker(UIA.RawViewWalker);
assert(treewalker, "Failed to create tree walker") ; //this
fails




-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Soronel
Haetir
Sent: Thursday, May 7, 2015 1:39 AM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: UIA - creating FSUIACondtions

I did rewrite that using an And condition )to get rid of the
loop), from the FindAll line it is now:

var object child = element.FindFirst(TreeScope_Children,
uia.CreateAndCondition(tabItemCondition,
uia.CreateNotCondition(uia.CreateStringPropertyCondition(UIA_Na
me
Pr
o
p
e
rtyID,
"ContentManagerView"))))
Assert(child, "Failed to obtain children of DocumentGroup")

var object selection = child.GetSelectionItemPattern()
Assert(selection, "Failed to get selection item pattern")

selection.Select()



On 5/6/15, Soronel Haetir <soronel.haetir@xxxxxxxxx> wrote:
I got the value UIA_ClassNamePropertyId out of uia.jsh, I used
visual uia verify (from
https://uiautomationverify.codeplex.com/releases/view/112069)
to get the value "TabItem".

I do seem to recall a problem with downloading visual uia
verify now, but I also seem to recall it is also included as
part of the platform sdk from Microsoft. I suppose it would
also be possible to use the jaws script utility mode to get
that info but not nearly as easy.

An example use is:

var object appObject =
uia.GetElementFromHandle(GetAppMainWindow(GetCurrentWindow()))
, object element = appObject.FindFirst(TreeScope_Children,
uia.CreateStringPropertyCondition(UIA_ClassNamePropertyID,
"DockRoot"))
Assert(element, "Failed to find DockRoot element")

element = element.FindFirst(TreeScope_Children,
uia.CreateStringPropertyCondition(UIA_ClassNamePropertyID,
"DocumentGroup"))
Assert(element, "Failed to find DocumentGroup element")

var object children = element.FindAll(TreeScope_Children,
tabItemCondition) Assert(children, "Failed to obtain children
of
DocumentGroup")

var int position = 0,
object item
While children.Count > position && not item item =
children(position) position = position + 1 If
"ContentManagerView"
== item.Name Then item = Null() EndIf EndWhile

If not item
SayString("Failed to find a content tab item") Return EndIf

var object selection = item.GetSelectionItemPattern()
Assert(selection, "Failed to get selection item pattern")

selection.Select()


Assert is a debugging function I use to test conditions that
should always be true:
void Function Assert(variant value, string message) If not
value Then
SayString(message)
EndIf
EndFunction


It would likely be possible to get rid of the while loop by
using an And condition (combining the test for being a tab
item and not the content manager tab but I didn't bother.



On 5/6/15, John Robichaud <John_Robichaud@xxxxxxxxxxx> wrote:
Soronel,
Can you show an example using FindAll and/or FindFirst?
Where did you get the parameters for
CreateStringPropertyCondition?
John Robichaud

-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of
Soronel Haetir
Sent: Wednesday, May 06, 2015 6:12 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: UIA - creating FSUIACondtions

I haven't used conditions with CreateTreeWalker (except for
the built-in
TrueCondition) but I do use then with FindAll and FindFirst

Here's an example of creating a condition object:

var object tabItemCondition =
uia.CreateStringPropertyCondition(UIA_ClassNamePropertyId,
"TabItem")


On 5/6/15, John Robichaud <John_Robichaud@xxxxxxxxxxx> wrote:
Can anyone give an example of first creating a
FSUIACondition and then using it with CreateTreeWalker() to
traverse an UIA tree?
This could very useful but I don't really understand the
concept of creating the condition.
John Robichaud





__________?

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________?

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts

__________

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx



--
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




__________

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts

__________

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx



--
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx



--
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts




--
Soronel Haetir
soronel.haetir@xxxxxxxxx
__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts

Other related posts: