Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» how to connect DB in selenium webriver
Fri Oct 06, 2017 4:09 pm by anbarasi

» How find any text in browser screen and click on it?
Thu Oct 05, 2017 2:02 pm by sandeepkommineni

» Selenium Webdriver
Tue Oct 03, 2017 1:35 pm by PiyushBiswas

» GRID setup tutorial.
Wed Sep 27, 2017 4:29 pm by johnyapp

» Drag & Drop Between Windows Using Selenium Driver
Wed Sep 27, 2017 2:10 pm by 26rondel

» Check if window is closed / verify input
Sat Sep 23, 2017 10:21 pm by brainstir

» How to work on pages with AJAX in selenium?
Mon Sep 18, 2017 6:08 pm by azharuddin

» pause test until user press a key like F2
Wed Aug 09, 2017 11:10 pm by djnforce

» Selecting the input for auto populating element
Sat Jul 29, 2017 7:53 pm by kdabbara

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

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

View previous topic View next topic Go down

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

Post by sanket101 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.)

sanket101

Posts : 4
Join date : 2011-08-22

Back to top Go down

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

Post by Adviser 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
avatar
Adviser
------------------------
------------------------

Posts : 379
Join date : 2009-07-30
Location : India

http://seleniumforum.forumotion.net

Back to top Go down

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

Post by sanket101 on Tue Sep 06, 2011 2:33 pm

Its not working yet Sad

sanket101

Posts : 4
Join date : 2011-08-22

Back to top Go down

Finally it is resolved.... :)

Post by sanket101 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)

sanket101

Posts : 4
Join date : 2011-08-22

Back to top Go down

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

Post by GabrielaC81 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

GabrielaC81

Posts : 2
Join date : 2012-01-31

Back to top Go down

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

Post by sanket101 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)

sanket101

Posts : 4
Join date : 2011-08-22

Back to top Go down

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

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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