Connecting Tech Pros Worldwide Forums | Help | Site Map

Python - Pamie "onclick" how to handle

Newbie
 
Join Date: Jul 2008
Posts: 4
#1: May 12 '09
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.

Newbie
 
Join Date: Jul 2008
Posts: 4
#2: May 12 '09

re: Python - Pamie "onclick" how to handle


Anybody? Hello? ???
Newbie
 
Join Date: Jul 2008
Posts: 4
#3: May 27 '09

re: Python - Pamie "onclick" how to handle


Can no one assist with this issue? geeez, come on guy/gals....
YarrOfDoom's Avatar
Expert
 
Join Date: Aug 2007
Location: Belgium
Posts: 1,120
#4: May 27 '09

re: Python - Pamie "onclick" how to handle


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.
Newbie
 
Join Date: Sep 2007
Location: Buffalo, NY
Posts: 25
#5: Jul 10 '09

re: Python - Pamie "onclick" how to handle


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....

Quote:
hwnd = wga.findTopWindow(wantedText='File Download')
saveButton = wga.findControl(hwnd, wantedText="Save",wantedClass="Button")
wga.clickButton(saveButton)
Hope this helped.....
Reply