- sanket101
- Posts : 4
Join date : 2011-08-22
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)
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)
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
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)
Tue Sep 06, 2011 2:33 pm
Its not working yet
- sanket101
- Posts : 4
Join date : 2011-08-22
Finally it is resolved.... :)
Mon Sep 19, 2011 7:39 pm
Yes, Finally I am able to solve this issue (the silly me )
Just replaced the keyword 'input' with 'select'...
i.e.
Command select
Target //select[starts-with(@id,"qb")]
Value label Cash
Thank all of you...
Just replaced the keyword 'input' with 'select'...
i.e.
Command select
Target //select[starts-with(@id,"qb")]
Value label Cash
Thank all of you...
- GabrielaC81
- Posts : 2
Join date : 2012-01-31
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
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)
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
You can use following syntax
Command select
Target //select[starts-with(@id,"P4")]
value: label=wonderful
Permissions in this forum:
You cannot reply to topics in this forum