DOMCombo = webDocumentName.FindSingle(".//select[@Id='" + ComboName + "']");foreach (OptionTag option in DOMCombo.Find(".//option"))
{
if (option.InnerText == ComboItem)
{
ComboItemFound = true;
break;
}
}DOMCombo.EnsureVisible();
DOMCombo.Focus();
DOMCombo.Click(Location.CenterRight, 1000);
ListItem item = "/container[@caption='selectbox']/listitem[@text='" + ComboItem + "']";
item.Click(Location.Center, 1000);hobli wrote:Is there any way Ranorex can find the relevant item in the dropdown list with FireFox?
Ranorex.SelectTag selectTag = Host.Local.FindSingle("/dom[@page='test.html']/body/select");
foreach(Ranorex.OptionTag optTag in selectTag.Find(".//option"))
{
Console.WriteLine(optTag.InnerText);
}hobli wrote:Ranorex 2.3.1 can only recognise "container[@caption='dropdown']" (using Ranorex Spy)
//DOM dorp down "/dom[@page='test.html' and @path='C:/Users/pgrad/Desktop/test.html' and @browsername='Mozilla']/body/select" //Form drop down "/form[@processname='firefox']/element/container[1]/element[1]/container/combobox[@accessiblevalue='Test 1']"
hobli wrote:Btw, I can use this rxpath to locate comboBox in FF, however:
"/form[@processname='firefox']/element/container[1]/element[1]/container/combobox[@accessiblevalue='Test 1']"
OptionTag option = "//rxpath/to/option"; option.Selected = true;
using System.Text.RegularExpressions;
public static void SelectOption(this SelectTag selectBox, string itemName)
{
Report.Info("Selecting item '"+itemName+"' in "+selectBox);
// ignore case regex
string itemRegex = "^(?i)" + Regex.Escape(itemName) + "$";
selectBox.EnsureVisible();
OptionTag option = selectBox.FindSingle<OptionTag>("option[@InnerText~'"+itemRegex+"']");
option.Selected = true;
}Users browsing this forum: No registered users and 0 guests