473,395 Members | 1,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 5561
Anybody? Hello? ???
May 12 '09 #2
Can no one assist with this issue? geeez, come on guy/gals....
May 27 '09 #3
YarrOfDoom
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
Silgd1
25
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
@Silgd1
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

10
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...
5
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...
2
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...
2
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...
13
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....
11
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">...
4
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?...
4
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": ...
5
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; }
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.