EVENT command is not working with XPATH localizer

Discussions and Tech Support specific to the iMacros for Chrome extension.
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
acajo
Posts: 9
Joined: Sat Oct 17, 2015 12:43 pm

EVENT command is not working with XPATH localizer

Post by acajo » Tue Dec 17, 2019 9:46 am

Hello, I'm using:
SETUP1:
- Windows 7 Ultimate 32-bit SP1 lang: English(US)
- Chrome 79.0.3945.79 (Official Build) (32-bit)
- iMacros for Chrome 10.0.5 Freeware
SETUP2:
- Windows 10 Pro 64-bit version 1903 build 18362.535 lang: English(US)
- Chrome 79.0.3945.79 (Official Build) (64-bit)
- iMacros for Chrome 10.0.5 Freeware

1. EVENT TYPE=CLICK XPATH="any_xpath_expression" BUTTON=0 is not working, iMacros reports this error "TypeError: Cannot read property 'error' of undefined, line: 3"
(I tried any_xpath_expression with single-quotes, double-quotes, no-quotes, tried to escape special characters with every possible quotes and no-quotes)
(with Firefox 55.0.3 and iMacros for Firefox 8.9.7 works)

2. EVENT TYPE=CLICK SELECTOR="css_expression" BUTTON=0 works.

3. TAG XPATH="any_xpath_expression" works.
chivracq
Posts: 9296
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: EVENT command is not working with XPATH localizer

Post by chivracq » Tue Dec 17, 2019 11:45 am

acajo wrote:
Tue Dec 17, 2019 9:46 am
Hello, I'm using:
SETUP1:
- Windows 7 Ultimate 32-bit SP1 lang: English(US)
- Chrome 79.0.3945.79 (Official Build) (32-bit)
- iMacros for Chrome 10.0.5
SETUP2:
- Windows 10 Pro 64-bit version 1903 build 18362.535 lang: English(US)
- Chrome 79.0.3945.79 (Official Build) (64-bit)
- iMacros for Chrome 10.0.5

1. EVENT TYPE=CLICK XPATH="any_xpath_expression" BUTTON=0 is not working, iMacros reports this error "TypeError: Cannot read property 'error' of undefined, line: 3"
(I tried any_xpath_expression with single-quotes, double-quotes, no-quotes, tried to escape special characters with every possible quotes and no-quotes)
(with Firefox 55.0.3 and iMacros for Firefox 8.9.7 works)

2. EVENT TYPE=CLICK SELECTOR="css_expression" BUTTON=0 works.

3. TAG XPATH="any_xpath_expression" works.

Hum..., yep indeed, I can reproduce, using:

Code: Select all

- iMacros for CR v10.0.5 'Free', CR76, Win10_x64.
(Win10_x64_PRO_v1909_ENG_(US) #18363.535)
And yep, I'm still @CR76, I've explained in this Thread/Post why... :x

And I get the same RuntimeError like @OP, with and without '!ERRORIGNORE', on all 'EVENT XPATH' Lines...:
TypeError: Cannot read property 'error' of undefined, line: [7-24]
Script I used:

Code: Select all

VERSION BUILD=8820413 RECORDER=FX
'SET !ERRORIGNORE YES
TAB T=1

URL GOTO=http://demo.imacros.net/Automate/TestForm1

'Name:
EVENTS TYPE=KEYPRESS XPATH="//form[@id='demo']/fieldset[1]/ol/li[1]/input[1]" CHARS="EVENT XPATH Mode Tester"

'Food and Drink: (Not correct...)
EVENT TYPE=CLICK XPATH="//form[@id='demo']/fieldset[1]/ol/li[2]/select" BUTTON=0
EVENT TYPE=CLICK XPATH="//form[@id='demo']/fieldset[1]/ol/li[3]/select" BUTTON=0
'Size:
EVENT TYPE=CLICK XPATH="//form[@id='demo']/fieldset[1]/ol/li[4]/input[2]" BUTTON=0
'Dessert(s): (Not converted to 'XPATH'...)
EVENT TYPE=CLICK SELECTOR="#dessert>OPTION:nth-of-type(2)" BUTTON=0
EVENT TYPE=CLICK SELECTOR="#dessert>OPTION:nth-of-type(5)" BUTTON=0 MODIFIERS="ctrl"

'Customer?:
EVENT TYPE=CLICK XPATH="//form[@id='demo']/fieldset[1]/ol/li[6]/input[1]" BUTTON=0
SET !ENCRYPTION NO
EVENTS TYPE=KEYPRESS XPATH="//form[@id='demo']/fieldset[1]/ol/li[6]/input[2]" CHARS="tester"

'Remarks:
EVENTS TYPE=KEYPRESS XPATH="//form[@id='demo']/fieldset[1]/ol/li[7]/textarea" CHARS="Test using EVENT XPATH Mode...!"
EVENT TYPE=KEYPRESS XPATH="//form[@id='demo']/fieldset[1]/ol/li[7]/textarea" KEY=13
EVENTS TYPE=KEYPRESS XPATH="//form[@id='demo']/fieldset[1]/ol/li[7]/textarea" CHARS="Should work...!"
PAUSE

'Submit:
EVENT TYPE=CLICK XPATH="//form[@id='demo']/fieldset[2]/button" BUTTON=0
PAUSE
The same Script works fine in those 2 FCI's:

Code: Select all

- iMacros for FF v8.8.2, PM v26.3.3, Win10_x64.
- iMacros for FF v8.9.7, FF v55.0.3, Win10_x64.
... well,, "works fine"..., => except for the 3 'Food' + 'Drink' + 'Dessert' DDLB's that apparently don't have the correct 'XPATH', I never use this Mode for myself, so I'm not very "fluent" with it, oops...! :P

I took the 'Demo-FillForm-XPATH.iim' Demo-CR Script (no Version mentioned in it anymore(?) :o , is probably from v10.0.5 for CR) (=> works fine in all 3 FCI's), I recorded the same Actions using the 'EVENT' ('SELECTOR') Mode in v8.8.2 for FF (=> works fine in all 3 FCI's), and I converted that 'EVENT SELECTOR' Mode Script to 'EVENT XPATH' Mode using the 'XPATH' Values from the 'XPATH' Demo-CR Script...

>>>

Alerting @TechSup to have a Look... :wink:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Tom, Tech Support
Posts: 3572
Joined: Mon May 31, 2010 4:59 pm

Re: EVENT command is not working with XPATH localizer

Post by Tom, Tech Support » Sun Mar 08, 2020 11:24 am

This issue has been confirmed and logged as a bug. Thank you for reporting it here acajo, and thanks for the additional verification chivracq!
Regards,

Tom, iMacros Support
Post Reply