Hi Jeff,
I could not reproduce your issue.
[TestMethod]
public void SelectItem_ByIndexOnHtmlComboBox_Succeeds()
{
//Arrange
string tempFilePath = Path.GetTempFileName();
File.WriteAllText(tempFilePath,
@"<html>
<head>
<title>test</title>
</head>
<body>
<select id=""PaymentAccountContactID"" class=""InputLargeDropdown paymentContactInfo"" name=""PaymentAccountContactID"">
<option id=""Contact_@contact.ContactID"" value=""51232"">BILL JENSVOLD</option>
<option id=""Contact_@contact.ContactID"" value=""172453"">BILL JENSVOLD</option>
<option value=""0"">Create New Contact...</option>
</select>
</body>
</html>");
TestObject testObject = CUITe_BrowserWindow.Launch<TestObject>(tempFilePath);
//Act
testObject.PaymentAccountContactDropDown.SelectItem(1);
//Assert
Assert.AreEqual("BILL JENSVOLD", testObject.PaymentAccountContactDropDown.SelectedItem);
testObject.Close();
File.Delete(tempFilePath);
}
public class TestObject : CUITe_BrowserWindow
{
public new string sWindowTitle = "test";
public CUITe_HtmlComboBox PaymentAccountContactDropDown { get { return Get<CUITe_HtmlComboBox>("id=PaymentAccountContactID"); } }
}
The text in the exception in your first post seems contradictory to the sample code.
For example, the exception reads, "Cannot perform 'SetProperty of SelectedIndex with value "1"' on the control.", but the sample code indicates you are trying to call the SelectItem method.
Also, the exception reads, "Failed to find any control that matched the value Contact_@contact.ContactID for the search property Id." but this contradicts the search property specified as "id=PaymentAccountContactID".
I recommend running your code with debug symbols so that the line number is included in the stack trace at the time of the exception so you can verify the line of code where the exception is being thrown, etc.
Thank you.
|