This project is read-only.

German strings

Dec 14, 2009 at 9:47 AM



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;
          // Slow down!


So the element is found


if I use




a BricksException is the result


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


the element will not be found


Any ideas?








Dec 14, 2009 at 8: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 7: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 4: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")

Dec 25, 2009 at 4: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 3: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.