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
Gibbsy1985
Posts : 1
Join date : 2012-07-02

XPATH and target/value help Empty XPATH and target/value help

Mon Jul 02, 2012 11:20 pm
Hi all,

I have a drop down list, that contains values, on the end of each value is a count, which changes constantly. I'm trying to select a value in the dropdown, but match on say the first 5 characters (so that I can get around the value changing). Can this be done? I've attached a snippet of the source code below

<div class="formRowFullWidthDiv">
<select id="QualificationId" class="textBoxMinLarge input-validation-error" name="QualificationId" data-val-required="The QualificationId field is required." data-val-range-min="1" data-val-range-max="2147483647" data-val-range="Qualification must be selected" data-val-number="The field QualificationId must be a number." data-val="true">
<option value="0" selected="selected">Please Select...</option>
<option value="625">Complete ECDL Essentials and Extra Learning and Testing Solution for Schools (0)</option>
<option value="620">Complete ECDL Learning and Testing Solution (0)</option>
<option value="619">Complete ECDL Essentials Learning and Testing Solution (6)</option>

If I wanted to select option 619 based on the name, but only a portion of it, i.e. "Complete ECDL Essentials Learning and Testing"
how could this be done....

In IDE i have "SELECT" in my command column, "QualificationId" in my target column, and am struggling on the VALUE column..

could someone help?

Many thanks in advance,

rohit13
rohit13
Master
Master
Posts : 180
Join date : 2012-03-29
Age : 37
Location : INDIA
http://radical-qa.blogspot.in/

XPATH and target/value help Empty Re: XPATH and target/value help

Tue Jul 03, 2012 12:40 pm
With the help of regular expression you can write your code.
Below is for option 619
Code:
select  |  id=QualificationId  | label=regexp:.*Complete ECDL Essentials Learning and Testing Solution.*
Back to top
Permissions in this forum:
You cannot reply to topics in this forum