The three macros together let you save the data you have entered into a form, and then fill it in on command. So if you have a form you need to fill in multiple times with variations, you can save most of the data, and just make the changes for each one. My common usage for this is entering multiple children into a camp form.
The three macros are run in sequence:
Load up the form in Safari or Chrome, and leave it blank.
Run the Snapshot Start Form. The macro saves the state of the empty form.
Fill in the form.
Run the Snapshot Read Form. This saves the difference, ie all the data you have entered, into a variable * Captured Web Field Data*. It displays the fields in a text window, but you can turn that off if you want.
Submit the form, and then reload the page.
Run the * Snapshot Set Form*. This fills the form with the saved data.
Make any changes, submit the form and repeat.
It needs work to extend it to be really useful, but it's a solid start.
Primary deficiencies:
it only saves a single form. Ideally the forms would be saved for each web page, or each domain or something.
it doesn't currently handle popup menus.
So if anyone wants to take this and run with it, I'd be very happy to see a @DanThomas job done to it
BTW, for anyone who wanted to know about uses of dictionaries, this macro makes use of them to speed up the processing significantly.
Thanks for the macros, Peter. Looks very interesting.
I was reading your macros, trying to understand them, and ran across this at the bottom of 03)Snapshot Set Form macro:
I run a PC repair shop and fill out forms for new tickets multiple times a day. I'm tinkering with this and read about how to get the form ID's to do this manually. I am lost with a few things though, maybe one of you could help?
Several parts of my forms have dropdown/list menus. I can't figure out how to pick from my lists. I also can't find the ID for one button to click to send the filled out form. There are two buttons on the form to submit and no matter which ID I've selected, it uses the first option. If anyone has the time and expertise to make any suggestions, I would really appreciate it!
In Safari (you might need to turn on the Show Develop menu in menu bar in the Advanced preferences), you can control click on an element on a web page and select Inspect Element.
Control click on the "<input" text, and select Copy XPath.
That will give you something like this:
//*[@id="new_customer"]/div[2]/div/input[1]
Then create a Click Front Browser Link action and paste that in:
I have been able to get the XPaths from Safari to work, except for when a website uses frames. Is there a way to work with those? The XPath that I copy and use just gives the error that it couldn't find it.
Thank you. I did see that post but I didn't see any replies from anyone that would indicate whether it solved their problem or not. I can get what's shown to work, but to what end? I end up with a variable called HTML with source of the frame inside of it. I have no more information on where to go next.
The XPath leading up to the iframe is as follows:
/html/body/krn-app/krn-navigator-container/ui-view/krn-workspace-manager-container/krn-workspace/div/krn-layout-manager/div/div[4]/krn-widget/krn-widget-content/div
If I get the XPath on the iframe, I only get:
//*[@id="widgetFrame1642"]
The source for the button I want clicked is:
The XPath for the <cc-button...> line is:
//*[@id="mainWidgetContent"]/ui-view/krn-timestamp/div[3]/cc-button
Or do I need to click the which has the XPath:
//*[@id="jqxWidgetd006f30125da"]