Forum Stats

  • 3,782,721 Users
  • 2,254,692 Discussions
  • 7,880,145 Comments

Discussions

Set Last Radio Button to Checked

644028
644028 Member Posts: 15
edited Jul 10, 2008 11:23AM in QA/Testing
Using e-Tester I am trying to set the last radio button to checked. The VBA code is below, however, when I replay the first button is being selected. Is there some setting I need to configure, since when I recorded the script I selected the first button? Also, below the code is the HTML for the radio button - maybe I am not using the FindElements correctly?


Private Sub RSWVBAPage_beforePlay()

Dim col As New Collection
Dim result As Boolean
Dim count As Integer
result = RSWApp.om.FindElements col, , "INPUT", "radioInput")
col(col.count).Checked = True

End Sub

<li><input type="radio" name="deliveryPref" value="M" onclick="JavaScript:clearEmail()" class="radioInput">Paper Delivery to your Current Address</li>

Message was edited by:
user641025

Message was edited by:
user641025

Comments

  • 644028
    644028 Member Posts: 15
    edited Jul 10, 2008 11:23AM
    I was able to get this resolved. The code below does work, however, it needs to be in an afterPlay on the page prior to the parameters. Additionally, the parameters that are being set through VBA need to have the "Use Default Value on Playback" checked under the parameter properties.

    Private Sub RSWVBAPage_afterPlay()
    Dim col As New Collection
    Dim count As Integer
    Dim countStr As String

    result = RSWApp.om.FindElements(col, "deliveryPref", "INPUT", "name")
    col(col.count).Checked = True
    End Sub

    Message was edited by:
    Muka
This discussion has been closed.