Is it possible to make selenium IDE open a dropdown menu to show all options? I have a test case where I need to open a dropdown and take a screenshot as evidence of all options there ... but can't figure out a way to do this. P.s: the click option does not do anything, already tried it.
Asked
Active
Viewed 416 times
0
-
Could you provide the html fragment with the select and options? – Antesser Mar 31 '16 at 13:35
-
`` – sanjuro8998 Mar 31 '16 at 13:45
2 Answers
1
Check this out:
storeXpathCount | //select[@id='LANGUAGE']/option | count
storeEval | window.document.getElementById('LANGUAGE').setAttribute('size', ${count}) | lol
But I don't know why do you need a screenshot to prove something while you can just check it by standart selenium IDE command:
assertText | id=LANGUAGE | - Select from list - (en_US) Canada Canadian French United States English

Antesser
- 669
- 4
- 5
-
It modifies the dropdown appearance ... the test is to validate the UI ... I must prove in a screenshot that the dropdown works and show the options, is not actually to validade the options there :-) – sanjuro8998 Mar 31 '16 at 14:19
-
-
Selenium IDE is using javascript to perform actions on the page. But that is impossible to open dropdown with javascript. Take a look here http://stackoverflow.com/questions/430237/is-it-possible-to-use-js-to-open-an-html-select-to-show-its-option-list. That's why that is impossible to do with selenium IDE too. – Antesser Mar 31 '16 at 15:12
0
Check this code:
Actions action = new Actions(driver);
action.clickAndHold(driver.findElement(By.id("dropdownid"))).build().perform();
//you need to release the control from the test
//actions.MoveToElement(driver.findElement(By.id("dropdownid"))).Release();

Pritam Parashuram Thakur
- 131
- 9
-
Isn't this on Selenium Webdriver? I'm using Selenium IDE, Firefox extension :-) – sanjuro8998 Mar 31 '16 at 13:18