Feedback and Issues on EVENT Recording Mode.

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Feedback and Issues on EVENT Recording Mode.

Post by chivracq » Fri Dec 05, 2014 8:34 pm

Some excuse to bump this Thread...!:
One more User complaining about the Wiki Page for the EVENT Mode...:
- wiki page for EVENT
additional001 wrote:There is a grammatical error on the wikki page for EVENT. http://wiki.imacros.net/EVENT

Under Notes section:
We are especially interested to hear about in websites that do not not despite using the new EVENT(s) command.
I've read this like 5x and I still don't get what they are looking for.

Also think they should add some parameters for the Parameter's section. Not having a complete list prevents writing them from hand. It's like not listing them for TAG. Could you imagine trying to do that by not knowing TYPE POS or ATTR????
.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
viking
Posts: 244
Joined: Sun Mar 16, 2008 7:22 am

Re: Feedback and Issues on EVENT Recording Mode.

Post by viking » Sat Oct 17, 2015 10:04 pm

This post describes another situation where the EVENT command fails:
http://forum.imacros.net/viewtopic.php? ... 25188ecord
User avatar
alex686
Posts: 32
Joined: Wed Oct 21, 2015 6:48 am
Contact:

Re: Feedback and Issues on EVENT Recording Mode.

Post by alex686 » Wed Oct 21, 2015 7:13 am

Hi!

I've created a JS script where I use EVENT directives for inputing text in comment's fields on one Russian social network site. Script works fine as long as I keep Firefox window focused. Whenever I switch focus on another app (for example on skype), the script begins to fail.

I've tried to get rid of all the EVENT directives replacing them with the TAG but there is one directive that I can not substitute with TAG - the one that sends chars to the input field. Now whenewer I loose focus from Firefox window the script fails on this particular EVENT directive. How can I solve this problem?

I use Firefox 41.0.2 and iMacros 8.9.4
iMacros for Firefox: 8.9.7
Firefox: 49.0.1
Pale Moon: 27.0.2
OS: Arch Linux, Windows 10

Manage iMacros from your mobile device: https://manage.getbot.ru
Tom, Tech Support
Posts: 3834
Joined: Mon May 31, 2010 4:59 pm

Re: Feedback and Issues on EVENT Recording Mode.

Post by Tom, Tech Support » Wed Oct 21, 2015 12:17 pm

Hi alex686,

Sorry, I am unable to reproduce this behavior. I tested the attached sample macro in Firefox 41.0.2 with iMacros 8.9.4 and even minimized the browser window completely and it still ran successfully for me. Would you please try this macro also.
Attachments
FillForm-EVENT.zip
(464 Bytes) Downloaded 258 times
Regards,

Tom, iMacros Support
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Feedback and Issues on EVENT Recording Mode.

Post by chivracq » Wed Oct 21, 2015 4:59 pm

alex686 wrote:Hi!

I've created a JS script where I use EVENT directives for inputing text in comment's fields on one Russian social network site. Script works fine as long as I keep Firefox window focused. Whenever I switch focus on another app (for example on skype), the script begins to fail.

I've tried to get rid of all the EVENT directives replacing them with the TAG but there is one directive that I can not substitute with TAG - the one that sends chars to the input field. Now whenewer I loose focus from Firefox window the script fails on this particular EVENT directive. How can I solve this problem?

I use Firefox 41.0.2 and iMacros 8.9.4
Tom, Tech Support wrote:Hi alex686,

Sorry, I am unable to reproduce this behavior. I tested the attached sample macro in Firefox 41.0.2 with iMacros 8.9.4 and even minimized the browser window completely and it still ran successfully for me. Would you please try this macro also.

Code: Select all

VERSION BUILD=8940826 RECORDER=FX
TAB T=1
URL GOTO=http://demo.imacros.net/Automate/TestForm1
SET !REPLAYSPEED MEDIUM
EVENT TYPE=CLICK SELECTOR="#name" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#name" CHARS="Tom, Tech Support"
EVENT TYPE=CLICK SELECTOR="#food" BUTTON=0
EVENT TYPE=CLICK SELECTOR="#food>OPTION:nth-of-type(2)" BUTTON=0
EVENT TYPE=CLICK SELECTOR="#drink" BUTTON=0
EVENT TYPE=CLICK SELECTOR="#drink>OPTION:nth-of-type(4)" BUTTON=0
EVENT TYPE=CLICK SELECTOR="#medium" BUTTON=0
EVENT TYPE=CLICK SELECTOR="#dessert>OPTION:nth-of-type(2)" BUTTON=0
EVENT TYPE=CLICK SELECTOR="#demo>FIELDSET>OL>LI:nth-of-type(7)>TEXTAREA" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#demo>FIELDSET>OL>LI:nth-of-type(7)>TEXTAREA" CHARS="Test_{{!NOW:hhhnnmsss}}"
EVENT TYPE=CLICK SELECTOR="#demo>FIELDSET:nth-of-type(2)>BUTTON" BUTTON=0
Yep, no Pb either running Tom's Test Macro (I just added the '{{!NOW}}' Var in the 'Remarks' Field to be sure that the Macro run completely when running it several times...) in all kinds of Minimized Window (even if I discovered a new funny little Bug, I think I will report it in some apart Post in this Thread or in some apart Thread (as I don't think it's related to the EVENT Mode)), but I suspect that 'alex686' (who didn't post his Script...) is using the cumbersome on the fly Syntax in .js Scripts (which seems to be very popular among Users who want to use iMacros for posting on Social Sites... :mrgreen: , sbd must one day have posted such a Script on some obscure Forum some years ago and that Script has (a bit stupidly in my Opinion...) gone viral since...) like this other User in this other Thread:
- Problem where trying make post to google+
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
User avatar
alex686
Posts: 32
Joined: Wed Oct 21, 2015 6:48 am
Contact:

Re: Feedback and Issues on EVENT Recording Mode.

Post by alex686 » Tue Oct 27, 2015 3:46 pm

Hi guys!

Sorry for making you wait, I haven't set up email notification on updating of this thread and did not know you answered so fast. Thanks for this by the way.

I've tried Tom's script and it works fine with Firefox being not focused. Then I've tested my script thoroughly and can now conclude that the problem is not in the EVENT directive.

I've replaced the EVENT statement in my code with the javascript function to test the behaviour of the script. Here is a piece of my code configured for running on iMacros' test site. You can save it to text file with js extension and run from iMacros with Firefox focused and not.

Code: Select all

//imacros-js:showsteps no

function setCaretPosition(selector, caretPos) {
  var el = window.document.querySelector(selector);

  el.value = el.value;
  // ^ this is used to not only get "focus", but
  // to make sure we don't have it everything -selected-
  // (it causes an issue in chrome, and having it doesn't hurt any other browser)

  if (el !== null) {

    if (el.createTextRange) {
      var range = el.createTextRange();
      range.move('character', caretPos);
      range.select();
      return true;
    }

    else {
      // (el.selectionStart === 0 added for Firefox bug)
      if (el.selectionStart || el.selectionStart === 0) {
        el.focus();
        el.setSelectionRange(caretPos, caretPos);
        return true;
      }

      else  { // fail city, fortunately this never happens (as far as I've tested) :)
        el.focus();
        return false;
      }
    }
  }
}

function insertTextAtCursor(text) {
  var sel, range, html;
  if (window.getSelection) {
    sel = window.getSelection();
    if (sel.getRangeAt && sel.rangeCount) {
      range = sel.getRangeAt(0);
      range.deleteContents();
      range.insertNode( window.document.createTextNode(text) );
    }
  } else if (window.document.selection && window.document.selection.createRange) {
      window.document.selection.createRange().text = text;
  }
}

iimPlayCode('URL GOTO=http://demo.imacros.net/Automate/TestForm1');

iimPlayCode('WAIT SECONDS=3');

setCaretPosition('#demo>fieldset>ol>li>textarea', 1);

iimPlayCode('WAIT SECONDS=3');

insertTextAtCursor('Aloha from Hawaii!');

When you switch focus from Firefox, the "Aloha..." text does not filled in. And I can't figure out why. Same happens when I use EVENT directive to text in chars into the input. By the way, on the site where my script is supposed to work the input field is made of editable div.
iMacros for Firefox: 8.9.7
Firefox: 49.0.1
Pale Moon: 27.0.2
OS: Arch Linux, Windows 10

Manage iMacros from your mobile device: https://manage.getbot.ru
User avatar
alex686
Posts: 32
Joined: Wed Oct 21, 2015 6:48 am
Contact:

Re: Feedback and Issues on EVENT Recording Mode.

Post by alex686 » Tue Nov 10, 2015 2:40 pm

With regards to EVENT mode, I've made some investigation and found out that iMacros does not type in chars into a content editable div which looks like an input field. The provided test script that fills in the iMacros sample form uses input elements which works just fine.

Can anyone confirm that iMacros does not type in chars in an input field made as editable div when Firefox is not focused?
iMacros for Firefox: 8.9.7
Firefox: 49.0.1
Pale Moon: 27.0.2
OS: Arch Linux, Windows 10

Manage iMacros from your mobile device: https://manage.getbot.ru
Tom, Tech Support
Posts: 3834
Joined: Mon May 31, 2010 4:59 pm

Re: Feedback and Issues on EVENT Recording Mode.

Post by Tom, Tech Support » Wed Nov 11, 2015 10:59 am

alex686 wrote:Can anyone confirm that iMacros does not type in chars in an input field made as editable div when Firefox is not focused?
Can you provide a link to a page with such a field, or otherwise provide the source HTML here.
Regards,

Tom, iMacros Support
User avatar
alex686
Posts: 32
Joined: Wed Oct 21, 2015 6:48 am
Contact:

Re: Feedback and Issues on EVENT Recording Mode.

Post by alex686 » Thu Nov 12, 2015 6:05 am

Hi, Tom and thanks for your support.

Here I've attached the whole webpage archive in mht format that was generated by the Mozilla Archive Format, with MHT and Faithful Save addon. I guess you should add it to your Firefox to be able to open the file. I've also attached the macro that leaves a comment under the photo. This macro works only when Firefox is focused. Tested it on two windows computers and on my linux machine.

Please try it yourself.

PS. Could not attached the mht file as it is too big even archived, so I've zipped both mht and iim macro and uploaded it here.
iMacros for Firefox: 8.9.7
Firefox: 49.0.1
Pale Moon: 27.0.2
OS: Arch Linux, Windows 10

Manage iMacros from your mobile device: https://manage.getbot.ru
Tom, Tech Support
Posts: 3834
Joined: Mon May 31, 2010 4:59 pm

Re: Feedback and Issues on EVENT Recording Mode.

Post by Tom, Tech Support » Thu Nov 12, 2015 12:12 pm

Thanks for providing the test page and macro Alex! I confirmed that the field is not filled when the browser does not have focus and have logged this for further investigation by the development team. I do not expect any feedback or resolution any time soon, because the team is wrapping up development on iMacros 9 with support for e10s, and then switching over to do some more work on iMacros for Chrome.
Regards,

Tom, iMacros Support
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Feedback and Issues on EVENT Recording Mode.

Post by chivracq » Thu Jul 27, 2017 12:03 am

chivracq ([url=http://forum.imacros.net/viewtopic.php?f=11&t=21494#p54018]by chivracq on 06 Aug 2013, 05:34[/url]) wrote:- 01 - Object not found on 'MOUSEMOVE'.
The most blocking aspect with the EVENT Record Mode is that when an Object is not found, the Script will hang and there is no way at all to get it resuming its execution...

As I mentioned it earlier...:
Chivracq (2013/06/20) wrote: ..., there was a Bug in v8.3.0 with the EVENT-Mode when a "EVENT TYPE=MOUSExxx SELECTOR="ID_xx1"" was not found, by jumping to the next instruction and hanging the Macro with no Error at all but with no possibility to resume its execution, now with the latest v8.5.1 Patch, all "EVENT TYPE=MOUSExxx" instructions are skipped together (instead of just only 1) and the Macro hangs at the next instruction.
The final result is still the same, the Macro still hangs if the SELECTOR-Object is not found (with "SET !ERRORIGNORE YES", of course!), but the behaviour is a bit different between v8.3.0 and v8.5.1, so maybe it's worth mentioning it...
(I haven't reported it yet, as I wanted to report all my EVENT-Mode feedback in one apart Thread...)
EDIT (Decb 2016) on this '01' Item:
This very Blocking Bug in my Opinion never got acknowledged by TechSup nor encountered/reported by any other User... :shock: , until finally more than 3 years later in this Thread from Novb/Decb 2016 where I've posted some fairly easy though a bit "Creative" Workaround that I've been using myself since a few months when I finally dared to dig into the "Problematic" again, ah-ah...!
Well, it will have taken exactly 4 years for some other User to finally hit and confirm "my" Bug, ah-ah...!: :shock: 8) :D
- Macro Freezes
(At least if I'm correct, the Content of that other Thread is not very High Quality, at least from the Opening Post in the Thread..., with only some truncated Screenshot of the Script used... :roll: )

My complete Reply in that other Thread:
chivracq wrote:
DeathN wrote:Hi guys.
I'm testing some macros, but every time the pages doesn't, I have same error.

Code: Select all

My firefox is 54.0.1 (64-bit)
iMacros for Firefox 8.9.7

Code: Select all

SET !EXTRACT_TEST_POPUP NO
SET !ERRORIGNORE YES
SET !TIMEOUT_PAGE 25
SET !TIMEOUT_STEP 3
TAB CLOSEALLOTHERS
SET !LOOP -9999
I don't know what's happening with my macro, I think the erro is caused by FF, but I don't know.
Can someone explain to me??
Obrigado
FCIM...! :mrgreen: (OS is missing...)

I don't really understand what "... but every time the pages doesn't, I have same error." means, it is grammatically and linguistically not correct, especially if you don't mention your "same Error"...!

Hum, much easier if you post your Full Script in plain Tet in your Thread rather than some truncated Screenshot... :roll: ,, oh but yep, youpidoo...!!!, welcome to the Club!, ah-ah...! You are finally the first one to hit a Bug I have already reported 4 years ago, in 2013, ah-ah...! :D

It is related to the 'EVENT' Mode and a 'MOUSEMOVE' on an HTML Element that is not present on the Page, then the Script will simply hang at the next Line, even with '!ERRORIGNORE'..., but hum..., you mention a "same Error", "my" Bug doesn't trigger any Error, the Script simply hangs...

I've finally found a Workaround about 1 year ago now I think, I've already "mentioned" it in some Thread(s), I'm not sure if I've posted the Full Workaround already, you can search the Forum a little bit, or post your Full Script and I can apply/demonstrate my Workaround to your specific Site...

Related Threads:
- Feedback - Take the iMacros Add-on(s) Survey!
=> Item '02'.
- Feedback and Issues on EVENT Recording Mode.
=> Item '01'.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Post Reply