| || |
QTP: selection of item in Weblist doesn't display hidden fields
Upon manual selection of an item in a list, certain fields will be displayed. Upon playback in QTP, the item in the list is selected but the hidden fields are not displayed.
Have tried 2 methods but these methods do not work:
1) FireEvents (tried all EventName)
2) Changed the Replay Type to replay by mouse.
The value in the list are: Select a Document Type, Passport, Alien Registration, Re-Entry Document
For example, if Passport is selected, the following hidden fields will be displayed: Document Number, Expiration Date, etc.
Any suggestions on how to get the hidden values to display? Thank-you in advance.
Here is a part of the HTML code for the List in question:
<select id="select_document_type" name="currentGuestStatus.guestEmbarkationInfo.docu mentType" class="select-guest req-select" rel="docTypeLabel"><option value="">Select a Document Type</option><option value="PASSPORT" selected="selected">Passport</option><option value="ALIEN_REGITRATION">Alien Registration</option><option value="RE_ENTRY_DOCUMENT">Re-Entry Document</option></select><br />
<div class="document-number-field" style="display:none;"><span class="orange bold docNumberLabel">Document Number</span>
<span class="blue">*</span><br />
<input type="text" id="docNumberMask" class="docNumberField req" rel="docNumberLabel" max="12" size="12"/><input id="currentGuestStatus.guestEmbarkationInfo.docume ntNumber" name="currentGuestStatus.guestEmbarkationInfo.docu mentNumber" class="document-number-hidden" rel="docNumberLabel" type="hidden" value="123456789111"/></div></td></tr><tr class="expiry-date-field" style="display:none;"><td class="short" colspan="3"><span class="orange bold expireDateLabel">Expiration Date</span>
<span class="blue">*</span></td></tr><tr class="expiry-date-field" style="display:none;" ><td colspan="3">
From my experience, typical QTP methods such as Set, more often trigger desired reaction than DOM methods, although it's worth a try.
Anyway, can you please post all the events you've tried with the FireEvent method?
Hi try below,
* Select the value from the drop down
* Click on some other field (Lets say some other text box or logo). Need to focus out from the drop down field
* Then click again the Drop down field and press the down key (use send key method in scripting)
proceed the above steps manually if it works then proceed with scripting.
its the same steps that you do manually...
select your required option from drop down, then focus out of weblist(probably can use TAB) which would display the hidden fields.
Then select the new option you require.