470,575 Members | 1,766 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,575 developers. It's quick & easy.

Python - Pamie "onclick" how to handle

Newbie needs detailed help on an issue involving the use of a popup (Java) window. Simply I need to fire / activate the "OK" portion of the window.

I'm using Pamie to generate automated testing and so far everyting has gone well until I ran across a pop up window.

My test script in part is as follows:
Expand|Select|Wrap|Line Numbers
  1. #Navigate to Remove account
  2. ie.navigate(url + '/profile/RemoveAccount.aspx?Inst=Institution%20Auto%20Test&Company=Company%20Auto%20Test&Site=Site%20Auto%20Test')
  3. time.sleep(2)
  4. #Select "Company 2" for deletion
  5. ie.buttonClick('GID_852963742')
  6. time.sleep(2)
  7. #Delete Profile    
  8. ie.buttonClick('_ctl0_ContentPlaceHolder1_RemoveAccount1_btnDelete')  
  9. time.sleep(2)
At this point the pop up window is displayed. In the view source window of I.E. the following is found:

<input type="submit" name="_ctl0:ContentPlaceHolder1:RemoveAccount1:btn Delete" value="Delete" onclick="return confirm('Are you sure you want to delete the selected accounts?');" language="javascript" id="_ctl0_ContentPlaceHolder1_RemoveAccount1_btnDe lete" />

The pop up box displays an "OK" and a "Cancel" button. I wish to "fire" the "OK".

Can some one please provide details / hand hold how to handle this? I've read about thirty post on various boards, many taking far different approaches. Some examples given have 30-40 lines of code just to activate the "OK" button and I'm not schooled enough in Python / PAMIE to understand what the sample code is doing.

The help is appreciated.
May 12 '09 #1
5 5302
Anybody? Hello? ???
May 12 '09 #2
Can no one assist with this issue? geeez, come on guy/gals....
May 27 '09 #3
1,247 Expert 1GB
Frankrentef, please understand that this forum consists of people who do this voluntarily, and thus that there isn't always a person here who knows the solution to the problems posted.

Now, correct me if I'm wrong, but PAMIE seems a bit underpowered for this, so you might have to take a look at some other way to do this.
May 27 '09 #4
Read up on and try WinGuiAuto. It should help you get an instance of the popup window and "click" the ok button. brief example of clicking the "Save" button on "File Download" pop-up....

Expand|Select|Wrap|Line Numbers
  1. hwnd = wga.findTopWindow(wantedText='File Download')
  2. saveButton = wga.findControl(hwnd, wantedText="Save",wantedClass="Button")
  3. wga.clickButton(saveButton)
Hope this helped.....
Jul 10 '09 #5
Hi Silgd1,

You're a lifesaver. I went through hours and hours searching for how to click on a javascript alert(), and this solved it in less than five minutes.

Thank you!
Jul 25 '10 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

10 posts views Thread by Eric-Sebastien Lachance | last post: by
5 posts views Thread by johnsuth | last post: by
2 posts views Thread by Peter | last post: by
2 posts views Thread by Vincent van Beveren | last post: by
11 posts views Thread by jesdynf | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.