how to write xpath or other command to select radio button in this JSP code

92 views
Skip to first unread message

prasad

unread,
Jun 30, 2007, 7:53:22 AM6/30/07
to selenium-users...@googlegroups.com
Hi All,

This is the JSP page,I want to write xpath to select radio buttons in the {code:html}<cafe:form>..... </cafe:form> tag .
or if any other way to select radio button which is inside inner table as here, please help me to write selenium test.



<body onload="init();" class="windowBody">
<table width="100%" class="BrandingFrame">
<tr>
<td>

<% String sPath = CommonMethods.getResourcePath("bundles/cafecommon/snippets/header.jsp", false); %>
<jsp:include page="<%= sPath %>" flush="true">
<jsp:param name="displaybanner" value="true"></jsp:param>
<jsp:param name="title" value="Capture PDL"></jsp:param>
</jsp:include>

<cafe:form id="form" usePrompts="false">

<input type="hidden" name="Context.service" value="">
<input type="hidden" id="fd_CustEmpInfoID"
/> />
<table>
<tr>
<td class="FormLabel">
<div id="type0" style="visibility:hidden;"><input onClick="onCAFSI();" id="pdl" name="so" />> CAFSI PDL </div>
</td>
</tr>
<tr>
<td class="FormLabel">
<div id="type1" style="visibility:hidden;"><input onClick="onSelfApproved();" id="pdl" name="so" />> Self Approved PDL </div>
</td>
</tr>
<tr>
<td class="FormLabel">
<div id="type2" style="visibility:hidden;"><input onClick="onBrokered();" id="brokered" name="so" />> Brokered1</div>{code} _// to click this radio button how to write xpath?_
{code:html}</td>
</tr>
<tr>
<td class="FormLabel">
<div id="type3" style="visibility:hidden;"><input onClick="onInstallment();" id="installment" name="so" />> Installment </div>
</td>
</tr>
<tr>
<td class="FormLabel">
<div id="type4" style="visibility:hidden;"><H5><FONT color ="red">New Loans are not allowed in <cafe:valueOf select="CommonInfo.state" ></cafe:valueOf> for <cafe:valueOf select="CommonInfo.businessUnit" ></cafe:valueOf></FONT></H5></div>
</td>
</tr>
<tr>
<td>


<% sPath = CommonMethods.getResourcePath("bundles/cafecommon/snippets/footer.jsp", false); %>
<jsp:include page="<%= sPath %>" flush="true">
<jsp:param name="navbtnpanelurl" value="bundles/capturepdl/xml/UC21WF006serviceoptions.xml" ></jsp:param>
</jsp:include>
</td>
</tr>

</table>



</cafe:form>

</td>
</tr>
</table>
</body>{code}

prasad

unread,
Jun 30, 2007, 7:56:36 AM6/30/07
to selenium-users...@googlegroups.com
Hi All,

This is the JSP page,I want to write xpath to select radio buttons in the {code:html}<cafe:form>..... </cafe:form> tag .
or if any other way to select radio button which is inside inner table as here, please help me to write selenium test.



<body onload="init();" class="windowBody">
<table width="100%" class="BrandingFrame">
<tr>
<td>

prasad

unread,
Jun 30, 2007, 7:58:27 AM6/30/07
to selenium-users...@googlegroups.com

Kevin Menard

unread,
Jun 30, 2007, 11:25:41 AM6/30/07
to selenium-users...@googlegroups.com
You have to do it after the JSP has been processed by your servlet container. What you really want to be looking at is the rendered HTML. I'd recommend grabbing the Selenium IDE to generate the XPath for you.

Reply all
Reply to author
Forward
0 new messages