Hi, I’m wondering if there’s someone who could offer me some help on a small problem which I’ve been having.
My companies’ software uses an auto-complete feature on a lot of the fields where an option must be selected from the list to continue/populate information, example of which is below:
Now, depending on where I click on this drop down list the element added is either something like this:
And named ZyexStrongTag
Or something like this:
Named UiActiveMenuItemLink (where i've just clicked on the menu but not the company name)
The former will work fine enough for the company it’s intended for but I’m trying to write a more generic script that I can data bind to. However, I can’t data bind to a click action nor seem to find a way to re-target the element/action to just select any option that pops up on the auto-complete list as the element always seems bound to the text entered.
So i suppose what i'm asking is:
Is there a way to data bind to click actions? or;
How do i better target/identify my elements for these auto-complete drop-downs to be less text content specific?
I hope that makes sense and would really appreciate some guidance.
Thanks,
Adam
System.Reflection.TargetInvocationException occurred HResult=-2146232828 Message=Exception has been thrown by the target of an invocation. Source=mscorlib StackTrace: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) InnerException: System.Runtime.InteropServices.COMException HResult=-2147220995 Message=Object is not connected to server (Exception from HRESULT: 0x800401FD (CO_E_OBJNOTCONNECTED)) Source=mscorlib ErrorCode=-2147220995 StackTrace: at Accessibility.IAccessible.get_accName(Object varChild) at MS.Internal.AutomationProxies.Accessible.GetName(IAccessible acc, Int32 idChild) at MS.Internal.AutomationProxies.Accessible.Compare(IAccessible acc, Int32 idChild) at MS.Internal.AutomationProxies.Accessible.SetAccessibleChildrenIndexAndGetChildren(IAccessible parent) at MS.Internal.AutomationProxies.MsaaNativeProvider.System.Windows.Automation.Provider.IRawElementProviderFragment.GetRuntimeId() at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode) at MS.Internal.Automation.UiaCoreApi.CheckError(Int32 hr) at MS.Internal.Automation.UiaCoreApi.UiaNavigate(SafeNodeHandle hnode, NavigateDirection direction, Condition condition, UiaCacheRequest request) at System.Windows.Automation.AutomationElement.Navigate(NavigateDirection direction, Condition condition, CacheRequest request) at System.Windows.Automation.TreeWalker.GetFirstChild(AutomationElement element) at ArtOfTest.Common.Extensions.AutomationExtensions.GetControlChildrenCount(AutomationElement element) at ArtOfTest.WebAii.Win32.Dialogs.FirefoxAlertDialogMatch..ctor(AutomationElement dialog) at ArtOfTest.WebAii.Win32.Dialogs.AlertDialog.MatchesUIAutomationElement(AutomationElement element) at ArtOfTest.WebAii.Win32.Dialogs.DialogMonitor.<>c__DisplayClass8.<FindUIAEDialog>b__5(IDialogUIAutomation d) at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate) at ArtOfTest.WebAii.Win32.Dialogs.DialogMonitor.FindUIAEDialog(AutomationElement element) at ArtOfTest.WebAii.Win32.Dialogs.DialogMonitor.HandleElement(AutomationElement element) at ArtOfTest.WebAii.Win32.Dialogs.DialogMonitor.AutomationEvent_OnStructureChanged(Object sender, StructureChangedEventArgs e) InnerException: