XPATH and target/value help
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
<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,
Re: XPATH and target/value help
Why dont you use the regular xpath expression? It allows matching the nodes having partial matches. Like..
//select[@id='QualificationId']/option[contains(text(),'Complete ECDL Essentials Learning and Testing')]