質問

I am currently using Selenium IDE to test a website with a simple drop down menu that has options like "Trial" and "Invoice" and "Portal". I do not want to select the options, but just to make sure they are available. How would I do this in Selenium IDE?

I have tried commands like verifyselectedvalue, verifyselectedoptions and verifytext, and verifyvalue, but they seem to give me a positive no matter what I enter in as value, even "sdhjgfhsg."

I have checked previous posts on this topic, there are many close, but not quite what I am looking for.

Much thanks,

Ilya

役に立ちましたか?

解決 2

I did a test using a website has css menu drop down and I found the answer.

Record your script clicking on the css menu (each one) to get the element and after, change the command "click" to "verifyText". After that, set the field value (Selenium IDE) the text that you can verify (e.g.: Trial, Invoice and Portal).

I did this:

  • 1st field: Command
  • 2nd field: Target
  • 3rd field: Value
> verifyText | css=li.has-sub > ul > li > a > span           | Trial
> verifyText | //div[@id='cssmenu']/ul/li[2]/ul/li[2]/a/span | Invoice
> verifyText | css=li.last > a > span                        | Portal

他のヒント

Additional hint: To test if an option is selected just use "verify selected label" in Selenium IDE

Example: verify selected label | id=abc | 23:59

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top