[jawsscripts] Re: UIA - creating FSUIAConditions

  • From: Soronel Haetir <soronel.haetir@xxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Mon, 6 Jul 2015 13:10:42 -0800

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_NamePrope
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

Other related posts: