• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 645
  • Last Modified:

IE Automation in VB.NET - How to Click Image

Hello,

I am trying to automate some functions on the website https:\\service.samsungportal.com, but I cant even get past the login page on this one.  I need help either clicking the "LOGIN" image, or calling the function checkinput().  I have tried submiting form2, but that doesnt recognize my user login even though it is correct.  I have also tried running the scripts, but no go.  I have attached my code so far.  

Any help would be appreciated.  Thank you.
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim ie As Object
        ie = CreateObject("internetexplorer.application")
        ie.Visible = True
        ie.navigate("https://service.samsungportal.com")
        While ie.Busy
            Application.DoEvents()
        End While
        Dim frmCol = ie.document.frames   'Get the frame collection
        Dim htmlDoc = frmCol.Item(0).document   'Get the HTML document within the frame
        Dim htmlColl = htmlDoc.getElementsByTagName("INPUT")   'Get the input collection from this HTML doc
        For Each htmlInput In htmlColl


            If htmlInput.Name = "userID" Then htmlInput.Value = "ABCDEF"
            If htmlInput.Name = "UserPassWord" Then htmlInput.value = "GHIJK"

        Next htmlInput
        

        While ie.Busy

        End While

   
    End Sub
End Class

Open in new window

0
paulpp
Asked:
paulpp
  • 2
1 Solution
 
ArkCommented:
Dim ie As Object
        ie = CreateObject("internetexplorer.application")
        ie.Visible = True
        ie.navigate("https://service.samsungportal.com")
        While ie.Busy
            Application.DoEvents()
        End While
        Dim frmCol = ie.document.frames   'Get the frame collection
        Dim htmlDoc = frmCol.Item(0).document   'Get the HTML document within the frame
        htmlDoc.getElementById("userID").value = "ABCDEF"
        htmlDoc.getElementById("UserPassWord").value = "GHIJK"
        htmlDoc.parentWindow.execScript("checkInput();", "javascript")
        While ie.Busy

        End While

Open in new window

0
 
paulppAuthor Commented:
Perfect, thank you.
0
 
paulppAuthor Commented:
Great Job.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now