I'm trying to convert some code from VBA in Excel to C# Selenium and I'm struggling with the VBA verbiage. The VBA code parses a dropdown menu on a website like this:
Set b = a.contentDocument.getElementsByTagName("frame")("iframe_tier1")
Set c = a.contentDocument.getElementsByTagName("frame")("iframe_tier2")
For Each Ele In b.contentDocument.getElementsByTagName("select")("selectDropdownItem")
If Ele.Value = "xxxx" Then
Ele.Selected = True
Exit For
End If
Next
I'm trying to understand the second argument in the getElementsByTagName (ex. ("select")("selectDropdownItem"))
Is the second item ("selectDropdownItem") a second argument? The C# doesn't seem to want to allow something like:
myDriver.FindElements(By.TagName("select", "selectDropdownItem"));
I've also tried:
IList<IWebElement> myElements = myDriver.FindElements(By.TagName("select")("selectDropdownItem"));
foreach(IWebElement ele in myElements)
{
MessageBox.Show(ele.Text);
}
Each time I get an error saying TagName cannot accept multiple arguments. What is the second item in ("") in the VBA and how I can convert that to C#?