Selenium IDE: I am not able record a value, selected from a dropdown list for my web application using selenium IDE
This is what I am trying to do:
- Open my web application
- Go to the details page to create a new entity
- While creating entity, I need to select some values form the drop down and record it on Selenium IDE
- Did all the above steps, they were recorded into Selenium IDE
- When I play back, it is trowing an error whenever it is trying to run the script, wh开发者_运维百科ere some selections from dropdown is needed.
Have been stuck with this for quite sometime now. Tried using "focus", but it did not work as well. Can anyone help in this regards?
Get Firebug
Inspect the element to find out the class ID of that UI Element.
- Command: Select
- Target: class ID
- Value: label=[value in drop down of this ID] For example (label=Hawaii if you're dealing with a state and that is the value in the drop down)
The code where you get that state value would look like this where you use the label.
option value="HI">Hawaii</option
That should do it.
Since I don't know your web application I am going to make a number of suggestions.
Record and replay will not always capture all of the items that it needs to reply. This is a misnomer unfortunately.
Try doing select | locator | itemInSelect
It might be worth adding a waitForX, where X is the item you are waiting for it, call before that in case that select is not loaded when the test hits that point.
I had a similar issue with post code boxes into which you enter a postcode, and then select a Store from the dropdown that appears. The actions recorded were not completely accurate.
I ended up fixing it by using sendKeys (not relevant to you), pause and click (got the xpath of the selection)
精彩评论