Mr_Clean Posted November 14, 2018 Share Posted November 14, 2018 I'm trying to automate the internet explorer page below to type in the Installation ID and License Number, as well as check the box and generate the unlock code. The issue I'm running into is that the page doesn't let me tab around it, and I can't find a way to select anything on the page. #include <IE.au3> ;Local $oIE = _IE_Example("form") Local $oIE = ShellExecute('https://www.internetactivation.com/ECOSYSTEM/ActivationServer/tiactivate/default.aspx') ;Sleep(2000) WinWaitActive('Activate - Internet Explorer') $oSubmit = _IEGetObjByName($oIE, 'activatebutton') ;WinWaitActive('Activate - Internet Explorer') _IEAction($oSubmit, "click") _IELoadWait($oIE) This is the code I've been playing around with to try and select the generate button and tab back to the text boxes, but I can't get it to work and it doesn't seem to be the best way to solve the problem. Any ideas? I'm very new to AudoIT still so please elaborate in technical details if you could! Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted November 14, 2018 Share Posted November 14, 2018 1 hour ago, Mr_Clean said: Local $oIE = ShellExecute('https://www.internetactivation.com/ECOSYSTEM/ActivationServer/tiactivate/default.aspx') Change this into this Local $oIE = _IECreate('https://www.internetactivation.com/ECOSYSTEM/ActivationServer/tiactivate/default.aspx') And you don't need this 1 hour ago, Mr_Clean said: WinWaitActive('Activate - Internet Explorer') Add a little bit of error checking to know if some function does return an error, and you're done Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Danp2 Posted November 14, 2018 Share Posted November 14, 2018 Use _IEFormGetObjByName, _IEFormElementGetObjByName, and _IEFormElementSetValue to set the value of the input elements. You can use _IEFormElementCheckBoxSelect for the checkbox. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Mr_Clean Posted November 14, 2018 Author Share Posted November 14, 2018 3 hours ago, FrancescoDiMuro said: Change this into this Local $oIE = _IECreate('https://www.internetactivation.com/ECOSYSTEM/ActivationServer/tiactivate/default.aspx') And you don't need this Add a little bit of error checking to know if some function does return an error, and you're done Thanks that works! Link to comment Share on other sites More sharing options...
Mr_Clean Posted November 14, 2018 Author Share Posted November 14, 2018 3 hours ago, Danp2 said: Use _IEFormGetObjByName, _IEFormElementGetObjByName, and _IEFormElementSetValue to set the value of the input elements. You can use _IEFormElementCheckBoxSelect for the checkbox. Ok so this is what I have right now... #include <IE.au3> Local $oIE = _IECreate('https://www.internetactivation.com/ECOSYSTEM/ActivationServer/tiactivate/default.aspx') Local $oForm = _IEFormGetObjByName($oIE, 'sitecode') Local $oQuery = _IEFormElementGetObjByName($oForm, ' form1') _IEFormElementSetValue($oQuery, '0000000001') _IEFormSubmit($oForm) I don't yet have it working because I'm struggling to find the correct $sName for _IEFormGetObjByName and _IEFormElementGetObjByName. Any pointers? Link to comment Share on other sites More sharing options...
Danp2 Posted November 14, 2018 Share Posted November 14, 2018 The form element has a name of 'form1', so you'll want to use that with the _IEFormGetObjByName. The form elements are named 'sitecode' and 'serial', so you'll use those with _IEFormElementGetObjByName. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Arm_And_Hammer Posted November 20, 2018 Share Posted November 20, 2018 On 11/14/2018 at 9:19 AM, Mr_Clean said: I'm very new to AudoIT Clearly. And it's AutoIT, by the way. You obviously haven't read any of the help files regarding _IECreate... here, read this: https://www.autoitscript.com/autoit3/docs/libfunctions/_IECreate.htm Link to comment Share on other sites More sharing options...
faustf Posted November 20, 2018 Share Posted November 20, 2018 remember when you post a code use a tag <> i do somthing , but of course is not perfect but is good base expandcollapse popup#include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> #include <File.au3> #include <IE.au3> #include <Array.au3> #include <INet.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include <WinAPIRes.au3> #include <Misc.au3> #include <Date.au3> #include <Excel.au3> #include <Crypt.au3> #include <Misc.au3> Global $oIE, $Hide = 1, $user = "jfkshkhsdkghkshg", $pass = "75947579573" $oIE = _IECreate("https://www.internetactivation.com/ECOSYSTEM/ActivationServer/tiactivate/default.aspx", 0, $Hide, 1, 1) ; <--- 0011 invisible explorer <--- 0111 visible explorer _IELoadWait($oIE) Local $oBtns = $oIE.document.GetElementsByTagName("input") For $oBtn In $oBtns $name = String($oBtn.id()) ;$placehold = String($oBtn.classname()) If $name = "sitecode" Then _IEAction($oBtn, "click") _IEFormElementSetValue($oBtn, $user) EndIf If $name = "serial" Then _IEAction($oBtn, "click") _IEFormElementSetValue($oBtn, $pass) EndIf If $name = "activatebutton" Then _IEAction($oBtn, "click") ;_IEFormElementSetValue($oBtn, $user) EndIf Next Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now