0

I need to make work select in RFT in case the select is done via jQuery AJAX select where the html code looks like

<select style="display: none;" id="_campus_id" name="_campus_id">
  <option id="CAMPUS1" value="1">camp</option>
  <option id="CAMPUS2" value="2">camp2</option>
</select>
<input aria-haspopup="true" aria-autocomplete="list" role="textbox" autocomplete="off" class="ui-autocomplete-input ui-widget ui-widget-content ui-corner-left">
<button aria-disabled="false" role="button" class="ui-button ui-widget ui-state-default ui-button-icon-only ui-corner-right ui-button-icon" title="Show All Items" tabindex="-1">
  <span class="ui-button-icon-primary ui-icon ui-icon-triangle-1-s"></span><span class="ui-button-text"> 
  </span>
<button>

I need to "go" to input box and type text then "press" {DOWN} and {ENTER}. I have this part ready but the input box doesn't have any unique id so I want to find the input box based on the select which got property ID.

It would be possible using something like getNext() but I guess it doesn't exist in RFT.

Any other idea how to make this work? In case there are more than one AJAX selects on the page?

Radek
  • 13,813
  • 52
  • 161
  • 255

3 Answers3

1

Is it the child of a specific unique object, say, a div or a form? If so, you can use the find() method to search for the child of a specific object.

Is the string "ui-autocomplete-input ui-widget ui-widget-content ui-corner-left" unique among objects of that type? You can do a find() to get all the input boxes and then loop through them checking the properties with getProperty() until you're sure you have the right one. This can be combined with the above suggestion.

Yamikuronue
  • 746
  • 8
  • 37
0

Confirmed with IBM support that RFT doen't have any equivalent to jQuery .next() method as per current version. I created a ticket for an enhancement.

Radek
  • 13,813
  • 52
  • 161
  • 255
0

You can get everything from the select box and use some regular expression to search for keywords or a full sentance in that pick that as your option.

JEuvin
  • 866
  • 1
  • 12
  • 31