Click here to Skip to main content
15,907,874 members
Home / Discussions / Web Development
   

Web Development

 
QuestionCenter Site Pin
SortyZ5-Dec-10 8:27
SortyZ5-Dec-10 8:27 
AnswerRe: Center Site Pin
TweakBird24-Dec-10 1:39
TweakBird24-Dec-10 1:39 
GeneralRe: Center Site Pin
Hiren solanki24-Dec-10 1:53
Hiren solanki24-Dec-10 1:53 
GeneralRe: Center Site Pin
Kasson6-Jan-11 20:35
Kasson6-Jan-11 20:35 
GeneralRe: Center Site Pin
TweakBird7-Jan-11 18:34
TweakBird7-Jan-11 18:34 
GeneralMessage Closed Pin
17-Jan-11 23:29
zenweb tasarim17-Jan-11 23:29 
GeneralMessage Closed Pin
7-Jun-11 8:10
celilcan7-Jun-11 8:10 
QuestionJavascript Multiple Select with Selenium Pin
Ibrahim Bello5-Dec-10 0:55
Ibrahim Bello5-Dec-10 0:55 
Hi,

I am testing a webpage using selenium. I want to select all the items in a multi-select listbox.
It seems selenium doesn't provide a "select all items" function even though it has an "unselect all items".
I have been unable to use the add_selection function for this purpose.

I write a javascript code to select all the items using eval_script(). I'm using python.

script = """
multiselect = document.getElementsByTagsName("name");
alert(multiselect);
"""


The alert statement above displays that the object is an HTML Collection. Interestingly alert(multiselect.length);
returns "0" even though I'm sure that the list is populated. This makes multiselect.item(2) for example to evaluate to "undefined".

To select all the items I'm simply using:

script = """
for(var k = 0; k < multiselect.length; k++)
{
multiselect.item(2).selected = true; 
}
"""


I run the script by simply: sel.eval_script(script). How do I get around this? Is Javascript the best way? Thanks Smile | :)
GeneralBlueprint IE hack breaks VS designer. Pin
Brady Kelly23-Nov-10 17:12
Brady Kelly23-Nov-10 17:12 
GeneralRe: Blueprint IE hack breaks VS designer. Pin
Bryian Tan3-Jan-11 14:29
professionalBryian Tan3-Jan-11 14:29 
QuestionLooking for software for a client Pin
LenaBr16-Nov-10 4:16
LenaBr16-Nov-10 4:16 
AnswerQuickbooks Online Pin
David Mujica16-Nov-10 4:26
David Mujica16-Nov-10 4:26 
GeneralRe: Quickbooks Online Pin
LenaBr16-Nov-10 4:37
LenaBr16-Nov-10 4:37 
AnswerRe: Looking for software for a client Pin
cjoki16-Nov-10 4:51
cjoki16-Nov-10 4:51 
Questiona:hover problem Pin
mr_plow9911-Nov-10 5:14
mr_plow9911-Nov-10 5:14 
AnswerRe: a:hover problem Pin
Manfred Rudolf Bihy12-Nov-10 1:12
professionalManfred Rudolf Bihy12-Nov-10 1:12 
AnswerRe: a:hover problem Pin
Gregory Gadow30-Nov-10 3:55
Gregory Gadow30-Nov-10 3:55 
QuestionFlexible datatype Pin
Ajay Kale New11-Nov-10 0:31
Ajay Kale New11-Nov-10 0:31 
AnswerRe: Flexible datatype Pin
Richard MacCutchan11-Nov-10 1:27
mveRichard MacCutchan11-Nov-10 1:27 
AnswerRe: Flexible datatype Pin
TweakBird16-Nov-10 0:51
TweakBird16-Nov-10 0:51 
AnswerRe: Flexible datatype Pin
Simon_Whale16-Nov-10 4:27
Simon_Whale16-Nov-10 4:27 
QuestionTest problem Pin
bfis10813710-Nov-10 19:52
bfis10813710-Nov-10 19:52 
AnswerRe: Test problem Pin
Mycroft Holmes10-Nov-10 21:00
professionalMycroft Holmes10-Nov-10 21:00 
AnswerRe: Test problem Pin
cjoki12-Nov-10 5:16
cjoki12-Nov-10 5:16 
Questionhow to pass the slected option from a html drop down list to a java script variable?? Pin
krrish chaitanya4-Nov-10 0:20
krrish chaitanya4-Nov-10 0:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.