Kartikeya Posted November 20, 2018 Posted November 20, 2018 Hi Team, I am new for using AutoIT, Please help me to get second web page form control. I tried below code. Let me know if any details require. Local $i = 0 Do Local $oIE = _IECreate("<my login page URL>") _IELoadWait($oIE) $i = $i + 1 Until $i = 1 Local $oForms = _IEFormGetCollection($oIE) For $oForm In $oForms $oText = _IEFormElementGetObjByName($oForm, "inp_login") _IEFormElementSetValue($oText, "<my ID>") $oText = _IEFormElementGetObjByName($oForm, "inp_pwd") _IEFormElementSetValue($oText, "<my pwd>") Sleep(100) Send("{ENTER}") _IELoadWait($oIE) Sleep(2000) Local $oBody = _IETagNameGetCollection($oIE, "body", 0) ; i think this is not working ; how can we get second page web Element / form Next
Danp2 Posted November 20, 2018 Posted November 20, 2018 No need for all of the looping in your code. Something like the following should work -- Local $oIE = _IECreate("<my login page URL>") Local $oForm = _IEFormGetCollection($oIE, 0) ; adjust value of 2nd parameter as needed $oText = _IEFormElementGetObjByName($oForm, "inp_login") _IEFormElementSetValue($oText, "<my ID>") $oText = _IEFormElementGetObjByName($oForm, "inp_pwd") _IEFormElementSetValue($oText, "<my pwd>") _IEFormSubmit($oForm) _IELoadWait($oIE) 16 minutes ago, Kartikeya said: Local $oBody = _IETagNameGetCollection($oIE, "body", 0) ; i think this is not working ; how can we get second page web Element / form Unclear what you mean here. What are you wanting to accomplish with this code? Latest Webdriver UDF Release Webdriver Wiki FAQs
careca Posted November 20, 2018 Posted November 20, 2018 Im having a similar issue, check out this topic for a solution. Local $oLinks = _IELinkGetCollection($oIE) For $oLink In $oLinks If StringInStr(String($oLink.classname), 'init-download') Then _IEAction($oLink, "click") ExitLoop EndIf Next Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
Kartikeya Posted November 20, 2018 Author Posted November 20, 2018 Hi Danp2, I would like you get form element after submitted first page / form. Thank you
Danp2 Posted November 20, 2018 Posted November 20, 2018 To retrieve the form object, you would use similar code as earlier -- $oForm = _IEFormGetCollection($oIE, 0) Adjust accordingly for your given situation. Latest Webdriver UDF Release Webdriver Wiki FAQs
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