Hello
I am a bit new to AutoIT coding and need some help on creating an application that would log in to our customer portal and upload a data table with order status.
I am having trouble with auto login part and upload button push. I can get the IE window to open with no issues, the user and password is filled, but then i can not get the submit button to click. I tried getting it by Name or Id, I tried Send ("{ENTER}") command. But I still can not make the button click. I do not wnat to use the Mouse click option , because the window is different sizes on different computers this is intended for.
#include<IE.au3>
Call ("SignIn")
Func SignIn()
Global $oIE=_IECreate("https://Cutomer Portal")
Local $username=_IEGetObjByName($oIE,"j_username")
Local $password=_IEGetObjByName($oIE,"j_password")
Local $button=_IEFrameGetObjByName($oIE, "j_submit")
_IEFormElementSetValue($username,"Myusername")
_IEFormElementSetValue($password,"Mypassword")
_IEAction($button,"click")
EndFunc
I have tried using Chrome and WD driver for it as well. Unfortunately the Graphical Debugger does not seems to like the driver and every time I try to run it it gets stuck in some loop constantly jumping between WinHTTP and wd_core files.
When I tried running the following code from wd_demo modified to my page. I get the same picture. User and password are entered correctly, but the submit button is not clicked. I suspect it is because there is no command to do that, but the Chrome driver does not have help file that shows the commands and their syntax. Wikipage is somewhat helpful it has the comments with options, but no clear syntax. I made a new function ChromeActionclickbyId, but I may have screwed up somewhere and it does not work as it should.
#include "wd_core.au3"
#include "wd_helper.au3"
Local $sDesiredCapabilities, $sSession
SetupChrome()
_WD_Startup()
$sSession = _WD_CreateSession($sDesiredCapabilities)
_WD_Navigate($sSession, "https://Customer Portal")
<snip>
_ChromeActionclickbyId($sSession,'j_submit')
_WD_Shutdown()
Func SetupChrome()
_WD_Option('Driver', 'chromedriver.exe')
_WD_Option('Port', 9515)
_WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"')
$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true, "args":[' & """start-maximized""," & " ""disable-infobars""" & "" & '] }}}}'
EndFunc ;==>SetupChrome
Func _ChromeSetInputValueById($sSession,$Id,$Value)
$sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='"&$Id&"']")
_WD_ElementAction($sSession,$sButton,'value', $Value)
EndFunc
Func _ChromeActionclickbyId($sSession,$Id)
$sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='"&$Id&"']")
_WD_ElementAction($sSession,$sButton,'click')
EndFunc