checking if all elements in a drop down menu are present with selenium testing using ruby? -
hi
how can check if elements in array created present in drop down menu using selenium testing?
i have dosent seem work
animals = ["snake","cat","dog"]
def validate_all_animals_exist(selenium)
animals.each { |animal| assert selenium.is_element_present(animal), "expected category [#{animal}] present" }
end
thanks in advance
you need use verifyselectoptions call
verifyselectoptions(selectlocator, pattern) generated getselectoptions(selectlocator) arguments:
* selectlocator - element locator identifying drop-down menu returns: array of option labels in specified select drop-down gets option labels in specified select drop-down.
so be
assert_equal "123123", page.get_select_options("foo").join(",")
Comments
Post a Comment