aisingapore / TagUI

Free RPA tool by AI Singapore
Apache License 2.0
5.54k stars 576 forks source link

Chrome extension gets lost on iFrames #10

Closed gruselglatz closed 7 years ago

gruselglatz commented 7 years ago

When i start recording in Chrome after the login i have to work in an iframe, but TA.Gui only records until i get into the iframe.

Here is the export:

https://www.linz-stromnetz.at/portal/stromnetz/snhome
click username
enter username as USERNAME
click password
enter password as PASSWORD\r
click Login
click fscontentpresentation203820 b .color

But it should go on and on.

kensoh commented 7 years ago

Hi @gruselglatz, thanks for your feedback! Yes this can be replicated for beta v0.6.0. The Chrome extension is base on Resurrectio tool and I'm going to look into that as part of #7.

At the moment, TA.Gui supports frames with the use of frame step. For example, something like below if the last element belongs to a frame.

frame mainframe | subframe_if_any
click fscontentpresentation203820 b .color

The technical reason is, in the underlying CasperJS runner, frames have to be explicitly mentioned in order to access elements in frames. Of course, there are technical reasons leading to that design.

But regardless, let me explore further on that as part of the current priority on improving the Chrome extension. I'll leave this issue open as a feedback as the Chrome extension is meant to simplify flow creation but not as a substitute to the more expressive steps.

Adding on, if you have a dummy user ID / password for that website and are still running into issues accessing elements, let me know. I'll see what I can help with.

kensoh commented 7 years ago

(oh I guess you are from Austria, from the website domain .at. I'll be staying near a neighboring country in a couple of months time. hope to visit your beautiful country if I have a chance)

gruselglatz commented 7 years ago

@kensoh thank you for the fast response, i am struggling a very long time with this website. I am sorry i don't have credentials to give away, because this is the Page where i can read my historical and nearly live data from my Smart-Meter.

This is why i want to get this automated, because they don't have an API so i have to grab my stats via the Web-Gui which is built with JavaServerFaces :nauseated_face: I also tried it with phantomJS but no luck there :( i could provide you that code, when you want?

Oh, nice to hear, in which country and why do you stay there?

kensoh commented 7 years ago

@gruselglatz Oh I see.. I understand your use case now. I have similar one too. I basically have a nightly job to auto-login into my bank/credit accounts to capture numbers to be synced to Google Spreadsheet. I use nightly jobs to capture statistics from different sources to synced to Google Spreadsheet too for my wife's website. TA.Gui can do that, by capturing whatever that is needed and output to text files or maybe even csv files by using some JavaScript code.

Basically I was doing stuffs like that directly in CasperJS for more than a year. Then I thought those actions that I do to write CasperJS scripts can actually be automated into something like TA.Gui, so I started working on TA.Gui.

I see, I'm afraid without accessing the website directly I cannot check the HTML DOM info. Nevertheless you can let me know more about the details here and I see if I can help. It's a secret :), my wife and I live a nomadic life now, so we stay and work remotely at different countries for 2-3 months and move.

gruselglatz commented 7 years ago

@kensoh That's exactly what i want to do :D I could provide you as much data from the Page as i can get. Would it help when i download the whole page, only that you can see the DOM?

Oh that sounds funny, then i wish you the best and come visit Austria, i would recommend not to stay too long in Vienna, the countryside is way more interesting and way more authentic. Visit Salzburg, Innsbruck, Linz, Graz, Bad Hall, Bad Ischl and then you can say you have seen Austria. (as a very short trip)

kensoh commented 7 years ago

@gruselglatz, sure yes that will help. Can you try saving the webpage as page source, and then copy the contents entirely into a GitHub gist? If not, just attached to support@tebel.org :) Let me know also which item(s) you want to extract from the webpage.

PS: Thanks for sharing the tips! I've save your recommendation in my nomading notes.

kensoh commented 7 years ago

adding development note that Selenium Builder can't handle frames, Selenium IDE can handle frames, and Zope Recorder (the underlying recording engine for Resurrectio) can't handle frames.

kensoh commented 7 years ago

Hi @gruselglatz, i've digged through the Resurrectio's source code (the base for TA.Gui's chrome extension). it fundamentally does not support frames/iframes. although Selenium IDE supports frame now, it seems to take a few years before rolling that out.

as the effort to implement this can't be estimated now, i'll keep a lookout for more datapoints on the occurrence of frames and consider alternative solutions. the current workaround is using the frame step to access elements in frames - frame mainframe | subframe_if_any

will close this issue for now to shift focus to porting tool to Windows, and look forward to more reports of examples to group them with your feedback. i know that your use case is resolved from our emails but do give a shout if there's anything else i can help with!

gruselglatz commented 7 years ago

Thanks for your help, and thank you for the time you invested in this issue! I see the problem here and it seems that at the moment the best choice is to do it by hand.