ENTER keypress not working

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
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
Post Reply
techimac
Posts: 407
Joined: Fri Feb 20, 2015 9:27 pm

ENTER keypress not working

Post by techimac » Sat Jun 19, 2021 7:40 am

Go to any GMB Listing
for example
https://www.google.com/maps/place/Lapto ... 9zZXJ2aWNl

I want to search for review

Here is the code.
Only issue is ENTER key is not working

Code: Select all

event type=click XPATH="(//button[@aria-label='Search reviews'])[1]"
wait seconds=1
EVENTS TYPE=KEYPRESS XPATH="(//input[@aria-label='Search reviews'])[1]" CHARS="abc"
wait seconds=1
EVENT TYPE=KEYPRESS XPATH="(//div[@data-value='Search reviews'])[1]" key=13
Windows 8.1
Palemoon 28
iMacros 8.9.7
chivracq
Posts: 9824
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: ENTER keypress not working

Post by chivracq » Sat Jun 19, 2021 3:20 pm

techimac wrote:
Sat Jun 19, 2021 7:40 am
Go to any GMB Listing
for example
https://www.google.com/maps/place/Lapto ... 9zZXJ2aWNl

I want to search for review

Here is the code.
Only issue is ENTER key is not working

Code: Select all

event type=click XPATH="(//button[@aria-label='Search reviews'])[1]"
wait seconds=1
EVENTS TYPE=KEYPRESS XPATH="(//input[@aria-label='Search reviews'])[1]" CHARS="abc"
wait seconds=1
EVENT TYPE=KEYPRESS XPATH="(//div[@data-value='Search reviews'])[1]" key=13
Windows 8.1
Palemoon 28
iMacros 8.9.7

Hum, I was not "convinced" your Thread would have anything specific to the 'iMacros for FF' Sub-Forum, but yep indeed, I can reproduce in v8.8.2 for FF (+ PM v26.3.3) and v8.9.7 for FF (+ FF v55.0.3), while your Script "works" for the "KEY=13" Statement in v10.1.1 'Free' for CR (+ CR76).

The following 3 Commands/Statements all work fine (trigger the Search Command on the Page) in v10.1.1 for CR, while they do "nothing" in PM/FF...:

Code: Select all

EVENT TYPE=KEYPRESS SELECTOR="#pane>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>DIV:nth-of-type(7)>DIV>DIV:nth-of-type(2)>DIV>INPUT" KEY=13

Code: Select all

EVENT TYPE=KEYPRESS XPATH="(//div[@data-value='Search reviews'])[1]" key=13

Code: Select all

EVENT TYPE=KEYPRESS XPATH="(//input[@aria-label='Search reviews'])[1]" key=13
... Well, the 2nd one ("//div[@data-value") triggers some Runtime Error about the 'DIV' not being "visible"...

I wanted to try/check in iMB v2021.0/v14.2 'Trial', but my 'Trial' Version has already expired, hum OK, too bad...! :(

I tried a few other "Tricks" in PM/FF, but none worked... :twisted:

=> "Easy" Workaround: Run your Script in CR + iMacros for CR v10.1.1... :idea:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
techimac
Posts: 407
Joined: Fri Feb 20, 2015 9:27 pm

Re: ENTER keypress not working

Post by techimac » Sat Jun 19, 2021 3:40 pm

I can run only in Firefox or palemoon because I use iMacros 8.9.7

I can't think of DOM to click because I dont know what element to click to simulate enter key
chivracq
Posts: 9824
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: ENTER keypress not working

Post by chivracq » Sat Jun 19, 2021 4:12 pm

techimac wrote:
Sat Jun 19, 2021 3:40 pm
I can run only in Firefox or palemoon because I use iMacros 8.9.7

I can't think of DOM to click because I dont know what element to click to simulate enter key

Alright, this little Trick seems to work in v8.8.2 for FF + PM26: :P

Code: Select all

EVENTS TYPE=KEYPRESS SELECTOR="#pane>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>DIV:nth-of-type(7)>DIV>DIV:nth-of-type(2)>DIV>INPUT" KEYS="[37,35,13]"
(Adding a 'Left Arrow' + 'End' Keys before the 'Enter' Key...)

I let you test in v8.9.7 for FF, and using your 'XPATH' Mode..., but looks like "there is Hope", ah-ah...!! :wink:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
techimac
Posts: 407
Joined: Fri Feb 20, 2015 9:27 pm

Re: ENTER keypress not working

Post by techimac » Sat Jun 19, 2021 5:49 pm

Thanks

Working but not on xpath
chivracq
Posts: 9824
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: ENTER keypress not working

Post by chivracq » Sat Jun 19, 2021 6:02 pm

techimac wrote:
Sat Jun 19, 2021 5:49 pm
Thanks

Working but not on xpath

Not with "your" 'XPATH' Statement (which triggers the "DIV not visible" Runtime Error I mentioned), but works for me (on v8.8.2 for FF + PM26) with the 'XPATH' Statement I had posted...:

Code: Select all

EVENTS TYPE=KEYPRESS XPATH="(//input[@aria-label='Search reviews'])[1]" KEYS="[37,35,13]"
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
techimac
Posts: 407
Joined: Fri Feb 20, 2015 9:27 pm

Re: ENTER keypress not working

Post by techimac » Sat Jun 19, 2021 6:30 pm

Wrong code got posted by mistake

I tried this

Code: Select all

event type=click XPATH="(//button[@aria-label='Search reviews'])[1]"
wait seconds=0.5
EVENTS TYPE=KEYPRESS XPATH="(//input[@aria-label='Search reviews'])[1]" CHARS="abc"
wait seconds=0.5
EVENTS TYPE=KEYPRESS XPATH="(//input[@data-value='Search reviews'])[1]" KEYS="[37,35,13]"
chivracq
Posts: 9824
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: ENTER keypress not working

Post by chivracq » Sat Jun 19, 2021 6:54 pm

techimac wrote:
Sat Jun 19, 2021 6:30 pm
Wrong code got posted by mistake

I tried this

Code: Select all

event type=click XPATH="(//button[@aria-label='Search reviews'])[1]"
wait seconds=0.5
EVENTS TYPE=KEYPRESS XPATH="(//input[@aria-label='Search reviews'])[1]" CHARS="abc"
wait seconds=0.5
EVENTS TYPE=KEYPRESS XPATH="(//input[@data-value='Search reviews'])[1]" KEYS="[37,35,13]"

"... got posted by mistake", tja...!, if you don't pay attention to the Code/Script that you post, ah-ah...! :roll:

This "new one" of yours... =>

Code: Select all

EVENTS TYPE=KEYPRESS XPATH="(//input[@data-value='Search reviews'])[1]" KEYS="[37,35,13]"
... then triggers the following Runtime Error for me:

Code: Select all

RuntimeError: Can not locate element specified by xpath "(//input[@data-value='Search reviews'])[1]", line 11 (Error code: -1001)
(Still using v8.8.2 for FF + PM26.)

Can't you use/try the one I posted...?, that simply reuses the exact same 'XPATH' you already use to input the "abc" Chars...!? :?
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
techimac
Posts: 407
Joined: Fri Feb 20, 2015 9:27 pm

Re: ENTER keypress not working

Post by techimac » Sun Jun 20, 2021 6:44 am

yes its not working

thats why I said non xpath code is working
chivracq
Posts: 9824
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: ENTER keypress not working

Post by chivracq » Sun Jun 20, 2021 2:48 pm

techimac wrote:
Sun Jun 20, 2021 6:44 am
yes its not working

thats why I said non xpath code is working

Yeah well, I couldn't guess which 'XPATH' Statement(s) you had tried if you just say "it's not working"...

Hum, OK, I tested on FF55 (iMacros for FF v8.9.7, FF v55.0.3, Win10), and this one does work for me:

Code: Select all

event type=click XPATH="(//button[@aria-label='Search reviews'])[1]"
wait seconds=1
EVENTS TYPE=KEYPRESS XPATH="(//input[@aria-label='Search reviews'])[1]" CHARS="iPhone"
wait seconds=1

EVENTS TYPE=KEYPRESS XPATH="(//input[@aria-label='Search reviews'])[1]" KEYS="[37,35,13]"
=> Same v8.9.7 for FF Version like you, but on FF55, different Browser, then it looks like the Page/Site is rendered and behaves differently in different Browsers, like "we" already found out about CR + v10.1.1 for CR...

Then, I don't know..., try re-recording again the Action(s) for the 3 Keyboard Strokes together, or try some different Key Combinations...

And you always have the 'EVENT SELECTOR' Statement that works fine, you said... => Then use that one, I would think, ah-ah...! The Search Field is "relatively" at the Top of the "Reviews" Frame/Left Panel, so I would expect the 'SELECTOR' Path to remain quite "stable" and "reliable"...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
techimac
Posts: 407
Joined: Fri Feb 20, 2015 9:27 pm

Re: ENTER keypress not working

Post by techimac » Mon Jun 28, 2021 6:33 am

Thanks a lot again

Can you tell how to setup chrome with iMacros 8.9.7?
I tried but couldn't succeed.
I can open new thread if you say.
chivracq
Posts: 9824
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: ENTER keypress not working

Post by chivracq » Mon Jun 28, 2021 12:23 pm

techimac wrote:
Mon Jun 28, 2021 6:33 am
Thanks a lot again

Can you tell how to setup chrome with iMacros 8.9.7?
I tried but couldn't succeed.
I can open new thread if you say.

Beh, no, you can't use v8.9.7 (for FF) with CR, ah-ah...! :shock:
You need to use v10.x for CR (current Version = v10.1.1) with CR (current Version = CR91/92, I think, I still use CR76 myself as I completely blocked CR from updating itself when it was at CR76...).
And if you install iMB v2021.0/v14.2 'Trial' from the Downloads Page, you will also get v10.1.1 for CR "activated" to 'Trial' for 30 days..., with Full Func like the 'PE' Version..., (and same also with v10.1.0 for FF).

If you want to use v8.9.7 for FF, then yep, PM28 is an Option, like you do already, or that Version also works until FF56 (but recommended FF v55.0.3, some Func got broken in FF56, => install FF v55.0.3 Portable, I would say...), and you also have Basilisk v2021 that works with v8.9.7 for FF.

>>>

And you didn't react but I don't understand why you absolutely want to use 'EVENT XPATH', you have a Solution/Statement that works (for you) with 'EVENT SELECTOR'...!? :?
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
techimac
Posts: 407
Joined: Fri Feb 20, 2015 9:27 pm

Re: ENTER keypress not working

Post by techimac » Tue Jun 29, 2021 4:49 pm

Event selector might need frequent changes
and xpath code works for long time unless there are HTML changes

So I prefer xpath first and then selector
techimac
Posts: 407
Joined: Fri Feb 20, 2015 9:27 pm

Re: ENTER keypress not working

Post by techimac » Tue Jun 29, 2021 4:50 pm

CR76 works with 8.9.7?
Post Reply