Open GoogleCodeExporter opened 9 years ago
Selenium 1 example : driver.Select "css=#idselect", "label=Valeur 2"
Selenium 2 example :
driver.findElementByCssSelector("oki").AsSelect.selectByText "Valeur 2"
Refer to the Api documentation for more information.
Original comment by florentbr
on 29 Jan 2014 at 11:29
THank you very much for answering me.
I didn't understand what "oki" correspond to ?
Another question, if i want to use the first example, and put the content of a
cell instead of the string "Valeur 2"
Like this : Selenium 1 example : driver.Select "css=#idselect", "label="
Workbook1.Sheets("Feuil1").Range("K1").Value
But it's not working
Original comment by kong.fu...@gmail.com
on 29 Jan 2014 at 1:46
"oki" is an example of CSS selector which can be obtain with the recorder or by
inspecting the source with Firebug.
This should work with your case :
This one will select using the id value :
Selenium 1 : driver.Select "name=select", "value=" & Workbook1.Sheets("Feuil1").Range("K1").Text
Selenium 2 : driver.findElementByName("select").AsSelect.selectByValue Workbook1.Sheets("Feuil1").Range("K1").Text
This one will select using the visible text :
Selenium 1 : driver.Select "name=select", "label=" & Workbook1.Sheets("Feuil1").Range("K1").Text
Selenium 2 : driver.findElementByName("select").AsSelect.selectByText Workbook1.Sheets("Feuil1").Range("K1").Text
Original comment by florentbr
on 29 Jan 2014 at 2:23
Original comment by florentbr
on 8 Sep 2014 at 5:40
Original issue reported on code.google.com by
kong.fu...@gmail.com
on 29 Jan 2014 at 11:01