Ask a Question

Need to navigate to an MSAA object which is not available on the view and Click it

SOLVED
srijansameer11
New Contributor

Need to navigate to an MSAA object which is not available on the view and Click it

Hey,

I am using the following code snippet to navigate to an object that is down the scrollable window and trying to click it, but it is not accepting the method ScrollIntoView()

Can anyone suggest to me how can I achieve the same?

 

**menuItem2 id being dynamically passed from the function call.

 

var obj = Sys.Process("abc").WinFormsObject("ApplicationForm").WinFormsObject("toolStripContainer1").WinFormsObject("ToolStripContentPanel"""1).WinFormsObject("splitContainer1").WinFormsObject("SplitterPanel"""1).WinFormsObject("panelNavigationArea").WinFormsObject("navigationPanel").WinFormsObject("panelNavigationContainer").WinFormsObject("NavigationPanel").WinFormsObject("applicationTreeView").MSAAObject("outline").MSAAObject("table_Data_Panel").Find("Value", menuItem2 ,"999");

 

obj.ScrollIntoView(true);

 

obj.Click();

 

 

 

Thanks

Srijan Sameer

1 ACCEPTED SOLUTION

Accepted Solutions
mattb
Staff

Re: Need to navigate to an MSAA object which is not available on the view and Click it

Hi,
If scrolling is not working consistently I would recommend calling the keys() method with a [Down] on the tested object. Ex: testobj.keys([Down][Down])...

I find this more robust than scrolling, and you can just call as many [Down] Keys until the object is into view. 

I prefer this because the down keys seem to be a bit more application specific, compared to scrolling which can be a bit more dynamically generated. 

You can call the down object either on the parent object, or on the scroll itself. 

Full list of keys parameters: https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/common-for-sys-deskto... 

View solution in original post

1 REPLY 1
mattb
Staff

Re: Need to navigate to an MSAA object which is not available on the view and Click it

Hi,
If scrolling is not working consistently I would recommend calling the keys() method with a [Down] on the tested object. Ex: testobj.keys([Down][Down])...

I find this more robust than scrolling, and you can just call as many [Down] Keys until the object is into view. 

I prefer this because the down keys seem to be a bit more application specific, compared to scrolling which can be a bit more dynamically generated. 

You can call the down object either on the parent object, or on the scroll itself. 

Full list of keys parameters: https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/common-for-sys-deskto... 

View solution in original post

cancel
Showing results for 
Search instead for 
Did you mean: