Karthick Posted April 1, 2010 Posted April 1, 2010 (edited) Hi, I am a new bee to Autoit Scripting. I have a intranet website to automate in Mindtree. I have successfully logged in by detecting the objects in login page. But once it comes to main page I have two frames in the frameset. I need to set the value for the testcase id and submit the form but it is not working. please find the attached sample code and give me a solution MainPage HTML SourceCode: TestLink required a frames supporting browser. #include _IEErrorHandlerRegister() ShellExecute("C:\Program Files\Internet Explorer\IEXPLORE.EXE", "about:blank") Sleep(2000) $oIE = _IEAttach("about:blank", "url") Sleep(2000) _IENavigate($oIE, "https://somewhere.com/login.php") _IELoadWait($oIE) $oElement = _IEGetObjByName($oIE, "login") _IEFormElementSetValue($oElement, "****") $oElement = _IEGetObjByName($oIE, "password") _IEFormElementSetValue($oElement, "****") $oElement = _IEGetObjById($oIE, "submit") _IEAction($oElement, "click") _IELoadWait($oIE) $oFrameName = _IEFrameGetObjByName($oIE, "titlebar") $colLinks = _IELinkGetCollection($oFrameName) For $olink In $colLinks $oObjFrame = _IEFrameGetObjByName($olink, "id") Next _IEFormElementSetValue($oObjFrame, "137991") Thanks in advance, Karthick.M Edited April 1, 2010 by big_daddy
BrettF Posted April 1, 2010 Posted April 1, 2010 Welcome to the forums Karthick, It seems you have left personal information in your post. It would be a smart idea to edit that out. Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Karthick Posted April 1, 2010 Author Posted April 1, 2010 Welcome to the forums Karthick,It seems you have left personal information in your post. It would be a smart idea to edit that out.Cheers,BrettOpps How do i edit/ remove it?
Moderators big_daddy Posted April 1, 2010 Moderators Posted April 1, 2010 Opps How do i edit/ remove it?You click the "Edit" button at the bottom of your post.I've modified the code to exclude personal information from your post. You may want to change your password at the very least.
Karthick Posted April 5, 2010 Author Posted April 5, 2010 Hi, I am a new bee to Autoit Scripting. I have a intranet website to automate in Mindtree. I have successfully logged in by detecting the objects in login page. But once it comes to main page I have two frames in the frameset. I need to set the value for the testcase id and submit the form but it is not working. please find the attached sample code and give me a solution MainPage HTML SourceCode: TestLink required a frames supporting browser. #include _IEErrorHandlerRegister() ShellExecute("C:\Program Files\Internet Explorer\IEXPLORE.EXE", "about:blank") Sleep(2000) $oIE = _IEAttach("about:blank", "url") Sleep(2000) _IENavigate($oIE, "https://somewhere.com/login.php") _IELoadWait($oIE) $oElement = _IEGetObjByName($oIE, "login") _IEFormElementSetValue($oElement, "****") $oElement = _IEGetObjByName($oIE, "password") _IEFormElementSetValue($oElement, "****") $oElement = _IEGetObjById($oIE, "submit") _IEAction($oElement, "click") _IELoadWait($oIE) $oFrameName = _IEFrameGetObjByName($oIE, "titlebar") $colLinks = _IELinkGetCollection($oFrameName) For $olink In $colLinks $oObjFrame = _IEFrameGetObjByName($olink, "id") Next _IEFormElementSetValue($oObjFrame, "137991") Thanks in advance, Karthick.M Now I tried this : #include <IE.au3> _IEErrorHandlerRegister() ShellExecute("C:\Program Files\Internet Explorer\IEXPLORE.EXE", "about:blank") Sleep(2000) $oIE = _IEAttach("about:blank", "url") Sleep(2000) _IENavigate($oIE, "https://testmanager.mindtree.com/testlink/login.php") _IELoadWait($oIE) $oElement = _IEGetObjByName($oIE, "login") _IEFormElementSetValue($oElement, "*******") $oElement = _IEGetObjByName($oIE, "password") _IEFormElementSetValue($oElement, "********") $oElement = _IEGetObjById($oIE, "submit") _IEAction($oElement, "click") _IELoadWait($oIE) ;$oElement = _IEFrameGetObjByName($oIE,"titlebar") $oFrames = _IEFrameGetCollection($oIE) $oFrame = _IEFrameGetCollection ($oIE, 0) $oForm = _IEFormElementGetObjByName($oFrame,"id") _IEFormElementSetValue ($oForm, "137991") _IEFormSubmit ($oFrame) Here also I am getting some errors: --> IE.au3 V2.4-0 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidObjectType --> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType --> IE.au3 V2.4-0 Error from function _IEFormSubmit, $_IEStatus_InvalidObjectType
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