Link to home
Start Free TrialLog in
Avatar of paulpp
paulppFlag for United States of America

asked on

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

ASKER CERTIFIED SOLUTION
Avatar of Ark
Ark
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of paulpp

ASKER

Perfect, thank you.
Avatar of paulpp

ASKER

Great Job.