Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 如何使用VB在网页中单击按钮?_Vb.net_Gwt_Vbscript - Fatal编程技术网

Vb.net 如何使用VB在网页中单击按钮?

Vb.net 如何使用VB在网页中单击按钮?,vb.net,gwt,vbscript,Vb.net,Gwt,Vbscript,我正在创建一个VB脚本,单击网页上的按钮。我见过一些答案,比如他们在哪里提交表格。我不想这样做,因为我需要用脚本单击按钮,以便使用单击按钮的常规工作流 顺便说一句,我使用的是GWT和SmartClient,这使得ID变得模糊时变得更复杂。为了克服这个问题,我正在使用GWT DEBUG_ID_PREFIX,如果您提供了一个GWT按钮示例,以帮助像我这样不熟悉GWT的人,那就太好了。我找到了一个包含GWT按钮(希望)的页面,并基于此编写了一些东西。考虑下面的代码。 Sub WaitUntil(var

我正在创建一个VB脚本,单击网页上的按钮。我见过一些答案,比如他们在哪里提交表格。我不想这样做,因为我需要用脚本单击按钮,以便使用单击按钮的常规工作流


顺便说一句,我使用的是GWT和SmartClient,这使得ID变得模糊时变得更复杂。为了克服这个问题,我正在使用GWT DEBUG_ID_PREFIX

,如果您提供了一个GWT按钮示例,以帮助像我这样不熟悉GWT的人,那就太好了。我找到了一个包含GWT按钮(希望)的页面,并基于此编写了一些东西。
考虑下面的代码。
Sub WaitUntil(varObj)
    On Error Resume Next
    Do
        WScript.Sleep 100
    Loop Until Not varObj Is Nothing
    WScript.Sleep 500
End Sub

Dim IE
Set IE = CreateObject("InternetExplorer.Application")
    IE.Visible = True
    IE.Navigate "http://gwt.google.com/samples/Showcase/Showcase.html#!CwBasicButton"
    WScript.Sleep 500
    WaitUntil IE.Document 'wait until the document is ready
    WaitUntil IE.Document.getElementById("gwt-debug-cwBasicButton-normal") 'wait until the button is initialized
    Dim theButton
    Set theButton = IE.Document.getElementById("gwt-debug-cwBasicButton-normal")
        theButton.Click
        'theButton.fireEvent "onclick" 'another way
Set IE = Nothing