cancel
Showing results for 
Search instead for 
Did you mean: 

Menu item is recognized as the whole panel and therefore I have difficulties clicking the correct po

SOLVED
OV
Contributor

Menu item is recognized as the whole panel and therefore I have difficulties clicking the correct po

Hi,

We develop an app that has menu items (File,Home,Insert,Settings,View,Help) when using the object spy to identify all menu items except from the File one it'll identify them all properly marking the area where the menu item name is but, when trying to do the same with the File menu TestComplete will mark the whole panel in red and not only the area where the text (File) is, that is a problem because if i want to saelect this menu item usinf the Click() method then it'll click somewhere on the panel and not on the text, i tried using coordinates (I don't like it as it's not as reliable) but it failed when running the script on a remote machine. Is there a way to dril down this DevExp control and ask TestComplete to click on the File tab exactly and not using coordinates?

When recording a click on the control that's what Testcomplete generates - Aliases.Editor.Editor_Root_Window.MainWindowRibbonControl.Click(30, 48);

When selecting for example the Insert menu item that what I see in the code - Aliases.Editor.Editor_Root_Window.MainWindowRibbonControl.RibbonMenuControls.RibbonControlInsert.Click(35, 16);

See attached .

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
OV
Contributor

Re: Menu item is recognized as the whole panel and therefore I have difficulties clicking the correc

Hi @TanyaGorbunova 

 

Yes it was resolved by using this way:

  1. Open the Object Spy and try recognizing the File tab. You will get some other parent object.
  2. Take the value of the property ClrFullClassName of this object.
  3. Navigate to Tools -> Current Project Properties -> Open Applications -> WPF.
  4. Add a new row to the Composite Objects list and paste the ClrFullClassName value there. Enable this new row.
  5. Try recognizing the File tab again.
  6. Repeat the above steps until you get to the File tab.

Thanks,

 

Ofer

View solution in original post

17 REPLIES 17
Community Hero

Re: Menu item is recognized as the whole panel and therefore I have difficulties clicking the correc

Have you tried using the built-in ClickItem method for ribbon menus?

 

https://support.smartbear.com/testcomplete/docs/reference/test-objects/controls/desktop/wpf/ribbon/i...


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
OV
Contributor

Re: Menu item is recognized as the whole panel and therefore I have difficulties clicking the correc

Hi Carson,

 

Thanks for the reply.

I did what it says in the link you sent but, can't see any change with the object recognition.it just recognize it as a whole panel and won't "drill" down to the File tab.

The prblem wasn't to have TC identify the object but having TC being able to click the FILE menu item as shown in the screenshots, at the moment if I won't mention any coordinates TC clicks at the center of that ribbon and if I do mention coordinates it will click the correct place on my dev machine but won't click the same place (although very close) when running the same script on a remote machine.

 

Any other suggestions?

 

Thanks,

 

Ofer

Community Hero

Re: Menu item is recognized as the whole panel and therefore I have difficulties clicking the correc

Can you provide code example of what you tried with the ClickItem option?


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
OV
Contributor

Re: Menu item is recognized as the whole panel and therefore I have difficulties clicking the correc

Sure, I had code example in my original post. there you go:

Aliases.Editor.Editor_Root_Window.MainWindowRibbonControl.RibbonMenuControls.RibbonControlInsert.Click(35, 16);

 

Is that what you meant?

 

Thanks,

 

Ofer

Community Hero

Re: Menu item is recognized as the whole panel and therefore I have difficulties clicking the correc

I would like to see how you tried to implement the ClickItem method. Using that you shouldn't have to map the specific buttons, just their parent.


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
OV
Contributor

Re: Menu item is recognized as the whole panel and therefore I have difficulties clicking the correc

Do you mean something like this?

Aliases.Editor.Editor_Root_Window.MainWindowRibbonControl.ClickItem(Editor.Editor_Root_Window.MainWindoRibbonControl.ClrFullClassName)

 

Thanks,

 

Ofer

Community Hero

Re: Menu item is recognized as the whole panel and therefore I have difficulties clicking the correc

Ribbons have their own ability to click items within it without having to map the items.

 

https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/ribbon/clickitem-acti...

 

Try Aliases.Editor.Editor_Root_Window.MainWindowRibbonControl.ClickItem(0)

 


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
OV
Contributor

Re: Menu item is recognized as the whole panel and therefore I have difficulties clicking the correc

Tried,it just moves to the next line in the code, does nothing, not even going to the app

I've attached 2 screenshots of how TC identifies the menu items, apparently the File menu is the parent of the rest of the othermenu tabs. so in this case not sure index will help isn't it?

see attached.

 

Thanks,

 

Ofer

Community Hero

Re: Menu item is recognized as the whole panel and therefore I have difficulties clicking the correc

Apologies, I meant to say Aliases.Editor.Editor_Root_Window.MainWindowRibbonControl.RibbonMenuControls.ClickItem(0).

 

If that does not work can you provide the full code you are executing, screenshot of the log, and the object browser properties and methods for the object RibbonMenuControls with advanced view options turned on.


Thanks,
Carson

Click the Accept as Solution button if my answer has helped