Using KM to fill forms in pages with iframes

Hi All,

I’ve been struggling to figure out how to create a macro to fill a form in Safari in a page that’s using iframes.
The form itself is in the embedded iframe and KM doesn’t seem to be able to see/reach the fields when I use “Set Safari Fields to Text”.

Is it a known issue? Not supported?
it could be just me not figuring out how to set things up properly, but I’ve been really struggling with this one…


You probably have to write some JavaScript code to find the form, Keyboard Maestro can probably not see it directly.

Do iframes work with XPath? The XPath stuff (search the forum) is pretty cool for identifying elements on a page, but I’m afraid I’m not familiar with it so someone else would have to chime in as to how to use it for this sort of thing.

Hi Cortig,

iMacros works quite good with forms (, however it is only available for Firefox or Chrome.


P.S: Hi! This is my first post and I am not affiliated to iMacros or related organisation :smile:

1 Like

If you would like to show us the page and indicate the specific target and goal, we could see whether a KM action can reach it with an XPath expression.

I haven’t tried with Path yet, but I will sure give it a try!


The page is behind authentication. I unfortunately can’t give you a link to it :-\ (or if I did, it wouldn’t help much…).
Thanks though,


I think the trick is probably to open the page in Chrome, then:

  • Right-click and choose ‘Inspect Element’ (to show the developer view)
  • Right-click again on the target element, and choose Copy XPath

Once you have an XPath, you should be able to use the document.evaluate(XPath) examples which you will find in various threads here, including:

This is a very nice set of tools!
Path had no trouble identifying the field (which I had already identified and attempted to play with using the regular field tools in KM), but it systematically failed to actually click in it when I tried to run the macro (nothing happens). The same thing works great in other forms I played with.
I suspect the iframes throw everything off.
Thanks a million for the Path action items though. I’ll put them to good use on other forms!


1 Like