Jump to content

_IECreate opens 2 instances


jnj
 Share

Recommended Posts

Hi all,

I'm having a big problem trying to run a simple login in a website.

This is a pretty basic procedure but by using _IECreate it opens two instances of browsers (1 remains blank all the time). I have checked the remarks on help funcion file that's very allright for Vista but I'm using WinXP with IE7.

I would love to stick to _IE functions instead of using ShellExecute, WinWaitActive and so on.

Any help on that would be very much appreciated.

Code sample

#include <IE.au3>

$user = "user"

$pass = "pass"

$url = "https://login.yahoo.com/config/login_verify2?.intl=uk&.src=ym"

$oIE = _IECreate ($url)

_IELoadWait ($oIE)

$uForm = _IEFormGetObjByName ($oIE, "loginform")

$uText = _IEFormElementGetObjByName ($uForm, "login")

_IEFormElementSetValue ($uText,$user);

$pText = _IEFormElementGetObjByName ($uForm, "password")

_IEFormElementSetValue ($pText,$pass)

_IEFormSubmit ($uForm)

Link to comment
Share on other sites

I had to fix some typos in your code before I could run it. Needless to say, I cannot reproduce your trouble.

Please describe your symptoms more specifically because if this is not a Vista system, they will not be identical to what has been seen before.

Also, try your code on another similarly configured machine.

Dale

#include <IE.au3>

$user = "user"
$pass = "pass"
$url = "https://login.yahoo.com/config/login_verify2?.intl=uk&.src=ym"
$oIE = _IECreate ($url)
_IELoadWait ($oIE)

$uForm = _IEFormGetObjByName ($oIE, "login_form")
$uText = _IEFormElementGetObjByName ($uForm, "login")
_IEFormElementSetValue ($uText,$user)

$pText = _IEFormElementGetObjByName ($uForm, "passwd")
_IEFormElementSetValue ($pText,$pass)
_IEFormSubmit ($uForm)
Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

I had to fix some typos in your code before I could run it. Needless to say, I cannot reproduce your trouble.

Please describe your symptoms more specifically because if this is not a Vista system, they will not be identical to what has been seen before.

Also, try your code on another similarly configured machine.

Dale

#include <IE.au3>

$user = "user"
$pass = "pass"
$url = "https://login.yahoo.com/config/login_verify2?.intl=uk&.src=ym"
$oIE = _IECreate ($url)
_IELoadWait ($oIE)

$uForm = _IEFormGetObjByName ($oIE, "login_form")
$uText = _IEFormElementGetObjByName ($uForm, "login")
_IEFormElementSetValue ($uText,$user)

$pText = _IEFormElementGetObjByName ($uForm, "passwd")
_IEFormElementSetValue ($pText,$pass)
_IEFormSubmit ($uForm)

Hi Dale,

Many thanks for your reply.

The piece of code was just to illustrate roughly what I have. Now, because I was using the company laptop I had security policies applied, once I removed it the application could run fine.

Once more, many thanks for your attention on that.

J

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

  • Recently Browsing   0 members

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