Hi Kalyan,

The Radio button is not selected because of the Index recognition. The Index
will be same for all the radio buttons.

So, if possible, try the below method.

Just do a loop check in order to select the particular radio button. Get the
rowcount of the webtable and then if u want to select a radio button of the
particular row, jus get the cell data and try clicking it.

For Ex: The script will b as follows:

rowcount = Browser("Browser").Page("page").WebTable("webtable").RowCount
For i = 4 to rowcount
ABC = Browser("Browser").Page("page").WebTable("webtable").GetCellData(i,
column number)
If ABC = XYZ Then
    j = i - 4
 Set strradio1 =
Browser("Browser").Page("page").WebTable("webtable").ChildItem(i, 1,
"WebRadioGroup", 0)
 strradio1.Select ("#" & Cint(j))
End If
Next

i = 4 bcos ur webtable s starting from the 4th row. XYZ is the value u r
getting and u can compare it with the data that u hav parameterized.
This s not the only method to solve it.

Hope this helps.

Regards,
Arun.
On Wed, Dec 24, 2008 at 10:17 AM, kalyan <[email protected]> wrote:

>
> Hi All
>
> I have a table with 44 rows n the data starts from 4th row
>
> set table = Browser("Customer Search").Page("Customer Search").WebTable
> ("html id:=ctl00_ContentPlaceHolder1_DisplayGridControl1_tblMaster")
> Set ObjectName = Browser("Customer Search").Page("Customer
> Search").WebTable("html
> id:=ctl00_ContentPlaceHolder1_DisplayGridControl1_tblMaster").childitem
> (4,1,"WebRadioGroup",0)
> ObjectName.click
>
> then the webradio is clicked in the row from which the data
> starts....but if i change the rownumber...then also only the webradio
> in the fourth row is clicked...
>
> here is the view source of my page
>
> <table id="ctl00_ContentPlaceHolder1_DisplayGridControl1_tblMaster"
> cellspacing="0" cellpadding="0" border="0" Width="750">
> <tr>
> <td>Total # of Records Available: &nbsp;44</td>
> </tr>
> <tr>
> <td></td>
> </tr>
> <tr>
> <td>Sel</td>
> <td>CUSTOMER #</td>
> <td>COMPANY CODE</td>
> <td>CURRENCY</td>
> <td>CUSTOMER NAME</td>
> <td>ADDRESS</td>
> <td>ZIP</td>
> </tr>
> <tr>
> <td<input type='radio' onclick="javascript:funRadioButton
>
> (this,'ctl00_ContentPlaceHolder1_DisplayGridControl1_hdnCheckValues','ctl00_ContentPlaceHolder1_DisplayGridControl1_hdnId','ctl00_ContentPlaceHolder1_DisplayGridControl1_hdnMode','')"
> name='rdoGrid' id='rdo_1910' value='1910'></td>
> <td>23000</td>
> <td>002</td>
> <td>CDN</td>
> <td>AXIDATA (CAD)</td>
> <td>45 COMMANDER ROAD</td>
> <td>M15 3Y3</td>
> </tr>
> <tr>
> <td><input type='radio' onclick="javascript:funRadioButton
>
> (this,'ctl00_ContentPlaceHolder1_DisplayGridControl1_hdnCheckValues','ctl00_ContentPlaceHolder1_DisplayGridControl1_hdnId','ctl00_ContentPlaceHolder1_DisplayGridControl1_hdnMode','')"
> name='rdoGrid' id='rdo_1911' value='1911'></td>
> <td>63000</td>
> <td>002</td>
> <td>USD</td>
> <td>AXIDATA (USD)</td>
> <td>45 COMMANDER ROAD</td>
> <td>M15 3Y3</td>
> </tr>
> <tr>
> <td><input type='radio' onclick="javascript:funRadioButton
>
> (this,'ctl00_ContentPlaceHolder1_DisplayGridControl1_hdnCheckValues','ctl00_ContentPlaceHolder1_DisplayGridControl1_hdnId','ctl00_ContentPlaceHolder1_DisplayGridControl1_hdnMode','')"
> name='rdoGrid' id='rdo_1924' value='1924'></td>
> <td>23012</td>
> <td>002</td>
> <td>CDN</td>
> <td>CCL LABEL (CAD)</td>
> <td>35 MCLACHLAN DRIVE</td>
> <td>M9W 1E4</td>
> </tr>
> <tr>
> <td><input type='radio' onclick="javascript:funRadioButton
>
> (this,'ctl00_ContentPlaceHolder1_DisplayGridControl1_hdnCheckValues','ctl00_ContentPlaceHolder1_DisplayGridControl1_hdnId','ctl00_ContentPlaceHolder1_DisplayGridControl1_hdnMode','')"
> name='rdoGrid' id='rdo_1925' value='1925'></td>
> <td>63012</td>
> <td>002</td>
> <td>USD</td>
> <td>CCL LABEL (USD)</td>
> <td>35 MCLACHLAN DRIVE</td>
> <td>M9W 1E4</td>
> </tr>
> </table>
>
> the id's will be generated dynamically.....and that to the number of
> rows in the table are also dynamic...
>
> earlier help is appreciated..
>
> Thanks & Regards
> Kalyan
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to