473,385 Members | 1,615 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,385 software developers and data experts.

cPAMIE - Python interface to IE

2
Hi,

I just tried to run a sample test by the following script:

import cPAMIE as PAMIE
ie = PAMIE( )
ie.Navigate("'www.google.com" )
ie.textBoxSet("q", "python" )
ie.buttonClick("'btnG" )


But am getting the following error.

Traceback (most recent call last):
File "C:\pamie\MyTest.py", line 8, in ?
ie = PAMIE( )
TypeError: 'module' object is not callable


Can any one tell me the reason for this failure.Is there any other open source tool which uses python for Web testing.

Thanks,
Aswin.
Sep 13 '06 #1
6 7806
bartonc
6,596 Expert 4TB
If cPAMIE is a module and there is function or class in it named PAMIE, call that function or class like this:

import cPAMIE
cPAMIE.PAMIE()

If you

import cPAMIE as PAMIE

then it's:

PAMIE.PAMIE()

which can get confusing.
Another thing that is useful, but is often discouraged is

from cPAMIE import *

which means import all names form the module into the current namespace.

You can then simply call:
PAMIE().

Have fun!
Sep 13 '06 #2
bartonc
6,596 Expert 4TB
Hi All,

someone please help me with this.. I have just set up PAMIE cPAMIE.pyc etc in the Python24 root which is not explained anywhere.. So I'm not even sure if I have that set up correctly (but IE opens so I assume its right). My biggest problem at the mo is this..

C:\>PamieTEST.py
Traceback (most recent call last):
File "C:\PamieTEST.py", line 8, in ?
ie.Navigate("http://10.3.0.60/")
AttributeError: PAMIE instance has no attribute 'Navigate'

the code is below

from winGuiAuto import win32gui
from cPAMIE import PAMIE
from cModalPopUp import handlePopup
import time,os,sys,os.path

ie = PAMIE()
ie.Navigate("http://10.3.0.60/")

Why is this happening, is my module incorrectly set or do I need to install something else. Can someone also point me to some documentation explaining how to actually set up new modules in Python so I don't have to trial and error every tedious thing.

Thanks,
easy
Jan 2 '07 #3
bartonc
6,596 Expert 4TB
Here is a link to a previous discussion.
Jan 2 '07 #4
bartonc
6,596 Expert 4TB
Here is a link to a previous discussion.
I haven't tested this:
Expand|Select|Wrap|Line Numbers
  1. # To use Pamie you must first create a new script or text file that you can saveas mytest.py. 
  2.  
  3. # This will import the cPAMIE class file so you can use it's methods 
  4.  
  5. from cPAMIE import PAMIE 
  6.  
  7. # create a new instance of the PAMIE object 
  8.  
  9. ie = PAMIE( ) 
  10.  
  11. # Lets navigate to google - this methods takes a string as the URL 
  12.  
  13. ie.navigate("'www.google.com" ) 
  14.  
  15. ie.textBoxSet("q", "python" ) #control name, value 
  16.  
  17. # Now Submit the form. 
  18.  
  19. ie.buttonClick("'btnG" ) 
  20.  
but it should work now after changing "Navigate" to "navigate".
this site's documentation has not been updated lately and has no "feedback" area for me to get them to fix it.
Jan 2 '07 #5
bartonc
6,596 Expert 4TB
Hi All,

someone please help me with this.. I have just set up PAMIE cPAMIE.pyc etc in the Python24 root which is not explained anywhere.. So I'm not even sure if I have that set up correctly (but IE opens so I assume its right). My biggest problem at the mo is this..

C:\>PamieTEST.py
Traceback (most recent call last):
File "C:\PamieTEST.py", line 8, in ?
ie.Navigate("http://10.3.0.60/")
AttributeError: PAMIE instance has no attribute 'Navigate'

the code is below

from winGuiAuto import win32gui
from cPAMIE import PAMIE
from cModalPopUp import handlePopup
import time,os,sys,os.path

ie = PAMIE()
ie.Navigate("http://10.3.0.60/")

Why is this happening, is my module incorrectly set or do I need to install something else. Can someone also point me to some documentation explaining how to actually set up new modules in Python so I don't have to trial and error every tedious thing.

Thanks,
easy
I broke down and unzipped cPAMIE tonight. Since you can import it there is no issue there, but I put things like this in D:\Python24\Lib\site-packages. site-packages are not disturbed when you update python and most msi's unpack there. The problem is that some smart-alec changed the name to 'navigate' (small "n"). Have fun!
Jan 3 '07 #6
bartonc
6,596 Expert 4TB
Honestly, people, there really is an easyrider27. He/she is just not a member yet. I'm not going crazy or posting the hear the sound of my own keyboard. This clever person figured out how to post a question without signing up. I have high hopes that this person will become a member of our community, as we need all the clever people we can get posting in this forum.
Jan 3 '07 #7

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

Similar topics

0
by: Phillip J. Eby | last post by:
PEP: 333 Title: Python Web Server Gateway Interface v1.0 Version: $Revision: 1.1 $ Last-Modified: $Date: 2004/08/27 17:30:09 $ Author: Phillip J. Eby <pje at telecommunity.com> Discussions-To:...
75
by: Xah Lee | last post by:
http://python.org/doc/2.4.1/lib/module-re.html http://python.org/doc/2.4.1/lib/node114.html --------- QUOTE The module defines several functions, constants, and an exception. Some of the...
0
by: calfdog | last post by:
I am pleased to announce version cPAMIE 1.6 the Web automation tool for Internet explorer. If your looking for a fast way, easy to learn way to drive your browser check out PAMIE. Is PAMIE...
8
by: Joakim Persson | last post by:
Hello all. I am involved in a project where we have a desire to improve our software testing tools, and I'm in charge of looking for solutions regarding the logging of our software (originating...
1
by: Sam R | last post by:
Hi, I am new to Python, and PAMIE has been a very useful tool for my website functionality testing. I was wondering if anyone knows how to do the following testcases with either PAMIE or Python....
0
by: Silgd1 | last post by:
Hey everyone, I'm trying to automate a webpage using cPamie in conjection with python 2.4. I can get to the page and login. when I try to click the login button, I receive an out of index error....
1
by: romo20350 | last post by:
Hi, I'm in need of help with cPAMIE. I'm currently trying to submit this form on a webpage: <form action="" method="post"> <fieldset> <legend>Submit Coupon</legend> <label...
1
by: jloyzaga | last post by:
import sys import cPAMIE url = sys.argv dom = cPAMIE.PAMIE(url) how can I maximize the current active browser?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.