Newbie request assistance....Python - PAMIE - Java
Greetings all...
Newbie here to the Python world. I've written some basic script with
the purpose of automating testing of an application via Python /
Pamie. I've had pretty good success until a spot I'm testing displays
a Java pop up. I need to have Pamie access the fields in the window
(i.e. add a value and activate the "enter" button.) Can someone
assist.
Some of the code I have currently is as follows...when the script I've
written gets to the end the java window pops up automaticallyI
don't understand how to interface with it.
THNX
ie.textBoxSet('_ctl0_ContentPlaceHolder1_Bocarc1_txtMAX', '5000.00')
time.sleep(2)
ie.textBoxSet('_ctl0_ContentPlaceHolder1_Bocarc1_txtMIN', '0')
time.sleep(2)
ie.buttonClick('_ctl0_ContentPlaceHolder1_Bocarc1_ckCheckMicr')
time.sleep(2)
ie.buttonClick('_ctl0_ContentPlaceHolder1_Bocarc1_ckCheckMicr')
ie.timesleep(2)
ie.textBoxSet('_ctl0_ContentPlaceHolder1_Bocarc1_txtMaxMicrRejects',
'1')
time.sleep(2)
ie.buttonClick('_ctl0_ContentPlaceHolder1_arc1_btnUpdate')
time.sleep2
--
http://mail.python.org/mailman/listinfo/python-list
Python / PAMIE
Can someone help with a PAMIE issue? I'm new to Python / PAMIE and they seem like great tools but to be honest I'm finding that no responses to questions can be found (Experts Exchange, etc.) I'm hoping this will be the place. I tried to duplicate the authors "ie.writeScript" function shown at http://showmedo.com/videos/video?name=pythonMarchettiPamie3&fromSeriesID=25 I get "Attribute not found." I found one reference to where the command was written as "ie.scriptWrite" but that does not work either. I've emailed the author, Experts Exchange and other sites with ZERO responses. Can someone PLEASE assist? THNX -- http://mail.python.org/mailman/listinfo/python-list
Re: Python / PAMIE
On Jul 24, 10:07 am, Tim Golden <[EMAIL PROTECTED]> wrote:
> frankrentef wrote:
> > Can someone help with a PAMIE issue? I'm new to Python / PAMIE and
> > they seem like great tools but to be honest I'm finding that no
> > responses to questions can be found (Experts Exchange, etc.) I'm
> > hoping this will be the place.
>
> > I tried to duplicate the authors "ie.writeScript" function shown at
>
> >http://showmedo.com/videos/video?name=pythonMarchettiPamie3&fromSerie...
>
> I'd rather you posted the code you've tried.
> I'm not too keen on viewing a video just to get
> hold of a piece of code, and in any case that
> would only show me what the author's done.
>
> We need to see what you've done, and what the
> traceback was. Would you mind posting some code,
> please?
>
> Thanks
>
> TJG
THNX for your response. Based on the authors code it's very simple.
from cPAMIE import PAMIE
ie=PAMIE ()
#ie.navigate ("google.com")
#ie.linkClick
#ie.textBoxSet
#ie.writeScript
ie.navigate ('https://login.yahoo.com/config/mail?.intl=us')
#ie.scriptWrite ()
ie.scriptWrite()
Below is the error I get...
File "C:\Python24\lib\site-packages\cPAMIE.py", line 1837, in
scriptWrite
nameProp = getattr(x,"nameProp")
File "C:\Python24\Lib\site-packages\win32com\client\dynamic.py",
line 500, in __getattr__
raise AttributeError, "%s.%s" % (self._username_, attr)
AttributeError: .nameProp
--
http://mail.python.org/mailman/listinfo/python-list
Re: Python / PAMIE
On Jul 24, 10:45 am, Tim Golden <[EMAIL PROTECTED]> wrote:
> frankrentef wrote:
> > THNX for your response. Based on the authors code it's very simple.
>
> > from cPAMIE import PAMIE
> > ie=PAMIE ()
>
> > #ie.navigate ("google.com")
>
> > #ie.linkClick
> > #ie.textBoxSet
> > #ie.writeScript
>
> > ie.navigate ('https://login.yahoo.com/config/mail?.intl=us')
> > #ie.scriptWrite ()
>
> > ie.scriptWrite()
>
> > Below is the error I get...
>
> > File "C:\Python24\lib\site-packages\cPAMIE.py", line 1837, in
> > scriptWrite
> > nameProp = getattr(x,"nameProp")
> > File "C:\Python24\Lib\site-packages\win32com\client\dynamic.py",
> > line 500, in __getattr__
> > raise AttributeError, "%s.%s" % (self._username_, attr)
> > AttributeError: .nameProp
>
> I'm afraid I'm no IE expert (read: never use it if I can
> avoid it) but I suspect here a combination of slightly
> flaky code in the Python module plus, maybe, a change in
> the IE dom object model.
>
> If you change lines 1832-1836 of cPAMIE.py to be as follows:
>
>
> for j in range(doc.length):
> x = doc[j]
> etype = getattr(x,"type", "")
> name = getattr(x,"name", "")
> nameProp = getattr(x,"nameProp", "")
>
>
>
> then at least some kind of output is produced. But I'm
> not entirely sure what this function is trying to achieve
> so I don't guarantee it's doing the right thing yet.
>
> TJG- Hide quoted text -
>
> - Show quoted text -
The idea is to run through a given url, detect any "form fields" that
require populating and build a script listing the field names, etc.
>From there a PAMIE user can take the script returned and build a test
case. In other words the user does not have to search through the
HTML code for all the field names (blanks) radio button names, etc.
It works "great" on the video tutorial but dang if I or any of our
senior guys can get it to work here in house. THNX for input, we'll
give it a try.
--
http://mail.python.org/mailman/listinfo/python-list
Python / PAMIE - scriptWrite Function
In using PAMIE 2.0 specifically the "scripWrite" function I'm getting the following error... File "C:\Python23\Lib\site-packages\win32com\client\dynamic.py", line 489, in _getattr_ further states... raise AttributeError, "%s.%s" % (self._username_, attr) Help... :) -- http://mail.python.org/mailman/listinfo/python-list
Re: Python / PAMIE - scriptWrite Function
On Jul 29, 1:26 pm, frankrentef <[EMAIL PROTECTED]> wrote:
> In using PAMIE 2.0 specifically the "scripWrite" function I'm getting
> the following error...
>
> File "C:\Python23\Lib\site-packages\win32com\client\dynamic.py", line
> 489, in _getattr_
>
> further states...
>
> raise AttributeError, "%s.%s" % (self._username_, attr)
>
> Help... :)
Further messages found are:
C:\Python23\lib\site-packages\win32com\client\dynamic.py:476:
FutureWarning: %u/%o/%x/%X of negative int will return a signed string
in Python 2.4 and up
debug_attr_print("Getting property Id 0x%x from OLE object" %
retEntry.dispid)
--
http://mail.python.org/mailman/listinfo/python-list
HELP - Attribute Error, no matter what I do on PAMIE...
Greetings all. I'm new to PAMIE and I've watched / followed to PAMIE
videos on Show me Do. I've tried to duplicate the "scriptWrite"
function in an attempt to automate the forms process... without
success.
Can someone PLEASE Assist!?
I'm using the following code
from cPAMIE import PAMIE
#Imports - used to setup / control finding files
import time
import os
import sys
import cReport
#import elementtree.ElementTree as ET
#Create New Pamie Object
ie=PAMIE()
ie=Visible =1
t=time
ie=PAMIE ()
ie.navigate ('http://bir1edptest2/iswebcommander/fi/default.aspx')
ie.scriptWrite()
And getting the following error
Atribute Error:.nameProp
File "C:\PYCODE\scriptWrite TEST.py", line 19, in ?
ie.scriptWrite()
File "C:\Python24\Lib\site-packages\cPAMIE.py", line 1837, in
scriptWrite
nameProp = getattr(x,"nameProp")
File "C:\Python24\Lib\site-packages\win32com\client\dynamic.py", line
496, in __getattr__
raise AttributeError, "%s.%s" % (self._username_, attr)
--
http://mail.python.org/mailman/listinfo/python-list
Run program from within Python
Greetings all...
Newbie to Python... need help with opening a file from within
Python... see the following code.
import popen2
stdout, stdin = popen2.popen2('c:\test\OpenProgram.exe 1 1')
keygen = stdout.read()
print "The keygen value is: %s" % keygen
from the command line if I execute "OpenProgram.exe 1 1" a number is
returned. ("1 1" are required to return the value needed.) Ultimately
I want to take that number and apply it to another script, but the
program is not running.
Suggestions?
NEWBIE to Python..
--
http://mail.python.org/mailman/listinfo/python-list
Re: Run program from within Python
THNX for the links... lotta reading for the newbie! -- http://mail.python.org/mailman/listinfo/python-list
Create a short way to save typing script over and over....
I have a statement "url = 'http://xyzserver/'" so in my code every
time I need to use xyzserver I state "url +"
What I' m now trying to do is create a call to a login process. The
script for the login process is below. I'd like to call "adminlogin"
and not have to keep entering the same several lines of script each
and everytime (I'm testing various login functions and rule changes.)
I'm a newbie, can someone walk me through this?
THNX
#Login to ISeDeposit Admin
ie.navigate (url + 'isweb/admin/default.aspx')
ie.textBoxSet ('AdminLogin1:Username','Admin')
ie.textBoxSet ('AdminLogin1:inputPassword','Password')
ie.buttonClick ('AdminLogin1:btnLogin')
--
http://mail.python.org/mailman/listinfo/python-list
Calling "def" functions from another file.
Newbie here I'm writing a Python program that has "def" functionality growing in leaps and bounds. I'm a newbie to Python so be detailed. Is there a way to create a py file with all the "def's" listed and just call them from the "program" py file? How would I do this? Say my "def" py file was named def.py and the program file was named "program.py" THNX -- http://mail.python.org/mailman/listinfo/python-list
Newbie needs help
Greetings all,
I'm wanting to maintain what values in one file and call them in
another. The purpose being to keep a single location where url's,
login's and passwords can be maintained, then called as needed from
another file.
In file #1 I have...
import time
import os
import sys
url = 'http://zoo/'
adminlogin = 'Zebra'
adminpassword = 'Zebra12$'
-
In file #2 I have the following...
from cPAMIE import PAMIE
#Imports - used to setup / control finding files
import time
import os
import sys
import loginout#name of the file retaining all url/login info
from log import log
#Create New Pamie Object
ie=PAMIE()
ie=Visible =1
t=time
adminlogin (ie,url)
if ie.findText ('Site Status: Active'):
log ('PASSED -- ADMIN Module - ADMIN Login & Admin Tab Navigation
Successful')
else:
log ('WARNING -- ADMIN Module Login & Admin Tab Navigation
FAILED')
time.sleep(2)
What am I doing incorrectly to not have file two log in when
executed. All files are in the same directory. Keep it simple...
I'm new at this.
THNX
--
http://mail.python.org/mailman/listinfo/python-list
Re: Newbie needs help
On Aug 26, 11:46 am, frankrentef <[EMAIL PROTECTED]> wrote:
> Greetings all,
>
> I'm wanting to maintain what values in one file and call them in
> another. The purpose being to keep a single location where url's,
> login's and passwords can be maintained, then called as needed from
> another file.
>
> In file #1 I have...
>
> import time
> import os
> import sys
>
> url = 'http://zoo/'
>
> adminlogin = 'Zebra'
> adminpassword = 'Zebra12$'
>
> -
>
> In file #2 I have the following...
>
> from cPAMIE import PAMIE
>
> #Imports - used to setup / control finding files
> import time
> import os
> import sys
> import loginout #name of the file retaining all url/login info
> from log import log
>
> #Create New Pamie Object
> ie=PAMIE()
> ie=Visible =1
> t=time
>
> adminlogin (ie,url)
> if ie.findText ('Site Status: Active'):
> log ('PASSED -- ADMIN Module - ADMIN Login & Admin Tab Navigation
> Successful')
> else:
> log ('WARNING -- ADMIN Module Login & Admin Tab Navigation
> FAILED')
> time.sleep(2)
>
> What am I doing incorrectly to not have file two log in when
> executed. All files are in the same directory. Keep it simple...
> I'm new at this.
>
> THNX
Yes, the first file is named loginout.py
Would the second file need something akin to...
loginout.admin (ie,url,adminlogin)
--
http://mail.python.org/mailman/listinfo/python-list
Re: Newbie needs help
Help, I'm missing / still not grasping something
My "loginout" file contains the following...
from cPAMIE import PAMIE
#Imports - used to setup / control finding files
import time
import os
import sys
url = 'http://test2/'
adminlogin = 'Gorillia'
adminpassword = 'Gorillia1$'
#Admin Login Def Function
def adminlogin(ie,url):
ie.navigate (url + 'isweb/admin/default.aspx')
time.sleep(2)
ie.textBoxSet ('AdminLogin1:txtUsername','adminlogin')
time.sleep(2)
ie.textBoxSet ('AdminLogin1:inputPassword','adminpassword')
time.sleep(2)
ie.buttonClick ('AdminLogin1:btnLogin')
time.sleep(2)
My "main" Python file contains...
from cPAMIE import PAMIE
import time
import os
import sys
import loginout
from log import log
ie=PAMIE()
ie=Visible =1
t=time
ie=PAMIE ()
#++
+
adminlogin (ie, url, adminlogin)
if ie.findText ('Site Status: Active'):
log ('PASSED -- ADMIN Module - ADMIN Login & Admin Tab Navigation
Successful')
else:
log ('WARNING -- ADMIN Module Login & Admin Tab Navigation
FAILED')
time.sleep(2)
All that happens is an I.E. session comes up with the url
"about:blank" in the address.
What am I doing incorrectly.
THNX
--
http://mail.python.org/mailman/listinfo/python-list
Using strftime
I have one line of code that put's an old date in my code.
ie.textBoxSet('_ct10_PlaceHolder_txtEnd', '8/15/2008')
What I wish to do in another similiar line is have the field populated
with the current system date? How best to do this? I've read some of
the strftime documentation but as of yet I'm unable to get it to work
correctly.
Help is appreciated.
THNX
--
http://mail.python.org/mailman/listinfo/python-list
