Subject: how to automate selection of radio buttons using v
Posted By: satish_k Post Date: 9/28/2006 12:02:00 AM
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




Reply By: gbianchi Reply Date: 9/28/2006 9:46:58 AM
cross post http://p2p.wrox.com/topic.asp?TOPIC_ID=50301

and we are still trying to find out what's your problem exactly...

HTH

Gonzalo

Go to topic 50364

Return to index page 162
Return to index page 161
Return to index page 160
Return to index page 159
Return to index page 158
Return to index page 157
Return to index page 156
Return to index page 155
Return to index page 154
Return to index page 153