Jump to content

Multiple Tab and Login in IE


Recommended Posts

I am trying to script the opening of multiple tabs in IE with each tab having a separate login/password. I have been able to make a successful script that will open 3 separate IE sessions with the correct webpage and login or a script that will open 3 tabs in one session (which I want) but will not login. I have tried _IECreate, IEAttach etc. This is the script I am currently using . 

#include <IE.au3>
Const $navOpenInNewTab = 0x0800

Dim $oIE = _IECreate('http://asag.xxxxxxx.com/AAAA/index.htm')

;$o_IE.Navigate2('http://asag.xxxxxxx.com/apps/yyyyyyy/LogInSAG/login.asp', $navOpenInNewTab)

;$o_IE.Navigate2('http://asag.xxxxxxx.com/apps/yyyyyyy/LogInSAG/login.asp', $navOpenInNewTab)

Call ("YYYYYYYSignIn")

Func YYYYYYYSignIn ()

    Local $username = _IEGetObjByName ($oIE,"uname")
    Local $password = _IEGetObjByName ($oIE,"pword")

    $oIE.Navigate2('http://asag.xxxxxxx.com/apps/xxxxxxx/LogInSAG/login.asp',2048)

_IEFormElementSetValue ($username, "xxxxxxx")
    _IEFormElementSetValue ($password, "xxxxxxx")

    Send('{Enter}')

EndFunc


Call ("xxxxxxxSignIn")

Func xxxxxxxSignIn ()

__IENavigate($oIE, "https://soa1gui.xxxxxxx.biz/gateway/NFServlet;jsessionid=1E3B8F6520DE0A1EC914A8ABB7E86341?NFH_MessageId=&NFH_Page=%2fpages%2fsearch%2fsearch.jsp", 1, 0x800)


    Local $domain = _IEGetObjByName ($oIE,"NF_CustomerID")
    Local $User_Name = _IEGetObjByName ($oIE,"NF_UserName")
    Local $Password = _IEGetObjByName ($oIE,"NF_Password")

    _IEFormElementSetValue ($domain, xxxxxxx")
    _IEFormElementSetValue ($User_Name, "xxxxxxx")
    _IEFormElementSetValue ($Password, "xxxxxxx")

    ;Send('{Enter}')

    EndFunc

 

Edited by kawliga751
Link to comment
Share on other sites

You didn't tell us where your script is failing, so it's difficult to know how to help. If I were writing this, it would go something like this --

#include <IE.au3>
Const $navOpenInNewTab = 0x0800

Local $oIE, $oIE2, $oIE3

$oIE = _IECreate('http://asag.xxxxxxx.com/AAAA/index.htm')
$oIE.Navigate2('http://asag.xxxxxxx.com/apps/xxxxxxx/LogInSAG/login.asp', $navOpenInNewTab)
$oIE.Navigate2('https://soa1gui.xxxxxxx.biz/gateway/NFServlet;jsessionid=1E3B8F6520DE0A1EC914A8ABB7E86341?NFH_MessageId=&NFH_Page=%2fpages%2fsearch%2fsearch.jsp', $navOpenInNewTab)

$oIE2 = _IEAttach("http://asag.xxxxxxx.com/apps/xxxxxxx/LogInSAG/login.asp", "URL")
$oIE3 = _IEAttach("'https://soa1gui.xxxxxxx.biz/gateway", "URL")

LoginSite1()
LoginSite2()
LoginSite3()


Function LoginSite1()
    Local $username = _IEGetObjByName ($oIE,"uname")
    Local $password = _IEGetObjByName ($oIE,"pword")

    _IEFormElementSetValue ($username, "xxxxxxx")
    _IEFormElementSetValue ($password, "xxxxxxx")

    ; Need form object here
    _IEFormSubmit()
EndFunc

Function LoginSite2()
    Local $domain = _IEGetObjByName ($oIE2,"NF_CustomerID")
    Local $User_Name = _IEGetObjByName ($oIE2,"NF_UserName")
    Local $Password = _IEGetObjByName ($oIE2,"NF_Password")

    _IEFormElementSetValue ($domain, xxxxxxx")
    _IEFormElementSetValue ($User_Name, "xxxxxxx")
    _IEFormElementSetValue ($Password, "xxxxxxx")

    ; Need form object here
    _IEFormSubmit()
EndFunc

Function LoginSite3()
    ; Site 3 code goes here using $oIE3
    
    ; Need form object here
    _IEFormSubmit()
EndFunc

 

Link to comment
Share on other sites

d'oh...so I think I got that, they do all open but still not able to login on either tab

Here's what I've got now:


 

#include <IE.au3>
Const $navOpenInNewTab = 0x0800

Local $oIE, $oIE2, $oIE3

$oIE = _IECreate('http://asag.xxxxx.com/ASAG/index.htm')
$oIE.Navigate2('http://asag.xxxxx.com/apps/xxxxx/LogInSAG/login.asp', $navOpenInNewTab)
$oIE.Navigate2('https://soa1gui.xxxxx.biz/gateway/NFServlet;jsessionid=1E3B8F6520DE0A1EC914A8ABB7E86341?NFH_MessageId=&NFH_Page=%2fpages%2fsearch%2fsearch.jsp', $navOpenInNewTab)

$oIE2 = _IEAttach("http://asag.xxxxx.com/apps/xxxxx/LogInSAG/login.asp", "URL")
$oIE3 = _IEAttach("'https://soa1gui.xxxxx.biz/gateway", "URL")

;LoginSite1()
;LoginSite2()
;LoginSite3()


Func LoginSite1()
    Local $username = _IEGetObjByName ($oIE,"uname")
    Local $password = _IEGetObjByName ($oIE,"pword")

    _IEFormElementSetValue ($username, "xxxxx")
    _IEFormElementSetValue ($password, "xxxxx")

    ; Need form object here
    _IEFormSubmit($oIE2)
EndFunc

Func LoginSite2()
    Local $domain = _IEGetObjByName ($oIE2,"NF_CustomerID")
    Local $User_Name = _IEGetObjByName ($oIE2,"NF_UserName")
    Local $Password = _IEGetObjByName ($oIE2,"NF_Password")

    _IEFormElementSetValue ($domain, xxxxx")
    _IEFormElementSetValue ($User_Name, "xxxxx")
    _IEFormElementSetValue ($Password, "xxxxx")

    ; Need form object here
    _IEFormSubmit($oIE3)
EndFunc

 

Edited by kawliga751
Link to comment
Share on other sites

Thanks again but I'm obviously still missing something....this still opens each tab but doesn't login.  

#include <IE.au3>
Const $navOpenInNewTab = 0x0800

Local $oIE, $oIE2, $oIE3

$oIE = _IECreate('http://asag.xxxxx.com/ASAG/index.htm')
$oIE.Navigate2('http://asag.xxxxx.com/apps/xxxxx/LogInSAG/login.asp', $navOpenInNewTab)
$oIE.Navigate2('https://soa1gui.xxxxx.biz/gateway/NFServlet;jsessionid=1E3B8F6520DE0A1EC914A8ABB7E86341?NFH_MessageId=&NFH_Page=%2fpages%2fsearch%2fsearch.jsp', $navOpenInNewTab)

$oIE2 = _IEAttach("http://asag.xxxxx.com/apps/xxxxx/LogInSAG/login.asp", "URL")
$oIE3 = _IEAttach("'https://soa1gui.xxxxx.biz/gateway", "URL")

;LoginSite1()
;LoginSite2()
;LoginSite3()


Func LoginSite1()
    Local $username = _IEGetObjByName ($oIE,"uname")
    Local $password = _IEGetObjByName ($oIE,"pword")

    _IEFormElementSetValue ($username, "xxxxx")
    _IEFormElementSetValue ($password, "xxxxx")

    ; Need form object here
   Local $oForm = _IEFormGetCollection($oIE, 0)
    _IEFormSubmit($oForm)
EndFunc

Func LoginSite2()
    Local $domain = _IEGetObjByName ($oIE2,"NF_CustomerID")
    Local $User_Name = _IEGetObjByName ($oIE2,"NF_UserName")
    Local $Password = _IEGetObjByName ($oIE2,"NF_Password")

    _IEFormElementSetValue ($domain, xxxxx")
    _IEFormElementSetValue ($User_Name, "xxxxx")
    _IEFormElementSetValue ($Password, "xxxxx")

    ; Need form object here
    Local $oForm = _IEFormGetCollection($oIE, 0)
    _IEFormSubmit($oForm)
EndFunc

 

Link to comment
Share on other sites

I m

Func LoginSite1()
    Local $username = _IEGetObjByName ($oIE2,"uname")
    Local $password = _IEGetObjByName ($oIE2,"pword")

    _IEFormElementSetValue ($username, "xxxxxxx")
    _IEFormElementSetValue ($password, "xxxxxxx")

    ; Need form object here
    ;_IEFormSubmit($oIE2)

    Local $oForm = _IEFormGetCollection($oIE2, 0)
    _IEFormSubmit($oForm)

EndFunc

Func LoginSite2()
    Local $domain = _IEGetObjByName ($oIE3,"NF_CustomerID")
    Local $User_Name = _IEGetObjByName ($oIE3,"NF_UserName")
    Local $Password = _IEGetObjByName ($oIE3,"NF_Password")

    _IEFormElementSetValue ($domain, "yyyyyy")
    _IEFormElementSetValue ($User_Name, "yyyyyy")
    _IEFormElementSetValue ($Password, "yyyyyy")

    ; Need form object here
    ;_IEFormSubmit($oIE3)

    Local $oForm = _IEFormGetCollection($oIE3, 0)
    _IEFormSubmit($oForm)

EndFunc

eant to mention that I had tried that.....same issue.....this is my revied script with the $oIE2 & $oIE3

Link to comment
Share on other sites

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
 Share

×
×
  • Create New...