cancel
Showing results for 
Search instead for 
Did you mean: 

WPF app with AutomationId.

SOLVED
Highlighted
New Contributor

WPF app with AutomationId.

Hi, 

Im in need of some help, and i hope you wonderfull people can help me out here.

Im trying to use AutomationId in my test scripts, but can't get it working at all. Unless I still use the full path to the objects.

I've been looking through the documentation and the board, but what I have found, did not help me any further - So i hope one of you, can help get me started 🙂

Im writing the scripts in jscripting .

I have an application where a search button has these properties:
Sys.Process("Blabla1").UIAObject("Blabla2").UIAObject("MainControl").UIAObject("DashBoardView").UIAObject("MainTabControl").UIAObject("Dashboard").UIAObject("CompSearch").UIAObject("Search");
with automationId = SearchButton

If i want to click that button, using automationID, how do I write my script?


I really hope, someone can help me 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Valued Contributor

Re: WPF app with AutomationId.

it would be something like below

 

buttonSearch = Sys.Process("Blabla1").UIAObject("Blabla2").FindChild('automationId', 'SearchButton', 20, true);
buttonSearch.Exists? buttonSearch.ClickButton(): Log.Error('Can not find Search Button');

 

I have assumed 

1) Object blabla2 is available at given time

2) automationId is a property of your button

3) ClickButton() method is avilable in button. if not you hv to identify similer method

4) var buttonSearch    defined in function

 

View solution in original post

1 REPLY 1
Highlighted
Valued Contributor

Re: WPF app with AutomationId.

it would be something like below

 

buttonSearch = Sys.Process("Blabla1").UIAObject("Blabla2").FindChild('automationId', 'SearchButton', 20, true);
buttonSearch.Exists? buttonSearch.ClickButton(): Log.Error('Can not find Search Button');

 

I have assumed 

1) Object blabla2 is available at given time

2) automationId is a property of your button

3) ClickButton() method is avilable in button. if not you hv to identify similer method

4) var buttonSearch    defined in function

 

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors