Does IEWaitForText work?

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
djs
Junior Coder
Posts: 47
Joined: Sun Apr 29, 2012 4:21 pm

Does IEWaitForText work?

Post by djs » Thu Feb 21, 2013 7:43 am

Version 14.0.3

Okay, its late and maybe I'm just thinking this through wrong, but I seem to be having a problem getting IEWaitForText to work correctly, if at all.

Simple test program:

Code: Select all

IECreate>IE[0]
IENavigate>%IE[0]%,http://www.mjtnet.com/,ie_res
IEWaitDocumentComplete>%IE[0]%,ie_res

IEWaitForText>IE[0],,{"Automate business processes"},0,30,res
If>res=1
  MessageModal>Text Found
else
  MessageModal>Text Not Found
**BREAKPOINT**
IEQuit>%IE[0]%,ie_res

Not only does it not find the text, but res, as the result of IEWaitForText isn't set to anything meaning its not even in the watch list.

Also, I would expect the program to pause for up to 30 seconds while waiting for the text, since it doesn't appear to find it, but it doesn't, it just runs right through it. Text is there, it should be found, and if it is, then it doesn't appear to be setting the result correctly.

I have tried adding additional delay after the IEWaitDocumentComplete, but that didn't seem to help either.

Time for me to go back to my code and fix it a different way :)

Dan

User avatar
Djek
Pro Scripter
Posts: 148
Joined: Sat Feb 05, 2005 11:35 pm
Location: Holland
Contact:

Post by Djek » Thu Feb 21, 2013 7:34 pm

hi
you better use IEContainsText

Code: Select all

IECreate>IE[0]
IENavigate>%IE[0]%,http://www.mjtnet.com/,ie_res

IEWaitDocumentComplete>%IE[0]%,ie_res

IEContainsText>IE[0],,Automate business processes,result

If>result=1
  MessageModal>Text Found
else
  MessageModal>Text Not Found
endif

IEQuit>%IE[0]%,ie_res
and do not forget the Endif

hopes this helps
kind regards
Djek

djs
Junior Coder
Posts: 47
Joined: Sun Apr 29, 2012 4:21 pm

Post by djs » Thu Feb 21, 2013 11:29 pm

Thanks for the tip, but unfortunately, IEContainsText and IEWaitforText serve 2 different purposes.

I could loop, wait for the IEContainsText, except I'm trying to sort out when IEContainsText doesn't work, which appears to be on 32bit XP machines with IE8, probably my 2nd most common client machine. I need more testing time.....

Dan

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts