question on javascript dialog box handling

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information:CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
im_newbie
Posts: 9
Joined: Thu Oct 20, 2005 12:46 am

question on javascript dialog box handling

Post by im_newbie » Thu Oct 20, 2005 12:58 am

Please bear with me as I'm still getting use to this.

I ran the macro for Demo-OnJavascript Dialog and I don't understand a couple things.

So I'm recording this macro session of me running the Demo-OnJavascript Dialog.

When I clicked on the "Ask me a question" button I notice that the following line gets run, which is fine:

TAG POS=1 TYPE=INPUT:BUTTON FORM=NAME:NoFormName ATTR=NAME:&&VALUE:Ask<SP>me<SP>a<SP>question

However the following separate dialog box that comes about as a result of clicking on above button asks me "Do you want to change the background of this page to yellow?" Ok/Cancel doesn't seem to get recorded?

And there seems to be no action associated with it.

I'm trying to handle a similar case with another test program that I'm writing but can't seem to figure out how to answer that dialog box since it doesn't seem to be recorded whatsoever?

And if it isn't recorded how do I respond to that dialog box?

Or am I reading something wrong here?

Thanks.
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Post by Tech Support » Thu Oct 20, 2005 9:05 pm

Did you switch to RECORDING mode? You should see a IM dialog box directly under the browser dialog box. You need to make your selection in the IM dialog box (not the browser dialog). Your selection will then be send to the web page and the action recorded.

This is how it should look:
Image
im_newbie
Posts: 9
Joined: Thu Oct 20, 2005 12:46 am

Post by im_newbie » Thu Oct 20, 2005 9:17 pm

I did switch to RECORDING MODE. I did see an IM dialog box and I did click OK in there.

So the problem is more like this when I try to record the DemoJavaScript dialog page

http://www.iopus.com/iim/demo/v4/dialogs/javascript.htm

just as you had mentioned and click on the OK in the IM dialog box after clicking on the second button and then try to rerun that new macro script I get the following


VERSION BUILD=5001020
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=http://www.iopus.com/iim/demo/v4/dialogs/javascript.htm
SIZE X=801 Y=602
ONDIALOG POS=1 BUTTON=OK CONTENT=
WINCLICK X=180 Y=228 CONTENT=

where the dialog box is not responded to even though the above line is there

ONDIALOG POS=1 BUTTON=OK CONTENT=

Am I missing or misunderstanding something?

Also if the Dialog Box was a Yes or No value could I do the following

ONDIALOG POS=1 BUTTON=YES CONTENT=

Thanks
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Post by Tech Support » Thu Oct 20, 2005 9:35 pm

Do you have clickmode set to WINCLICK? That would explain the problem. It should be set to automatic.

To change it, click on the "clickmode" button in the recording tab.
Guest

Post by Guest » Thu Oct 20, 2005 9:58 pm

So with regards to your feedback that seemed to solve this issue I had with the demo, however it doesn't solve a closely related problem I had that I was trying to expand upon using this as an example of something similair.

So I have the case on a page where I have to upload a file by clicking on a field and using WINCLICK to right the location of the file to upload.

After that I need to press on an upload submit button which then generates a dialog box asking if I'm sure if I want to do this. It's this dialog box that I can't seem to respond to. I just need to click on the 'Yes' button. I would have thought that it would have been something like this.

ONDIALOG POS=1 BUTTON=YES CONTENT=
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:upload ATTR=NAME:uploadDATA&&VALUE:File<SP>Upload

But in trying to use this syntax it just hangs.

So in the above case I can't get away from using WINCLICK. Are there any recommendations you can make regarding this?

Also if I use WINCLICK during recording then I can't go switch back mid way? What is the signifcance between the two?
Post Reply