Jump to content

Recommended Posts

Posted

Hello all.  I've done quite a few scripts to control website with Firefox, IE and Chrome.  This one is giving me problems.  I'm trying to select the value of "Criminal" from a list.  Below is some information on this field when I inspect it:

 

COPY OF HTML

<label id="frmSearch:ddCourtType_label" class="ui-selectonemenu-label ui-inputfield ui-corner-all">Criminal</label>

--------------------------------------------------------

COPY OF XPATH

/html/body/div[1]/div[5]/div[3]/div/form[1]/div[1]/fieldset[2]/div/div/div/div[1]/div[2]/div/div/label

--------------------------------------------------------

COPY MINIMAL XPATH

//*[@id="frmSearch:ddCourtType_label"]

--------------------------------------------------------

SELECT IN THE HTML

<select id="frmSearch:ddCourtType_input" name="frmSearch:ddCourtType_input" tabindex="-1" aria-hidden="true" onchange="PrimeFaces.ab({s:"frmSearch:ddCourtType",e:"change",f:"frmSearch",p:"frmSearch frmSearch:fsCaseInformation frmSearch:fsDateRange",u:"frmSearch frmSearch:fsCaseInformation"});">
<option value="" data-escape="true">All</option>
<option value="ap" data-escape="true">Appellate</option>
<option value="bk" data-escape="true">Bankruptcy</option>
<option value="cv" data-escape="true">Civil</option>
<option value="cr" selected="selected" data-escape="true">Criminal</option>
<option value="mdl" data-escape="true">Multidistrict</option>
</select>

 

I've tried many ways to set this value to "Criminal".  Below are just a few of my attempts. 

 

This one selects the value of another list and sets the value to "cr"

       _FFXPath("//li[@data-item-value='cr']/label","",9)
       _FFCmd("FFau3.xpath.click()")

 

   _FFXPath("/div/div/ul/li[5]","",9)
   _FFCmd("FFau3.xpath.click()")

 

    _FFXPath("//input[@id='frmSearch:ddCourtType_4']")
    _FFCmd("FFau3.xpath.click()")

 

This attempt makes the list pull down, but does not select anything. 

    _FFXPath("/html/body/div[1]/div[5]/div[3]/div/form[1]/div[1]/fieldset[2]/div/div/div/div[1]/div[2]/div/div/label", "", 9)
    _FFCmd("FFau3.xpath.click()")

 

image.png.573e6f3d0ea0d1fac56c957cba0a7ed1.png

 

Any help would be appreciated. 

 

Posted

Hey Dan,

Yes, I do still use this and it works well for most of my site.  I do keep an old version of FF around just for these scripts.  I do need to update to the Webdriver at some point.  Until then, I just keep trying to change these scripts as the websites change.  Any suggestions on how to reference this field and set the value?  I've tried so many different things. 

Thanks

Posted

I actually had this code commented out because it didn't work before, but now it appears to be working.  Thanks.  I'll working on getting switched over one of these days.

_FFFormOptionSelect("frmSearch:ddCourtType_input", "id", "cr", "value")

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...