terrypin Posted October 4, 2010 Report Share Posted October 4, 2010 A macro that used to work fine for a year or more has started failing in an odd fashion. It's a very simple macro I use for entering the ME Pro Bug Report Form at http://www.macros.com/bugreport.htm As it might be handy for others I'll include it in its entirety here anyway. // ME Pro Bug Report Keystroke Speed: 5 milliseconds Web Site, "http://www.macros.com/bugreport.htm", using Default Web Browser Macro Run: Wait for FF web page ready Window Reposition: - Mozilla Firefox Position: 0, 0 Text Type (Simulate Keystrokes): <CONTROL><HOME> Delay: 100 milliseconds Text Type (Simulate Keystrokes): <TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB><TAB> // Tab to First Name. (Was 15 tabs, now seems to only need 14) Delay: 100 milliseconds Text Type (Simulate Keystrokes): Terry // Type First Name Delay: 100 milliseconds Text Type (Simulate Keystrokes): <TAB>Pinnell // Surname Delay: 100 milliseconds Text Type (Simulate Keystrokes): <TAB>terrypin@dial.pipex.com // email Delay: 100 milliseconds Text Type (Simulate Keystrokes): <TAB><TAB><ARROW DOWN> // Product Delay: 100 milliseconds Text Type (Simulate Keystrokes): <TAB>4.1.7.1 // Version Delay: 100 milliseconds Text Type (Simulate Keystrokes): <TAB><TAB><ARROW DOWN> // Operating System Delay: 100 milliseconds Text Type (Simulate Keystrokes): <TAB><ARROW DOWN> // Incorrect Functionality Delay: 100 milliseconds Text Type (Simulate Keystrokes): <TAB><ARROW DOWN> // Problem Frequency Delay: 100 milliseconds As you see, it just opens Firefox at that page then tabs through each required filed , completing it with Text Type commands, with generous delays between each. But now it behaves erratically. Instead of stopping after entering the Problem Frequency ('Can Reproduce') it acts as if the Send Report button has been clicked prematurely, and displays this: And it gives inconsistent results depending on the value of the Keystroke Speed command. Oddly, it gets worse the higher that value is. At 50 ms, for example, it gets half way through the Version field, typing '4.1' instead of '4.1.7.1' and then changes to an unrelated Firefox tab! The best result is with that Keystroke Speed command disabled. I'd have assumed slowing it down would make it more reliable, not the opposite? If I insert a Macro Stop after the Email entry, it stops as it should. But if I move that Stop down to after the Product entry, the premature error page is displayed, as if the macro has suddenly tabbed down several extra times. It's presumably some sort of timing or race issue, but why now after a year or two of stable usage? Anyone else seeing similar tabbing issues please? -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
kunkel321 Posted October 4, 2010 Report Share Posted October 4, 2010 It's presumably some sort of timing or race issue, ... Terry, there's no need to make this a race issue. Ha--I'm funny--yes? Seriously though, I wonder if putting some "Wait for text type" delays would help?? Maybe Windows is getting tab-happy?? Extra funny: A macro for doing bug reports, that has a bug... That's like a zen riddle -eh? Quote Link to comment Share on other sites More sharing options...
terrypin Posted October 4, 2010 Author Report Share Posted October 4, 2010 Terry, there's no need to make this a race issue. Ha--I'm funny--yes? Seriously though, I wonder if putting some "Wait for text type" delays would help?? Maybe Windows is getting tab-happy?? Extra funny: A macro for doing bug reports, that has a bug... That's like a zen riddle -eh? Thanks Steve. Yep, I missed that non-deliberate pun! I may well try some "Wait for text type" delays, but I'm still hung up about why it should have started this only recently. I may install an older version and see if that still exhibits it. -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
acantor Posted October 4, 2010 Report Share Posted October 4, 2010 It sounds like a problem caused by JavaScript or Ajax or some other scripting that happened in the background. I faced similar problems while automating my Hotmail login. The solution that worked for me was to dramatically increase the time delays between steps, up to 2500 ms. You might also try sending the keystrokes via the clipboard. My guess is that you could eliminate many of the delays in the script without compromising reliability. But experiment with adding very long delays at the point where the script fails. Quote Link to comment Share on other sites More sharing options...
terrypin Posted October 5, 2010 Author Report Share Posted October 5, 2010 Thanks Alan. But after trying all those suggestions and several other ideas the macro's behaviour continued to baffle me. Small wonder. After at least another hour I finally discovered it was my stupid error! At the start of one of my Text Type commands I'd entered a blank line. I must have pressed Enter to close the dialog instead of clicking OK. -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
acantor Posted October 5, 2010 Report Share Posted October 5, 2010 What I meant to say, Terry, was that JavaScript or Ajax running in the background of your brain's software was responsible for the erratic behaviour! I'm glad you figured it out. I can't count the number of times a script has ran amok because of a trivial error. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.