aisingapore / TagUI

Free RPA tool by AI Singapore
Apache License 2.0
5.58k stars 580 forks source link

SyntaxError: Unexpected token '=' - pending more info and user replication details #878

Closed vinaykadam82 closed 3 years ago

vinaykadam82 commented 3 years ago

When i am trying to read a region of a page then i am getting an error as follows:. Even if i use same code from Documentation then also it gives me same error.

Error:- The process cannot access the file because it is being used by another process. The process cannot access the file because it is being used by another process. SyntaxError: Unexpected token '='

phantomjs://code/1.tag.js:1494 in injectJs phantomjs://code/bootstrap.js:456

Script:-

https://dummy.com/ click closeMenu.png wait 30 click r1.png wait 30 click RTECereal.png wait 3 click DessertMixes.png wait 45 //read (630,290)-(750,340) to var read (0,0)-(460,45) to id-number

Also i want to know how can i click on image based on coordinates. For example if i have a image which is 200x200 in size but i want to click on 5,5. Then How should i do that?

kensoh commented 3 years ago

Sorry Vinay I was away the past few months - https://github.com/tebelorg/RPA-Python/issues/144

I have not come across above error before. It looks to be related to restricted access to files on your computer.

Have you followed the setup steps here? - https://tagui.readthedocs.io/en/latest/setup.html

Some ideas you can try to figure out what's wrong -

For clicking on an image, TagUI will click at centre of the image, in your example of 200x200 it will click at 100,100. The usual way is to take a snapshot of the element so that the part that you want to click is at centre of the snapshot. It should be technically possible for user to hack TagUI to make offset clicking possible, but that will be too challenging to make sure work correctly.

Another way is after taking image so that the place to click is at the centre, you can use image editing program to make the parts you don't want to match that is outside the button to be transparent. Then save as .png format. Transparent parts of image will be ignore for matching.

kensoh commented 3 years ago

(closing issue for now till further inputs)