Open GoogleCodeExporter opened 9 years ago
I understand that i can get all the options in an object collection:-
objCollection = driver.findElementsByCssSelector("#Test_Reason option")
and then run a loop to find the option thats selected:-
For j = LBound(objCollection) To UBound(objCollection)
If objCollection(j).Selected Then x = objCollection(j).Text
Next
but is there a direct way to get this text without running a loop?
Original comment by rohan.ka...@gmail.com
on 26 Dec 2013 at 7:32
There you go :
...
Dim selectedText
'Selenium 2 :
selectedText = driver.findElementById("Test_Reason").AsSelect.SelectedOption.Text
'Selenium 1 :
selectedText = driver.getSelectedLabel("id=Test_Reason")
Debug.Print selectedText
...
Original comment by florentbr
on 26 Dec 2013 at 7:40
Thank you for the response!!
Original comment by rohan.ka...@gmail.com
on 26 Dec 2013 at 9:13
Original comment by florentbr
on 8 Sep 2014 at 5:40
Original issue reported on code.google.com by
rohan.ka...@gmail.com
on 26 Dec 2013 at 6:35