0

こんにちは

セレン テストを使用して、作成した配列内のすべての要素がドロップダウン メニューに存在するかどうかを確認するにはどうすればよいですか?

私はこのようなものを持っていますが、うまくいかないようです

ANIMALS = [「ヘビ」、「猫」、「犬」]

def validate_all_animals_exist (セレン)

  ANIMALS.each { |animal| assert selenium.is_element_present(animal), "Expected category [#{animal}] to be present" }

終わり

前もって感謝します

4

1 に答える 1

1

verifySelectOptions 呼び出しを使用する必要があります

verifySelectOptions(selectLocator, pattern) getSelectOptions(selectLocator) 引数から生成:

    * selectLocator - an element locator identifying a drop-down menu

Returns:
    an array of all option labels in the specified select drop-down

Gets all option labels in the specified select drop-down.

だからそうなるだろう

assert_equal "123123", page.get_select_options("foo").join(",")
于 2010-04-30T10:07:51.877 に答える