can i manipulate web control as vb6 ?
Webview.Document.GetElementByID("txtname").value = "nameuser"
Webview.Document.GetElementByID("txtpass").value = "pass"
This work for me thanks very much
i Try this,I attach a very early wrap of webengine and a large part of org.w3c.dom.html Documentation can be found here: https://docs.oracle.com/javase/9/docs/api/org/w3c/dom/html/package-summary.html
java.lang.RuntimeException: Object should first be initialized (JavaObject).
mDocument.GetElementById("vistaLogin:frmLogin:txtNit").SetAttribute("value","900755449")
Private Sub LoadProgress_Event (NewState As String)
If NewState = "SUCCEEDED" Then
Log("Page LOADED")
mDocument = WebE.GetDocument
' Dim Div As Element = mDocument.CreateElement("div")
' mDocument.AsHTMLDocument.GetBody.AsHTMLNode.AppendChild(Div)
' Dim Txt As HTMLText = mDocument.CreateTextNode("Test")
' Div.AsHTMLNode.AppendChild(Txt)
' Dim Txt As HTMLText = mDocument.CreateTextNode(" Test2")
' Div.AsHTMLNode.AppendChild(Txt)
mDocument.GetElementById("vistaLogin:frmLogin:txtNit").SetAttribute("value","900755449")
End If
End Sub
Waiting for debugger to connect...
Program started.
SCHEDULED
RUNNING
SUCCEEDED
SCHEDULED
RUNNING
SUCCEEDED
Sub Button1_Click
mDocument = WebE.GetDocument
mDocument.GetElementById("vistaLogin:frmLogin:txtNit").SetAttribute("value","900755449")
End Sub
Dim joWV As JavaObject = WebView1
joWV.RunMethodJO("getEngine", Null).RunMethod("executeScript",Array As String("document.getElementById('vistaLogin:frmLogin:txtNit').value='900755449'"))
wow this is great, i solve using webview_pagefinished .Last update for today, the LoadProgress_Event tries to determine if the page is being redirected and waits for the redirected page before continuing (for 1 redirection only)
Updated to post 3
Elemento = mDocument.GetElementById("vistaLogin:frmLogin:_id18")
If Elemento.IsInitialized Then Elemento.AsHTMLInputElement.Click
'Returns the Node As an HTMLInputElement Object
Public Sub AsHTMLInputElement As HTMLInputElement
Dim E As HTMLInputElement
E.Initialize
E.SetObject(TJO)
Return E
End Sub
Dim Elemento As HTMLNode = mDocument.AsHTMLDocument.GetElementsByName("vistaLogin:frmLogin:_id18").Item(0)
If Elemento.IsInitialized Then Elemento.AsHTMLInputElement.Click