I am trying to use the ContainsText function to see wether a web page has fully loaded.
If %TagValue% is found, the page is complete.
The problem is that even with a Wait statement, the fuction keeps crashing with the following error message:
Access violation at address xxxxxxxx in module 'IEAuto.dll'. Read of adress 00000000.
When I extend the wait cycles to about 5 it is better, but keeps crashing sooner or later.
It happens with Windows Vista, Windows XP, IE 6 and IE 7.
Any suggestions?
This is the code:
Repeat>%Loop%
Wait>1
IE_ContainsText>%IE[0]%,,%TagValue%,Loop
Until>%Loop%0
IE ContainsText function crashing scheduler
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
I am unable to reproduce any errors with IE_ContainsText. Are you sure you have the correct IE handle IE[0]? What is the value of TagValue?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
I tried something new. If I set a breakpoint and continue the script after it stopped, there is no crash. If I remove the breakpoint, the script crashes!
IE_ClickTag>%IE[0]%,,,IMG,HREF,button.gif,r
IE_Wait>%IE[0]%,r
**BREAKPOINT**
Repeat>%Loop%
Wait>1
IE_ContainsText>%IE[0]%,,sometext,Loop
Until>%Loop%0
IE_ClickTag>%IE[0]%,,,IMG,HREF,button.gif,r
IE_Wait>%IE[0]%,r
**BREAKPOINT**
Repeat>%Loop%
Wait>1
IE_ContainsText>%IE[0]%,,sometext,Loop
Until>%Loop%0
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Odd. Try a longer delay before IE_ContainsText.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
I need a way to continue the script right after the page is fully loaded and displayed.
Neither the IE_Wait nor the IE_ContainsText functions does the trick. I cannot accept to have a wait time up to about 10 seconds to be sure that the page is fully loaded. The script should go FAST through the different pages.
Even with a wait time of about 10 seconds there was a minor chance that the script crashed.
I also do not understand why the IE_ContainsText function must crash when the page is not fully loaded.
Neither the IE_Wait nor the IE_ContainsText functions does the trick. I cannot accept to have a wait time up to about 10 seconds to be sure that the page is fully loaded. The script should go FAST through the different pages.
Even with a wait time of about 10 seconds there was a minor chance that the script crashed.
I also do not understand why the IE_ContainsText function must crash when the page is not fully loaded.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Nor do I. It doesn't for me in my testing. I've used it on a number of sites and never had a crash. Are you able to give me the URL of the page that causes the crash in your case? If we can replicate we can usually fix.
IE_Wait is needed to ensure the page has loaded before you try to do anything with it. But agree - there should be no need for a specific 10 seconds additional wait.
IE_Wait is needed to ensure the page has loaded before you try to do anything with it. But agree - there should be no need for a specific 10 seconds additional wait.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Well it shouldn't crash. But if the page isn't fully loaded it won't do anything either. Until the document object is created there's nothing to query. Can you use an application that hasn't fully created it's UI yet?I also do not understand why the IE_ContainsText function must crash when the page is not fully loaded.
You MUST wait for a page to load before you can do anything with it.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?