Jump to content

2 IE-s crashing into each other


Recommended Posts

I'm creating a script, which includes IE controlling, and I ran into an obstacle. My problem is, that I'm controlling a web page, which allows to refresh after 1 second, if you don't wait so long, it navigates to another page where it tells, how much faster I refreshed. So, I've completed the script for refreshing and 1 second sleep, but if I want to start another IE with refreshing the same page, they start crashing into each other. For example, with one IE I have just made a click, 500ms goes by and the second IE makes a refresh, one IE gets the "too fast refresh" error. When I use _IECreateEmbedded and GUICtrlCreateObj, not real IE, the error doesn't show. This would be a fix for my problem, but I really need for real IE to do that stuff, so how can I do it? I've tried cookie deleting after every refresh, cache deleting, etc... Any help?

I hope my text isn't too hard to understand, if you can't understand something, just ask for specification.

Link to comment
Share on other sites

I'm creating a script, which includes IE controlling, and I ran into an obstacle. My problem is, that I'm controlling a web page, which allows to refresh after 1 second, if you don't wait so long, it navigates to another page where it tells, how much faster I refreshed. So, I've completed the script for refreshing and 1 second sleep, but if I want to start another IE with refreshing the same page, they start crashing into each other. For example, with one IE I have just made a click, 500ms goes by and the second IE makes a refresh, one IE gets the "too fast refresh" error. When I use _IECreateEmbedded and GUICtrlCreateObj, not real IE, the error doesn't show. This would be a fix for my problem, but I really need for real IE to do that stuff, so how can I do it? I've tried cookie deleting after every refresh, cache deleting, etc... Any help?

I hope my text isn't too hard to understand, if you can't understand something, just ask for specification.

I didn't follow that. Can you post a short reproducer script that demonstrates the problem?

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Sorry, I can't post a reproducer script... :P But I'll try to explain it more clearly:

1. Script opens up a new IE window with _IECreate and navigates to wanted URL with _IENavigate.

2. Script refreshes that IE URL, waits 1 second, then refreshes again... but if it refreshes without waiting 1 second, that site navigates to another site, where it tells me that I refreshed too fast.

3. I open up another IE window and navigate to that URL.

4. When first script has refreshed and waited ~500ms (for example) and second script refreshes that site while the first script hasn't completed its Sleep(), the second site navigates to that site, where it tells me I refreshed too fast.

5. If I replace _IECreate with _IECreateEmbedded and navigate and refresh with 2 scripts, the first script doesn't cause the second script to navigate to that site, where it tells me I refreshed too fast.

6. These two scripts work nicely together when I use _IECreateEmbedded, but not when I use _IECreate.

I need to use _IECreate and have these 2 scripts work nicely together.

Link to comment
Share on other sites

2. Script refreshes that IE URL, waits 1 second, then refreshes again... but if it refreshes without waiting 1 second, that site navigates to another site, where it tells me that I refreshed too fast.

I don't get it... how exactly are you refreshing the pages?

Link to comment
Share on other sites

5. If I replace _IECreate with _IECreateEmbedded and navigate and refresh with 2 scripts, the first script doesn't cause the second script to navigate to that site, where it tells me I refreshed too fast.

This is the part I don't understand. How does the first script "cause" the second one to navigate anywhere at all? Is an interface between the two instances of the script part of your coding?

:P

P.S. Per what Nahuel asked: Are you using the IE object ($oIE) to do the refresh? Each script has its own browser instance and each has its own $oIE. If you fail to use that, and do something silly like ControlSend() an F5 to the window by title, then it gets sent to the one highest in the z-order regardless of which script sent it.

;)

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

_IECreate()
_IENavigate("URL")
While 1
_IEAction("refresh")
Sleep(1000)
WEnd

I run this script. Once I'm on that URL, I can refresh after every 1 second, or else it (that site) sends me to another site because I refreshed too fast. When I run 2 scripts, I script makes a refresh, then second script makes a refresh 500ms after first script and that site will send me to that site, where it tells me I refreshed too fast.

Edited by poisonkiller
Link to comment
Share on other sites

_IECreate()
_IENavigate("URL")
While 1
_IEAction("refresh")
Sleep(1000)
WEnd
Baloney. It wouldn't even compiled coded like that.

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Well... there's not much code for us to see... The site tells you you are refreshing too fast? Maybe because you refresh right after navigating to the site?

_IECreate()
_IENavigate("URL")
While 1
Sleep(1000)
_IEAction("refresh")
WEnd

I don't understand how the crash into eachother :P

Edited by Nahuel
Link to comment
Share on other sites

Okay, I'll try to explain one more time. I manually open up an Internet Explorer (no script) window. I navigate to my site. I click refresh button. I wait 1 second. I press refresh button. Nothing changes. I press refresh. I wait 0.5 seconds. I press refresh. I'm redirected to a site, which says I refreshed in 0.5 seconds, but I can after 1 second. Now I create a script to open IE, navigate, refresh, sleep. I run one script. I wait 0.5 seconds. I run this same script again. Now I have 2 IE windows. First script navigates, starts sleeping. Second script goes to that same site 0.5 seconds later and refreshes. Now the second script is redirected to that site, where it tells me I made my refresh too early. When I use _IECreate to create my IE windows, that site appears. When I use _IECreateEmbedded, that site doesn't apper. I don't know why, I don't know how. I have tried deleting cookies and cache after every refresh (using _IECreate, what I want to use, not _IECreateEmbedded), still, I'm redirected.

Link to comment
Share on other sites

I would guess that the site uses a session cookie to identify your connection. All browser windows sharing the same iexplore.exe share the same session cookie context and so it looks to the site as though the refreshes are comming from the same browser. You need to start a new iexplore.exe to get a new session cookie context.

See this post for a suggested workaround: http://www.autoitscript.com/forum/index.ph...amp;hl=iexplore

Dale

Edit: typos

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

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...