Dismiss JavaScript Dialog

306 views
Skip to first unread message

John Mills

unread,
Mar 3, 2011, 8:03:06 AM3/3/11
to fakeapp
Can anyone tell me how to use this action?

Currently my workflow pauses and waits for a user response on the
action which produces the Javascript confirmation box and refuses to
more until I confirm the confirmation. Is it possible this action to
select OK for me without me having to input a response?

Thanks
John

Richard

unread,
Mar 4, 2011, 1:04:19 PM3/4/11
to Fake
John,

I am having the exact same problem. I have searched high and low on
this group for a possible solution. I have found several others who
have had the same problem. I have tried several work arounds, of which
none work. I have tired running applescript from within Fake. I have
tried running an apple script that calls fake and then goes back to
applescript. Does anyone know how to do this?

Richard

veader

unread,
Mar 5, 2011, 2:50:32 PM3/5/11
to Fake
I responded to Richard out of band about this so I'll copy my response
here:
-----------

I ended up hacking around it by having one of the actions be to use
Javascript to remove the confirm call on the link. Something like:

var link = document.getElementById('link_id_here');
var onClickAttr = link.getAttribute('onclick').toString();
onClickAttr = onClickAttr.replace(/confirm\(\'(.*?)\'\)/, "true");
link.setAttribute('onclick', onClickAttr);

This assumes that is how your dialog is being presented.

Hopefully that helps some.

-----------

Eric

unread,
Mar 9, 2011, 12:20:45 PM3/9/11
to Fake
I ran into the same thing today. I need to go to a link which has an
"onclick" event attached to it; this event pops a confirm dialog
before actually loading the linked URL. It seems like the problem is
that Fake waits for the page on the other end of the "Click HTML Link"
step to load before it will move on to the rest of your workflow
(normally a good thing). But the dialog holds up the show so it never
finishes clicking the link and never gets to the "Dismiss Javascript
Dialog" step.

In my case, the onclick function wasn't doing anything besides popping
the dialog (I'm trying to log out, but it seems like all of the
sessions heavy lifting is being taken care of by cgi arguments in the
URLs). So I was able to bypass it altogether with a "Load URL" step
that just takes me to the page I want to get to without clicking on
anything.

John Mills

unread,
Mar 10, 2011, 9:27:24 AM3/10/11
to fak...@googlegroups.com
Thanks for the help gents but unfortunately I still cannot find a work
around for this.

Julio Capote

unread,
Nov 3, 2011, 7:59:12 PM11/3/11
to fak...@googlegroups.com
I figured out a workaround to this issue:

Just create a Do Javascript action with: function confirm(){ return true; }, this will bypass any confirm() dialogs your app has.

Colonel Littleton

unread,
Nov 29, 2013, 6:34:53 PM11/29/13
to fak...@googlegroups.com
Hey JDB.

In updating my website URL redirects (www.colonellittleton.com) I created a ton of rewrite records that need to be removed. I ran into the same issues stated above. The trick was to put the javascript dismiss ahead of the HTML Element Click. See screenshot: http://screencast.com/t/kAQz2YgSRAR

Worked like a charm. 

Cheers,

-Tanner Tuttle w/ Col. Littleton

On Thursday, August 2, 2012 1:12:27 PM UTC-5, jdb wrote:
That didn't work for me. My previous action is still hanging while waiting for the response. The workflow doesn't move to the next action (neither "dismiss javascript dialog" or "do javascript action") until the javascript is dismissed.
Reply all
Reply to author
Forward
0 new messages