German strings

Dec 14, 2009 at 8:47 AM

Hi

 

There is a problem with special german characters like 'ü', 'ä', and so on

 

if they are used in contextMenus or Popupmenus and so on

 

the menu item will not be found

 

if I use Automation element I find the items with writting the word without this character

 

for example

 

need menu item => "Einfügen" (paste in english) use "Einfgen" so AutomationElement can handle this

 

         

PropertyCondition propertyConditionID = new PropertyCondition(AutomationElement.AutomationIdProperty, "Einfgen");
          PropertyCondition propertyConditionControlType = new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.MenuItem);
          
          // Get the menu and its item
          MenuBar menu = (MenuBar)TestSharedFunctions.Ets4Window.Get(SearchCriteria.ByAutomationId("contextmenuTreeview"));
          AutomationElement menuItem = menu.AutomationElement.FindFirst(TreeScope.Descendants,
                                                                                                  new AndCondition(propertyConditionID, propertyConditionControlType));
          
          // move the mouse to the menu item
          MouseActionHelper mouseActionHelper = new MouseActionHelper();
          mouseActionHelper.MousePosX = (int)menuItem.Current.BoundingRectangle.TopLeft.X + 5;
          mouseActionHelper.MousePosY = (int)menuItem.Current.BoundingRectangle.TopLeft.Y + 5;
          mouseActionHelper.LeftClick();
          // Slow down!
          Thread.Sleep(2000);

 

So the element is found

 

if I use

 

menu.MenuItem("Einfgen");

 

a BricksException is the result

 

If I try to use menu.MenuItem("Einfügen")

 

the element will not be found

 

Any ideas?

 

Throndorin

 

 

 

 

 

Coordinator
Dec 14, 2009 at 7:08 PM

menu.MenuItem works based on Name property (text in white), is that the issue as you are using automationId in the example.

Dec 15, 2009 at 6:09 AM

oh you are right :)

 

but anyway the item is not found

 

the visible text in the menu is: "Einfügen", the automationId is "Einfgen"

 

mmh so I BricksException is strange if I use "Einfgen" as search as MenuItem

 

otherwise searching treenodes with special characters is not a problem. maybe the menu structure is the problem

 

 

Dec 16, 2009 at 3:36 PM

In contrast, I access a menu named "Underhåll" so, 'å' seems to work. If that helps at all with the debugging...

Dim menu As MenuItems.Menu = wsWindow.MenuBar.MenuItem("Underhåll")


Coordinator
Dec 25, 2009 at 3:43 AM

If you are still on it, can you do the LogStructure at top menu(bar) and see what it logs.

Jan 13, 2010 at 2:37 PM

I think there was a simple misunderstanding on my side :(

 

 

using german strings like "ü" and so on works

 

but randomly the item will not be found. So we use AutomationElement because the result is always the same.