How to get text of all options of dropdown in Selenium Webdriver using Ruby? -


http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/checkboxes/defaultcs.aspx

i able total number of options not able text.

works fine me or without using selenium::webdriver::wait.

here complete code (i commented out version without using webdriverwait, both versions should work anyway):

require 'selenium-webdriver'  driver = selenium::webdriver.for :firefox driver.get('http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/checkboxes/defaultcs.aspx')  wait = selenium::webdriver::wait.new(:timeout => 10) # seconds  # without wait # combo = driver.find_element(:id => 'ctl00_contentplaceholder1_radcombobox1_input') # combo.click  # wait combo = wait.until { driver.find_element(:id => "ctl00_contentplaceholder1_radcombobox1_input") } combo.click  # without wait # all_labels = driver.find_elements(:css => '#ctl00_contentplaceholder1_radcombobox1_dropdown .rcbitem label')  # wait all_labels = wait.until { driver.find_elements(:css => '#ctl00_contentplaceholder1_radcombobox1_dropdown .rcbitem label') } all_labels.each |label|   puts label.text end puts all_labels.count 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -