Find in IE8

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
ccris
Newbie
Posts: 19
Joined: Fri Aug 27, 2010 1:53 pm

Find in IE8

Post by ccris » Fri Aug 27, 2010 2:07 pm

Hello,

Although not technically a "beginner", since I can not figure this one out on my own, I guess I am a "beginner".

Internet Explorer 7 and below uses a Search Box for the FIND function. My application needs to "search" and either "find" or "not find" certain text. I my Macro Scheduler script, if string is "not found", a Window opens ("Windows Internet Explorer" with text: "text not found"). If string if found, no window opens. Instead, focus on the page goes to where word was found. This has worked great for me for about 10 years now.

Internet Explorer 8 no longer uses a Search Box. No window is created on "not found". I am at a loss how I can program a "find" or "not find" situation in IE8 using Macro Scheduler.

I am still using the latest of version 7.xx as everything worked well for me and I did not want to have to re-write all my dozens of macros with the completely new versions. If however this "find in IE8" problem has an easy solution in the newest Macro Scheduler versions, I'll upgrade.

Thanks for any assistance.

Cristian Coban, Ph.D.

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Fri Aug 27, 2010 2:37 pm

A couple of things come to mind...

Use the IE object scripted by Macro Scheduler. You can do this yourself
using VBScript..... or use the WebRecorder accessory to make this easy without writing VBScript.

OR

Parse the HTML directly in code and NOT use the GUI in IE for searching for text in the web page. Use HTTPRequest possibly to retrieve the webpage into a variable, and then use RegEx or other techniques to find the text you are looking for.

If I knew the root problem you were looking to solve, a more detailed answer could be formulated.

If you are really intent on using the GUI find in IE, then I would start using the image recognition functions to find the "No matches found" text which shows up to the right of the "find" search box.

ccris
Newbie
Posts: 19
Joined: Fri Aug 27, 2010 1:53 pm

Post by ccris » Fri Aug 27, 2010 3:12 pm

Thanks adroege for your quick and informative reply.

"using the GUI"
Yes, I think I need the GUI.

"If I knew the root problem"
I use the FIND function for a couple of reasons:
This is done on a few Web pages (submit forms on SPAMcop.net) I use to submit SPAM reports.
There is a high variability in how the pages display (also, if they display, when they display, etc.). I can not use fixed mouse clicks or TABs.

On one page, I use the FIND function to find a specific string. After the FIND function finds this string, I know that pressing TAB 2 times puts me on the SUBMIT form box, which then I can ENTER to submit the form.

On another page (a submit form that actually submits the SPAM report), I look for specific strings that point to the specific ISPs I use for my own hosting services. Submitting spam reports to my own ISPs has proven confusing in the past, as the ISPs do not check enough to see that I am the one REPORTING spam, and think that I am the one SENDING spam. So if my own ISPs are found, I abort report submission and move on to the next SPAM. If my own ISPs are not found, then I use FIND again to find a certain string. This puts focus in a place where pressing TAB 2 times puts me again on the SUBMIT form box (which then I can ENTER to submit the form).

Your suggestion "using the image recognition functions to find the "No matches found" text" seems like the correct approach (I am not familiar with this function as I am stuck in version 7.xx).

As I said, I was reluctant to upgrade from 7.xx upwards to avoid having to re-write all my macros.
As it becomes aparent that I will have to upgrade, now I need to ask another question (I'll try here, if no responses I may have to start a new thread):
I know that after version 7.xx, Macro Scheduler changed dramatically.
If I upgrade to current version, will the macros I wrote in 7.xx still run? Or do I have to re-write everything?

Thanks again,

CC

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Fri Aug 27, 2010 4:06 pm

If I upgrade to current version, will the macros I wrote in 7.xx still run? Or do I have to re-write everything?
I cannot give a definitive answer, however I have found that
Macro Scheduler seems to go to great lengths to maintain backward
compatibility. I have upgraded from version 7.x all the way to current, but in an incremental fashion, rather than all at once. I remember changing code at some points, but mostly to improve it using the newer features available in the upgrade, rather than because it flat out didn't work.

Based upon what you are doing, which seems fairly involved, I stand by my recommendation that it's better to not try to "find" text and then hit tab keys to submit forms in a web browser. Parsing the text using Regular Expressions is more robust. You can also send the forms directly using the HTTPRequest> command and not rely on the browser at all. There is a fairly steep learning curve to get this approach working well, however the end result is worth it.

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