What to do: AutomationID changes everytime the app is run

Jul 20, 2011 at 7:32 PM

I have a 3rd party application that is a JAVA SWT application.  I'm trying to do a simple logon.  There are several edit controls on the window. 

When I execute the following code below, it fails because the Automation ID changes every time the appliation runs.  Is there anything i can do to complete this script?

 

// get the pw logon edit box

White.Core.UIItems.TextBox textBox = (White.Core.UIItems.TextBox)window.Get(SearchCriteria.ByAutomationId("6227092"));

 

 

textBox.Focus();

Jul 21, 2011 at 7:41 AM

Hi

1. best way => the developer should change this, random AutomationID's does not make sense. (Bu you need access to the developer)

2. if there is only one edit field => use SearchCriteria.ByControlType

3. if there more edit fields => find Control by index and ControlType

in all cases try to get the direct parent of the edit field.

 

Throndorin