Forum Discussion
In my case I am interested in the VerticallyScrollable property of a UIAutomation object for a WPF application. I tried modifying the sample provided in Tanya's post after proving I could successfully obtain the AutomationID. However, I am sure I am making an obvious mistake:
(Using JavaScript...)
var SV, AutomationIdProperty, AutomationID;
SV = Sys.Process("MyApp");
AutomationIdProperty = SV.AppDomain("MyApp.exe").dotNET.System_Windows_Automation.AutomationProperties.AutomationIdProperty;
AutomationID = MyWPFObject.GetValue(AutomationIdProperty);
Log.Message(AutomationID); //Success!!
AutomationIdProperty = SV.AppDomain("Zetta.exe").dotNET.System_Windows_Automation.ScrollPattern.VerticallyScrollableProperty;
AutomationID = MyWPFObject.GetValue(AutomationIdProperty); //Fails here with error: "The parameter is incorrect"
Log.Message(AutomationID);
First of all... this is a 5 year old post... so, who knows what may have changed technology wise since then. :)
That said... In your code, what is returned as the AutomationIDProperty for VerticallyScrollableProperty? The code that Tanya posted is intended to bring back the automationID which, IIRC, is an integer value or string (not sure which) to be used for identifying the object. VerticallyScrollableProperty is a different thing entirely and may not return as a type that can be used in "GetValue". Double check what is returned and see if a conversion needs to be done before you can use it in "GetValue".
Related Content
- 9 years agodenhenp
- 6 years agoristokochevski
- 11 months agosanket2799
Recent Discussions
- 2 days agovladd1