VaishnaviBUtpat Posted July 27, 2017 Share Posted July 27, 2017 Hi all, I am working on Automation of Web-UI using Web-Layout. But I am facing difficulties to handle multiple Web Pages. I have Automated two pages but on the third page I am unable to capture the URL of the current page which made me unable to capture form element and that is why the HTML element cannot be focused for the actions. Can anybody help to automate multiple web pages using AutoIT. Spoiler Link to comment Share on other sites More sharing options...
Danp2 Posted July 27, 2017 Share Posted July 27, 2017 You'll need to supply more information. Post your code and explain in detail what isn't working as you would expect. VaishnaviBUtpat 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
jdelaney Posted July 27, 2017 Share Posted July 27, 2017 How about: $aIEHandles = ProcessList("iexplore.exe") For $i = 1 To UBound($aIEHandles)-1 $oIE = _IEAttach("","instance",$i) $sURL = _IEPropertyGet($oIE,"locationurl") If $sURL Then ConsoleWrite($sURL & @CRLF) EndIf Next IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
VaishnaviBUtpat Posted August 1, 2017 Author Share Posted August 1, 2017 Below is the code I am using to Automate the SAP CRM Web UI Application. It is working fine up to second page i.e. selection of business role After the selection of business role the next window appears, on that window I have to perform some operations But the code is unable to find out the URL which made me unable to capture form element and that is why the HTML element cannot be focused for the actions. expandcollapse popup#include <IE.au3> #include <MsgBoxConstants.au3> #include <string.au3> #include <File.au3> #include <MsgBoxConstants.au3> #include <FileConstants.au3> #include <WinAPIFiles.au3> #include <Misc.au3> #include <AutoItConstants.au3> #include <Date.au3> #include<Inet.au3> #include <Inet.au3> Local $oIE = _IECreate("URL USED For WEB UI Browser",1,1,1,1) Sleep(2000) WinWaitActive ("Logon - Internet Explorer") Sleep (3000) $file1 = " Local Path of the file containing Log-in credentials" ;~ $file1 = @WorkingDir & "\ISU-NUB.csv" FileOpen($file1, 0) For $f = 1 to _FileCountLines($file1) $line1 = FileReadLine($file1, $f) Send($line1) Send ("{Tab}") Next Sleep(200) Local $oSubmit = _IEGetObjByName($oIE, "LOGON_BUTTON") _IEAction($oSubmit, "click") WinWaitActive("Select a business role: - [SAP] - Internet Explorer") Sleep (2000) _IELinkClickByText($oIE, "Name of the WEB UI business role") WinWaitActive("Inbox - [SAP] - Internet Explorer") ""-> Inbox is the work center/navigation bar on the CRM WEB UI application where we need to perform action on HTML elements like drop box or link $OIE = _IEAttach($oIE,"URL for WEB UI Browser after we select business role") Local $oForm = _IEFormGetObjByName($oIE, "crmUIHostDialogContainerForm") ; $select= _IEFormElementGetObjByName($oform,"Sales Cycle") _IEAction($select, "click") Link to comment Share on other sites More sharing options...
Danp2 Posted August 1, 2017 Share Posted August 1, 2017 Thanks for the additional details. However, I'm still a little confused on the process involved. Are you attempting to interact with a single tab in the browser or multiple tabs? It appears that you are working with a single tab, so I'll base my suggestions on that assumption -- Using WinWaitActive in conjunction with the _IE functions is atypical. Same with Send. There are _IE functions that are more reliable to accomplish the task. Once you have a reference to the IE tab, it's generally good throughout the script. Can you explain why you need to use _IEAttach near the script bottom? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
VaishnaviBUtpat Posted August 2, 2017 Author Share Posted August 2, 2017 To capture URL of the current page I have used the command _IEAttach. But its not working...!!! Link to comment Share on other sites More sharing options...
Danp2 Posted August 2, 2017 Share Posted August 2, 2017 23 hours ago, Danp2 said: Once you have a reference to the IE tab, it's generally good throughout the script. Can you explain why you need to use _IEAttach near the script bottom? 5 hours ago, VaishnaviBUtpat said: To capture URL of the current page I have used the command _IEAttach. Why? Please explain in detail why you can't use something like _IEPropertyGet($oIE, 'locationurl') with the existing $oIE object. Latest Webdriver UDF Release Webdriver Wiki FAQs 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