Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Define Store variable
- Dim Store As String
- Store = Me.TextBox1.Text
- 'Define IP Address variable
- Dim IPAddress As String
- IPAddress = Me.TextBox2.Text
- 'Define Username variable
- Dim Username As String
- Username = Me.TextBox3.Text
- 'Define Password variable
- Dim Password As String
- Password = Me.TextBox4.Text
- ' Open Store Specific URL 1
- Dim IE As Object 'Internet explorer object
- Dim objCollection1 As Object 'Variable used for cycling through different elements
- Dim objCollection2 As Object 'Variable used for cycling through different elements
- Dim objCollection3 As Object 'Variable used for cycling through different elements
- Dim objCollection4 As Object 'Variable used for cycling through different elements
- Dim objCollection5 As Object 'Variable used for cycling through different elements
- Dim objCollectionA As Object 'Variable used for cycling through different elements
- 'Create IE Object
- IE = CreateObject("InternetExplorer.Application")
- IE.Visible = True
- IE.Navigate("http://" & IPAddress & ":8080/")
- Do While IE.Busy
- Application.DoEvents() 'This allows the site to load first
- Loop
- 'Find the field you are looking for and store it into the objCollection variable
- objCollection1 = IE.document.getelementsbyname("txtDeviceName")
- objCollection2 = IE.document.getelementsbyname("txtName")
- objCollection3 = IE.document.getelementsbyname("txtUID")
- objCollection4 = IE.document.getelementsbyname("txtPWD")
- objCollection5 = IE.document.getelementsbyname("txtOrgID")
- objCollectionA = IE.document.getelementsbyname("imgReregister")
- 'Call element, and set value equal to the data you have from your form
- objCollection1(0).Value = "ALL.MONSOON." & Store
- objCollection2(0).Value = "ALL.MONSOON." & Store
- objCollection3(0).Value = Username
- objCollection4(0).Value = Password
- objCollection5(0).Value = "MONSOON"
- objCollectionA.getElementById("imgReregister").click()
- ************** Exception Text **************
- System.MissingMemberException: Public member 'getElementById' on type 'DispHTMLElementCollection' not found.
- at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
- at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
- at WindowsApp1.Form1.Button1_Click(Object sender, EventArgs e)
- at System.Windows.Forms.Control.OnClick(EventArgs e)
- at System.Windows.Forms.Button.OnClick(EventArgs e)
- at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
- at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
- at System.Windows.Forms.Control.WndProc(Message& m)
- at System.Windows.Forms.ButtonBase.WndProc(Message& m)
- at System.Windows.Forms.Button.WndProc(Message& m)
- at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
- at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
- at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
- input name="imgReregister" title="Register" class="image" id="imgReregister" type="image" src="../images/next.gif"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement