Sign in to follow this  
Followers 0
DrRobert

new to Autoit need help with a comand

5 posts in this topic

#1 ·  Posted (edited)

I've written a script in vbs and now have been told it needs to be in autoit. I have never used autoit untill today.

i have managed to get my web pages username and password in. but cant get it to click.

bellow is my vbscript

Dim IE
Set IE = CreateObject("InternetExplorer.Application")
Set WshShell = Wscript.CreateObject("Wscript.Shell")
IE.Visible = 3
IE.FullScreen = True
IE.navigate "[url=https://xxxxxxxxxxxxx]https://xxxxxxxxxxxxx"[/url]
Do While (IE.Busy)
    WScript.Sleep 10
Loop
Set Helem = IE.document.getElementByID("UserName")
Helem.Value = ""
Set Helem = IE.document.getElementByID("Password")
Helem.Value = ""
'set Helem = IE.document.getElementByID("LogIn")
set objForms = IE.document.getElementsByTagName("form")
set objForm = objForms(0)
for each objField in objForm
      if (objField.type = "submit") then
       objField.Click
   end if
next
my autoit script looks like this

#include <IE.au3>

$oIE = _IECreate("url")
$oForm = _IEFormGetObjByName($oIE, 0)
Local $oQuery = _IEFormElementGetObjByName($oForm, "UserName")
_IEFormElementSetValue($oQuery, "username")
Local $oQuery1 = _IEFormElementGetObjByName($oForm, "Password")
_IEFormElementSetValue($oQuery1, "password")
 
so i am missing the
 
set objForms = IE.document.getElementsByTagName("form")
set objForm = objForms(0)
for each objField in objForm
      if (objField.type = "submit") then
       objField.Click
   end if
next
any help will deserve a n internet beer Edited by Melba23
Addedcode tags

Share this post


Link to post
Share on other sites



Hello and welcome to the forums, please edit your post and click the blue icon and paste your code in between, it helps us read your code better

Share this post


Link to post
Share on other sites

For some time, web browsers were quite the fad in the forums.

A search for them should get you a fully functional browser script.

Go for it!! (& return with any questions).

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

just let follow up this, i fixed it. i realised how close to vbscript autoit commands can be. so imanaged to get my click/submit command sorted :thumbsup:

$oFormElements = _IEFormElementGetCollection ( $oForm )
        
For $oFormElement In $oFormElements
            
If $oFormElement.type = 'submit' Then
                 
_IEAction ($oFormElement, "click")
            
EndIf
         

Next
Edited by DrRobert

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0