Jump to content

Recommended Posts

Posted (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 by big_daddy
Posted
Posted

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

Opps How do i edit/ remove it?

  • Moderators
Posted

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.

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...