Share
Go down
sanket101
Posts : 4
Join date : 2011-08-22

How to 'Select' from dropdown list having a dynamic id?(Finally resolved)

on Wed Aug 24, 2011 5:32 pm
I want to select an option from dropdown list which is having a dynamic id,
I am stuck on this issue since many days. Please Help.


The recorded script is as below,
Command select
Target id=qb_final__93111____method__16 (This is the dynamic id)
Value label=Cash


N.B. I tried with several xpath methods such as,

Command select
Target //input[starts-with(@id,"qb")]
Value label Cash

but I get error as [error] Specified element is not a Select (has no options)


Last edited by sanket101 on Mon Sep 19, 2011 7:44 pm; edited 4 times in total (Reason for editing : To understand it better to the reader.)
avatar
Advisor
------------------------
------------------------
Posts : 383
Join date : 2009-07-30
Location : India
http://seleniumforum.forumotion.net

Re: How to 'Select' from dropdown list having a dynamic id?(Finally resolved)

on Sat Aug 27, 2011 7:13 pm
hi,

try to use regular experssion for id

like : qb_final__d{5}__method__d{2}

you can also use contains in xpath :
target: regexp://input[contains(@id,'qb_final__d{5}__method__d{2}
')]


It's not perfect, you need to do some some R&D and above solution will help you out. Best of luck.

Bye
sanket101
Posts : 4
Join date : 2011-08-22

Re: How to 'Select' from dropdown list having a dynamic id?(Finally resolved)

on Tue Sep 06, 2011 2:33 pm
Its not working yet Sad
sanket101
Posts : 4
Join date : 2011-08-22

Finally it is resolved.... :)

on Mon Sep 19, 2011 7:39 pm
Yes, Finally I am able to solve this issue (the silly me Smile )

Just replaced the keyword 'input' with 'select'...


i.e.
Command select
Target //select[starts-with(@id,"qb")]
Value label Cash


Thank all of you...


Last edited by sanket101 on Tue Jan 31, 2012 7:01 pm; edited 3 times in total (Reason for editing : proper syntax)
GabrielaC81
Posts : 2
Join date : 2012-01-31

Re: How to 'Select' from dropdown list having a dynamic id?(Finally resolved)

on Tue Jan 31, 2012 6:45 pm
Hi guys, can u help me too?
I don't have a dynamic id, but I use
select
target: id=P4_ABC
value: label=wonderful and I keep getting [error] Element id=P4_ABC not found

I'm not able to understand what should I do about ti
sanket101
Posts : 4
Join date : 2011-08-22

Re: How to 'Select' from dropdown list having a dynamic id?(Finally resolved)

on Tue Jan 31, 2012 6:59 pm
Hello Gabriela,

You can use following syntax

Command select
Target //select[starts-with(@id,"P4")]
value: label=wonderful


Last edited by sanket101 on Tue Jan 31, 2012 6:59 pm; edited 1 time in total (Reason for editing : proper)
Sponsored content

Re: How to 'Select' from dropdown list having a dynamic id?(Finally resolved)

Back to top
Permissions in this forum:
You cannot reply to topics in this forum