MenuItem
Re: MenuItem
Hi,
Of course, it's most probably possible (if the individual menu items could be tracked by Ranorex). Please post a Ranorex snapshot (not screenshot!) of the menu in question.
Basically, you should use code similar to this:
https://www.ranorex.com/help/latest/cod ... oryElement
Of course, it's most probably possible (if the individual menu items could be tracked by Ranorex). Please post a Ranorex snapshot (not screenshot!) of the menu in question.
Basically, you should use code similar to this:
https://www.ranorex.com/help/latest/cod ... oryElement
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: MenuItem
Here is a method I wrote to do this.
You could also use
Code: Select all
public static Boolean SelectElementFromComboBox(RepoItemInfo info, string Text)
{
try
{
Ranorex.Unknown Element = info.FindAdapter<Ranorex.Unknown>();
Element.Click();
RxPath path = Element.GetPath();
Ranorex.ComboBox dropdown = Host.Local.FindSingle<Ranorex.ComboBox>(path);
ListItem lstItem = (from a in dropdown.Items
where a.Text.Equals(Text)
select a).FirstOrDefault();
lstItem.Focus();
lstItem.Click();
return true;
}
catch(Exception e)
{
return false;
}
}
You could also use
Code: Select all
public static Boolean SelectElementFromComboBox(RepoItemInfo info, string Text)
{
try
{
Ranorex.ComboBox dropdown = info.FindAdapter<Ranorex.ComboBox>();
ListItem lstItem = (from a in dropdown.Items
where a.Text.Equals(Text)
select a).FirstOrDefault();
lstItem.Select();
return true;
}
catch(Exception e)
{
return false;
}
}