Code: Select all
Run chrome.exe "https://accudata.myisolved.com/UserLogin.aspx?ReturnUrl"
Send,%user_name%
Send {Enter}
SendInput,%pass_word%
Send {Enter}
Code: Select all
Run chrome.exe "https://accudata.myisolved.com/UserLogin.aspx?ReturnUrl"
Send,%user_name%
Send {Enter}
SendInput,%pass_word%
Send {Enter}
Code: Select all
#include <chrome.ahk>
IfNotExist, C:\Temp\ChromeProfile
FileCreateDir, C:\Temp\ChromeProfile
global PageInst := "", ChromeInst := new Chrome("C:\AHK\ChromeProfile") ;decalare SuperGlobals (available in ALL scopes)
;************************************************************************* Navigate to the destination *************************************************************************
if !(PageInst := ChromeInst.GetPage())
{
MsgBox, Could not retrieve page!
ChromeInst.Kill()
}
else
{
; --- Navigate to the desired URL ---
PageInst.WaitForLoad()
PageInst.Call("Page.navigate", {"url": "https://accudata.myisolved.com/UserLogin.aspx?ReturnUrl"})
PageInst.WaitForLoad()
;use this if you want to test/confirm what URL the page is currently on
Test = document.URL
Result := PageInst.Evaluate(Test)
URL := Result.value ;URL is now the current address
SetValue("id_username", "User_name") ;this function targets a field by its ID tag
SetValue("id_password", "Pass_word")
TestClause = document.getElementsByClassName("grp-button grp-default").item(0).click() ;Here you will need to do some research and figure out how to target the button used to login this is an example from a site I use
PageInst.Evaluate(TestClause)
;************************************************************************* AutoFill *************************************************************************
PageInst.WaitForLoad()
SetValue("id_part_number", PartNumber) ;example of setting a value using a var
SetValue("id_description", "elbow fitting") ;example of setting a value using a string
return
SetValue(IDin, ValueIn) ;function used as a wrapper for setting values within the form
{
;function takes in the name of an element ID and a value to set it to then returns the result
;after sending to chrome.ahk's Evaluate method.
TestClause = document.getElementById("%IDin%").value = '%ValueIn%';
Result := PageInst.Evaluate(TestClause)
return Result
}