472,958 Members | 2,316 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

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

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

Similar topics

by: Eric-Sebastien Lachance | last post by:
Hey there, I decided to just create a 100% height and width div that filled the space over a background header image, and add an onclick event to redirect to the my index... Doesn't seem to work...
by: johnsuth | last post by:
I want to produce a trivial demonstration of dynamic modification. I thought that pressing a button might change its color. I studied O'Reillys books and successfully created the button with a...
by: Peter | last post by:
Hi, this is the code, and new row and new cell generated ok, but why the onclick and onmouseover doen't work? Thank you in advance! <html> <head> <script language="javascript"> function...
by: Vincent van Beveren | last post by:
Hey everyone, I've looked for this and I wouldn't know what the best practice would be for solving the following problem. We use a BASE tag in our HTML pages. Now we have some links that use...
by: alvin.yk | last post by:
Hi, Normally, a piece of code such as <a href="http://www.yahoo.com" onclick="alert('hello');return false;">link</a> will stop the browser from actually going to href's destination....
by: jesdynf | last post by:
I'm having trouble applying a stylesheet to content I'm generating after the fact. Here's the sample code: <html> <head> <title>CSS/DOM Problem Example</title> <style type="text/css">...
by: jodleren | last post by:
Hi all I have a file I open in a smaller window, like this: <a href="#" onclick="window.open.... but it also causes the main window to jump to the top. What have people done to avoid that?...
by: thaytu888888 | last post by:
Here is my codes in aspx page: <td colspan="2" class="main_menu" runat="server" onclick='toggleDisplay(<%#Eval("description")%>);'><%#Eval("description")%></td> Here is in "View source": ...
by: dangt85 | last post by:
Hello, I have the following page: ... <style type="text/css"> body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.