Hi All
I am having trouble clicking a js link and getting the correct page
response. I tried a couple of variations w/ little success (By Link, By
Element) and i'm hoping someone has come across the same issue.
Scenario; Click link to start a search , Expected results: pop up search
page for search criteria input
Test 1:
<clickElement XPath ="//*...@title='Pick a Job Function']"
description="Verify Client Job function lookup by title by
Image, clickElement" />
Test 2:
<clickElement XPath ="//*...@href='javascript:void(0)']"
description="Verify Client Job function lookup by
link;clickElement" />
OR
<clicklink XPath ="//*...@href='javascript:void(0)']"
description="Click Job function lookup by link, clicklink"/>
Test 3:
<clicklink href="javascript:ShowWizard('JOBCD', txtJobCodeID,
txtJobCodeDescription);"
description="Try Js click link "/>
Test 1 & 2 pass but the expected pop up page is not in the response
Test 3 fails and the available links in results = - label "" with url
"javascript:void(0)" and id "" (notice how lable and ID are blank)
I have a few more links of this type and need a unique way to identify each
so* [...@href='javascript:void(0)']* does not work,
*javascript:ShowWizard('JOBCD',
txtJobCodeID*, txtJobCodeDescription) fails.
Link snippet 1
<tr class="cHeight25">
<td id="requiredLabel">Job
Function:</td>
<td>
<input
type="hidden" name="txtJobCodeID" value="0">
<input type="Text" size="20" maxlength="50" name="txtJobCodeDescription"
id="txtJobCodeDescription" value="" readonly="true">
<a href="javascript:void(0)" onClick="javascript:ShowWizard('JOBCD',
txtJobCodeID, txtJobCodeDescription)"><img border="0" height="16"
src="/images/dropdown.gif" title="Pick a Job Function" width="16"></a>
</td>
</tr>
Link snippet 2
<a href="javascript:void(0);"
OnClick="industrypopup('/recruiters/industryOptions.cfm?szIndustryTypeID=0&szForm=addjob&szHiddenField=cboIndustryTypeID&szField=cboIndustryType_display');">
Setup:
<option name="ThrowExceptionOnScriptError" value="false"/>
WebTest 3.0/R_1758
htmlunit 2.4
Thanks
- Rhee
"Risk nothing and you gain nothing"