470,831 Members | 1,353 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,831 developers. It's quick & easy.

how to automate selection of radio buttons using vb.net

5
.Hi,
Can anybody help me!!!!!!
how to automate selection of radio buttons using vb.net.
I am using mshtml.htmldocument

Public Sub OpenDownloadDataPage(ByRef wbBrowser As SHDocVw.InternetExplorer)

Dim HTMLDoc1 As mshtml.HTMLDocument
Dim iHtmlCol As IHTMLElementCollection
Dim iHtmlEle As IHTMLElement
Dim str1 As String


Do
Loop Until Not wbBrowser.Busy

HTMLDoc1 = wbBrowser.Document
iHtmlCol = HTMLDoc1.getElementsByTagName("a")

' Press the anchor tag to open DownloadData page
For Each iHtmlEle In iHtmlCol
If Not iHtmlEle.outerText Is Nothing Then
If iHtmlEle.outerText.ToLower = "Download Data".ToLower Then
iHtmlEle.click()
Exit For
End If
End If
Next
'Select Radio Buttons
For Each iHtmlEle In iHtmlCol
If Not iHtmlEle.getAttribute("name") Is Nothing Then
str1 = iHtmlEle.getAttribute("name").ToString
If str1 = "KWH" Then
If iHtmlEle.outerHTML = "<input type=radio" & _
" name=demcons value=kwh checked " & _
"> " Then

iHtmlEle.click()
Exit For
End If

End If

End If



Next


Do
Loop Until Not wbBrowser.Busy

End Sub


Satishk
Sep 28 '06 #1
0 1954

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Owen Funkhouser | last post: by
1 post views Thread by middletree | last post: by
3 posts views Thread by shanmukhi | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.