Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

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

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

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.)
Advisor
Advisor
------------------------
------------------------
Posts : 387
Join date : 2009-07-30
Location : India
https://seleniumforum.forumotion.net

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

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
avatar
sanket101
Posts : 4
Join date : 2011-08-22

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

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

How to 'Select' from dropdown list having a dynamic id?(Finally resolved) Empty Finally it is resolved.... :)

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)
avatar
GabrielaC81
Posts : 2
Join date : 2012-01-31

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

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
avatar
sanket101
Posts : 4
Join date : 2011-08-22

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

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

How to 'Select' from dropdown list having a dynamic id?(Finally resolved) Empty 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