[Tutor] Pop Up Window Problem

2007-07-24 Thread Amit Saxena
Hi,

This is Amit Saxena here, I am working as a Senior QA Engineer with Ketera
Technologies, Bangalore.

I am trying to automate a Test Scenario using Python 2.5, in that particular
scenario there is a Pop Up window which i am not able to handle, can you
please help in that.

For automation purposes, i am using PAMIE, ctypes and pywin32 libraries.

Waiting for a reply.

Thanks and Regards,
Amit Saxena
Senior QA Engineer
Ketera
Direct: +91 4199 5028
Mobile: +91 99001 18641
[EMAIL PROTECTED]

» Visit us at http://www.ketera.com
» Watch the demo at http://www.ketera.com/resources/demos.html
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Pop Up Window Problem

2007-07-24 Thread Amit Saxena
It is a Java Web Application, and its basically a JSP Page which gets
dynamically populated through the Pick Helper Tag. This is the initial level
script i had created, you can have a look at it:

# To use Pamie you must first create a new script or text file that you can
saveas mytest.py.

# This will import the class files so you can use it's methods

#from ctypes import windll, c_string

#import elementtree.ElementTree as ET

from cPAMIE import PAMIE

#from cModalPopUp import handlePopup

# create a new instance of the PAMIE object
ie = PAMIE( )

# Navigates to the Application
if ie.navigate("http://localhost.ketera.com:8080/kcm/HomePage/HomePage.do";):
print "URL Clicked"

ie.textBoxSet("username", "[EMAIL PROTECTED]" ) #control name, value
ie.textBoxSet("password", "abc123" ) #control name, value

# Now Submit the form.
if ie.imageClick("loginButton" ):
print "Image Clicked"
else:
print "Image not Present"

if ie.navigate("
http://localhost.ketera.com:8080/kcm/ListCatalogProcess/ViewProcessListCreateProcess.do";
):
print "URL Clicked"

ie.listBoxSelect("buyer", "AU Office")

ie.imageClick("search-page.gif")

on clicking this image, i get that Pop Up window and now i m in a fix what
to do next as the browser is not able to identify the window, I tried the
cModal Popup library but no help

Amit



On 7/24/07, Kent Johnson <[EMAIL PROTECTED]> wrote:
>
> Amit Saxena wrote:
>
> > I am trying to automate a Test Scenario using Python 2.5, in that
> > particular scenario there is a Pop Up window which i am not able to
> > handle, can you please help in that.
> >
> > For automation purposes, i am using PAMIE, ctypes and pywin32 libraries.
>
> More details might be helpful. What kind of window? What is the
> application? In what way are you not able to handle the window? What
> have you tried?
>
> Kent
>



-- 
Amit Saxena
Senior QA Engineer
Ketera
Direct: +91 4199 5028
Mobile: +91 99001 18641
[EMAIL PROTECTED]

» Visit us at http://www.ketera.com
» Watch the demo at http://www.ketera.com/resources/demos.html
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] How can I execute a PL/SQL Procedure directly through python rather than executing it through Command Prompt

2007-07-30 Thread Amit Saxena
Hi

Can anybody help me in how to connect Python to oracle and then to execute
an already existing PL/SQL Procedure through Python.

-- 
Thanks and Regards,
Amit Saxena
Senior QA Engineer
Ketera
Direct: +91 4199 5028
Mobile: +91 99001 18641
[EMAIL PROTECTED]

» Visit us at http://www.ketera.com
» Watch the demo at http://www.ketera.com/resources/demos.html
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How can I execute a PL/SQL Procedure directly through

2007-07-30 Thread Amit Saxena
I m on Windows Platform, was trying to use cx_oracle library but no success

On 7/30/07, Greg Lindstrom <[EMAIL PROTECTED]> wrote:
>
> >Can anybody help me in how to connect Python to oracle and then to
> execute
> >an already existing PL/SQL Procedure through Python.
>
> What platform are you running?  Windows?  Linux?  Mac?
>
> I've used Oracle and plSql for years and will be happy to help out once I
> know what you need.
>
> --greg
>
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>


-- 
Thanks and Regards,
Amit Saxena
Senior QA Engineer
Ketera
Direct: +91 4199 5028
Mobile: +91 99001 18641
[EMAIL PROTECTED]

» Visit us at http://www.ketera.com
» Watch the demo at http://www.ketera.com/resources/demos.html
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How can I execute a PL/SQL Procedure directly through

2007-07-30 Thread Amit Saxena
I m still not able to run a Procedure

from cx_Oracle import makedsn
import adodb

db = adodb.NewADOConnection('oci8')
connection_string = makedsn("10.200.91.27", 1521, "scorpio")   #<== your
values here, of course
db.Connect(connection_string, "kcmdev", "devkcm")  #<== and here, too

#query = "SELECT * from USER_ROLE where ROLE_FK = 29"
results = db.Execute("metadata.sql")
print results


is giving an error saying

Traceback (most recent call last):
  File "D:/Python/sql.py", line 9, in 
results = db.Execute("metadata.sql")
  File "C:\Python25\Lib\site-packages\adodb\adodb.py", line 274, in Execute
c = self._query(sql,params)
  File "C:\Python25\Lib\site-packages\adodb\adodb.py", line 265, in _query
raise sys.exc_info()[0] ,str(err)+': '+sql
DatabaseError: ORA-00900: invalid SQL statement
: metadata.sql




On 7/30/07, Greg Lindstrom <[EMAIL PROTECTED]> wrote:
>
> My Oracle connection is set up using the adodb module (
> http://adodb.sourceforge.net/).  I don't remember why we set it up that
> way...we haven't touched this part of our code for almost 2 years!.
>
> from cx_Oracle import makedsn
> import adodb
>
> db = adodb.NewADOConnection('oci8')
> connection_string = makedsn(ip, port, database)   <== your values here, of
> course
> db.Connect(connection _string, username, password)  <== and here, too
>
> query = "SELECT name_of_pgSQL_routine(%(argument1)s, %(argument2)s)"
> results = db.execute(query, locals())
>
> and go from there.  Let me know if yo have other questions.
>
> HTH,
>
> --greg
>
>
>


-- 
Thanks and Regards,
Amit Saxena
Senior QA Engineer
Ketera
Direct: +91 4199 5028
Mobile: +91 99001 18641
[EMAIL PROTECTED]

» Visit us at http://www.ketera.com
» Watch the demo at http://www.ketera.com/resources/demos.html
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How can I execute a PL/SQL Procedure directly through

2007-07-30 Thread Amit Saxena
It is a complete PL/SQL Cursor which is written in this "metadata.sql" file

On 7/30/07, Greg Lindstrom <[EMAIL PROTECTED]> wrote:
>
>
>
> On 7/30/07, Amit Saxena <[EMAIL PROTECTED]> wrote:
> >
> >
> > I m still not able to run a Procedure
> >
> > from cx_Oracle import makedsn
> > import adodb
> >
> > db = adodb.NewADOConnection('oci8')
> > connection_string = makedsn(" 10.200.91.27 ", 1521, "scorpio")   #<==
> > your values here, of course
> > db.Connect(connection_string, "kcmdev", "devkcm")  #<== and here, too
> >
> > #query = "SELECT * from USER_ROLE where ROLE_FK = 29"
> > results = db.Execute("metadata.sql")
> > print results
> >
> >
> > is giving an error saying
> >
> > Traceback (most recent call last):
> >   File "D:/Python/sql.py", line 9, in 
> > results = db.Execute("metadata.sql")
> >   File "C:\Python25\Lib\site-packages\adodb\adodb.py", line 274, in
> > Execute
> > c = self._query(sql,params)
> >   File "C:\Python25\Lib\site-packages\adodb\adodb.py", line 265, in
> > _query
> > raise sys.exc_info()[0] ,str(err)+': '+sql
> > DatabaseError: ORA-00900: invalid SQL statement
> > : metadata.sql
> >
>
> What is in metadata.sql?  If it is a PL/SQL query, then you should "SELECT
> metadata()".  If is a file containing sql (is the pl/sql you wish to execute
> in this file?) then I'm not sure how to proceed.
>
> Is the PL/SQL you wish to run saved in Oracle?  Can you show us what's in
> the metadata.sql file?
>
> --greg
>



-- 
Thanks and Regards,
Amit Saxena
Senior QA Engineer
Ketera
Direct: +91 4199 5028
Mobile: +91 99001 18641
[EMAIL PROTECTED]

» Visit us at http://www.ketera.com
» Watch the demo at http://www.ketera.com/resources/demos.html
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How can I execute a PL/SQL Procedure directly through

2007-07-30 Thread Amit Saxena
this is the file content of "metadata.sql"

set serveroutput on

CREATE OR REPLACE PROCEDURE Create_Process_Team (org_id IN VARCHAR2,
org_desc IN VARCHAR2, org_team IN VARCHAR2, sessioner_id IN VARCHAR2) IS

ptt_id KCM_PROCESS_TEAM_TEMPLATE.ID%TYPE;
pt_id KCM_PROCESS_TEAM.ID%TYPE;

BEGIN

select HIBERNATE_SEQUENCE.NEXTVAL into ptt_id from dual;
select HIBERNATE_SEQUENCE.NEXTVAL into pt_id from dual;

--METADATA
--Entry in Process Team Template Table
insert into
KCM_PROCESS_TEAM_TEMPLATE(ID,VERSION,DESCRIPTION,ORG_FK,NAME)
values(ptt_id,0,org_desc,org_id,org_team);

--Entry in Process Team Template Type Table
insert into KCM_PROCESS_TEAM_TEMPLATE_TYPE(PROCESS_TEAM_TEMPLATE_FK,
PROCESS_TYPE_FK) values(ptt_id, 3);

--Entry in Process Team Role Table
--Sessioner
INSERT INTO KCM_PROCESS_TEAM_ROLE(ID, VERSION, ROLE_FK, ORG_TYPE_FK,
IS_HIERARCHICAL, PROCESS_TEAM_TEMPLATE_FK, IS_OPTIONAL)
values(HIBERNATE_SEQUENCE.NEXTVAL,0,29,2,1,ptt_id,0);


--CREATING WORKFLOW TEAM
--Entry in Process Team Table
INSERT INTO KCM_PROCESS_TEAM (ID, VERSION, DESCRIPTION, NAME,
CUSTOMER_RELATIONSHIP_FK, ISTEMPLATE,ORG_FK) VALUES(pt_id, 0,
org_desc,org_team, NULL, 1, org_id);

--Entry in Team User Table
--Insert Sessioner
insert into KCM_TEAM_USER(ID,VERSION,USER_FK,ROLE_FK,PROCESS_TEAM_FK)
values(HIBERNATE_SEQUENCE.NEXTVAL,0,sessioner_id,'29',pt_id);

--Entry in Team Type Table
insert into KCM_PROCESS_TEAM_TYPE values(pt_id,4);

END;
/

On 7/30/07, Amit Saxena <[EMAIL PROTECTED]> wrote:
>
> It is a complete PL/SQL Procedure which is written in this "metadata.sql"
> file
>
> On 7/30/07, Greg Lindstrom < [EMAIL PROTECTED]> wrote:
> >
> >
> >
> > On 7/30/07, Amit Saxena <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > > I m still not able to run a Procedure
> > >
> > > from cx_Oracle import makedsn
> > > import adodb
> > >
> > > db = adodb.NewADOConnection('oci8')
> > > connection_string = makedsn(" 10.200.91.27 ", 1521, "scorpio")   #<==
> > > your values here, of course
> > > db.Connect(connection_string, "kcmdev", "devkcm")  #<== and here, too
> > >
> > > #query = "SELECT * from USER_ROLE where ROLE_FK = 29"
> > > results = db.Execute("metadata.sql")
> > > print results
> > >
> > >
> > > is giving an error saying
> > >
> > > Traceback (most recent call last):
> > >   File "D:/Python/sql.py", line 9, in 
> > > results = db.Execute("metadata.sql")
> > >   File "C:\Python25\Lib\site-packages\adodb\adodb.py", line 274, in
> > > Execute
> > > c = self._query(sql,params)
> > >   File "C:\Python25\Lib\site-packages\adodb\adodb.py", line 265, in
> > > _query
> > > raise sys.exc_info()[0] ,str(err)+': '+sql
> > > DatabaseError: ORA-00900: invalid SQL statement
> > > : metadata.sql
> > >
> >
> > What is in metadata.sql?  If it is a PL/SQL query, then you should
> > "SELECT metadata()".  If is a file containing sql (is the pl/sql you wish to
> > execute in this file?) then I'm not sure how to proceed.
> >
> > Is the PL/SQL you wish to run saved in Oracle?  Can you show us what's
> > in the metadata.sql file?
> >
> > --greg
> >
>
>
>
> --
> Thanks and Regards,
> Amit Saxena
> Senior QA Engineer
> Ketera
> Direct: +91 4199 5028
> Mobile: +91 99001 18641
> [EMAIL PROTECTED]
>
> » Visit us at http://www.ketera.com
> » Watch the demo at http://www.ketera.com/resources/demos.html
>



-- 
Thanks and Regards,
Amit Saxena
Senior QA Engineer
Ketera
Direct: +91 4199 5028
Mobile: +91 99001 18641
[EMAIL PROTECTED]

» Visit us at http://www.ketera.com
» Watch the demo at http://www.ketera.com/resources/demos.html
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How can I execute a PL/SQL Procedure directly through

2007-07-30 Thread Amit Saxena
ya i m trying to execute the procedure,these were the contents of that SQL
file which i m trying to execute

On 7/30/07, Kent Johnson <[EMAIL PROTECTED]> wrote:
>
> Your original query asked how to execute an existing stored procedure.
> This is the SQL code to *create* a stored procedure. Are you trying to
> create it or execute it?
>
> Kent
>
> Amit Saxena wrote:
> > this is the file content of "metadata.sql"
> >
> > set serveroutput on
> >
> > CREATE OR REPLACE PROCEDURE Create_Process_Team (org_id IN VARCHAR2,
> > org_desc IN VARCHAR2, org_team IN VARCHAR2, sessioner_id IN VARCHAR2) IS
> >
> > ptt_id KCM_PROCESS_TEAM_TEMPLATE.ID%TYPE;
> > pt_id KCM_PROCESS_TEAM.ID%TYPE;
> >
> > BEGIN
> >
> > select HIBERNATE_SEQUENCE.NEXTVAL into ptt_id from dual;
> > select HIBERNATE_SEQUENCE.NEXTVAL into pt_id from dual;
> >
> > --METADATA
> > --Entry in Process Team Template Table
> > insert into
> > KCM_PROCESS_TEAM_TEMPLATE(ID,VERSION,DESCRIPTION,ORG_FK,NAME)
> > values(ptt_id,0,org_desc,org_id,org_team);
> >
> > --Entry in Process Team Template Type Table
> > insert into KCM_PROCESS_TEAM_TEMPLATE_TYPE(PROCESS_TEAM_TEMPLATE_FK,
> > PROCESS_TYPE_FK) values(ptt_id, 3);
> >
> > --Entry in Process Team Role Table
> > --Sessioner
> > INSERT INTO KCM_PROCESS_TEAM_ROLE(ID, VERSION, ROLE_FK, ORG_TYPE_FK,
> > IS_HIERARCHICAL, PROCESS_TEAM_TEMPLATE_FK, IS_OPTIONAL)
> > values(HIBERNATE_SEQUENCE.NEXTVAL,0,29,2,1,ptt_id,0);
> >
> >
> > --CREATING WORKFLOW TEAM
> > --Entry in Process Team Table
> > INSERT INTO KCM_PROCESS_TEAM (ID, VERSION, DESCRIPTION, NAME,
> > CUSTOMER_RELATIONSHIP_FK, ISTEMPLATE,ORG_FK) VALUES(pt_id, 0,
> > org_desc,org_team, NULL, 1, org_id);
> >
> > --Entry in Team User Table
> > --Insert Sessioner
> >     insert into
> > KCM_TEAM_USER(ID,VERSION,USER_FK,ROLE_FK,PROCESS_TEAM_FK)
> > values(HIBERNATE_SEQUENCE.NEXTVAL,0,sessioner_id,'29',pt_id);
> >
> > --Entry in Team Type Table
> > insert into KCM_PROCESS_TEAM_TYPE values(pt_id,4);
> >
> > END;
> > /
> >
> > On 7/30/07, *Amit Saxena* <[EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>> wrote:
> >
> > It is a complete PL/SQL Procedure which is written in this
> > "metadata.sql" file
> >
> > On 7/30/07, *Greg Lindstrom* < [EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>> wrote:
> >
> >
> >
> > On 7/30/07, *Amit Saxena* <[EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>> wrote:
> >
> >
> > I m still not able to run a Procedure
> >
> > from cx_Oracle import makedsn
> > import adodb
> >
> > db = adodb.NewADOConnection('oci8')
> > connection_string = makedsn(" 10.200.91.27
> > <http://10.200.91.27>", 1521, "scorpio")   #<== your values
> > here, of course
> > db.Connect(connection_string, "kcmdev", "devkcm")  #<== and
> > here, too
> >
> > #query = "SELECT * from USER_ROLE where ROLE_FK = 29"
> > results = db.Execute("metadata.sql")
> > print results
> >
> >
> > is giving an error saying
> >
> > Traceback (most recent call last):
> >   File "D:/Python/sql.py", line 9, in 
> > results = db.Execute("metadata.sql")
> >   File "C:\Python25\Lib\site-packages\adodb\adodb.py", line
> > 274, in Execute
> > c = self._query(sql,params)
> >   File "C:\Python25\Lib\site-packages\adodb\adodb.py", line
> > 265, in _query
> > raise sys.exc_info()[0] ,str(err)+': '+sql
> > DatabaseError: ORA-00900: invalid SQL statement
> > : metadata.sql
> >
> >
> > What is in metadata.sql?  If it is a PL/SQL query, then you
> > should "SELECT metadata()".  If is a file containing sql (is the
> > pl/sql you wish to execute in this file?) then I'm not sure how
> > to proceed.
> >
> > Is the PL/SQL you wish to run saved in Oracle?  Can you show us
> > what's in the metadata.sql file?
> >
&g

Re: [Tutor] Noob question

2007-12-10 Thread Amit Saxena
The simplest way i could think of:

a=["apple","orange","banana"]
b = ""
for i in range(len(a)):
 b += a[i]
print b


Amit

On Dec 10, 2007 6:48 AM, Alan Gauld <[EMAIL PROTECTED]> wrote:

> "Eric Walstad" <[EMAIL PROTECTED]> wrote
>
> > You could also achieve the same result of concatenating a list of
> > strings by looping over the list items like so:
> >
> > b = ''
> > for fruit in a:
> >b += fruit
> >
> > print b
>
> And to add to the options you could use the formatting operator
> provided you know there are only 3 items,
>
> b = "%s%s%s" % tuple(a)
>
> Or for an indefinite number of strings:
>
> b = "%s" * len(a)
> b = b % tuple(a)
>
> So many options. However, to the OP, if you get stuck in
> future its best if you post the erroneous code that you have tried,
> then we can better see where you have gone wrong and thus
> provide clearer guidance on how to fix it. Its better to learn to
> do it your own way correctly than just to see other folks
> attempts .
>
> HTH,
>
> --
> Alan Gauld
> Author of the Learn to Program web site
> http://www.freenetpages.co.uk/hp/alan.gauld
>
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Noob question

2007-12-10 Thread Amit Saxena
Hi Eric,

Thanks for the information..since i m new to Python so didnt
knew about this fact...thanks again for it, will keep it in mind
while writing such a program.

Amit

On Dec 10, 2007 8:57 PM, Eric Brunson <[EMAIL PROTECTED]> wrote:

>
> Hi Amit,
>
> This is fairly inefficient.  Because strings in python are immutable
> this approach causes a new string to be created every iteration.  While
> it may not be an issue with just 3 strings, it is much better to create
> your list and use "".join() to create the concatenation after the list
> is complete.  When you get used to it, it's a bit more concise and
> readable, also.
>
> Sincerely,
> e.
>
> Amit Saxena wrote:
> > The simplest way i could think of:
> >
> > a=["apple","orange","banana"]
> > b = ""
> > for i in range(len(a)):
> >  b += a[i]
> > print b
> >
> >
> > Amit
> >
> > On Dec 10, 2007 6:48 AM, Alan Gauld <[EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>> wrote:
> >
> > "Eric Walstad" <[EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>> wrote
> >
> > > You could also achieve the same result of concatenating a list of
> > > strings by looping over the list items like so:
> > >
> > > b = ''
> > > for fruit in a:
> > >b += fruit
> > >
> > > print b
> >
> > And to add to the options you could use the formatting operator
> > provided you know there are only 3 items,
> >
> > b = "%s%s%s" % tuple(a)
> >
> > Or for an indefinite number of strings:
> >
> > b = "%s" * len(a)
> > b = b % tuple(a)
> >
> > So many options. However, to the OP, if you get stuck in
> > future its best if you post the erroneous code that you have tried,
> > then we can better see where you have gone wrong and thus
> > provide clearer guidance on how to fix it. Its better to learn to
> > do it your own way correctly than just to see other folks
> > attempts .
> >
> > HTH,
> >
> > --
> > Alan Gauld
> > Author of the Learn to Program web site
> > http://www.freenetpages.co.uk/hp/alan.gauld
> >
> > ___
> > Tutor maillist  -  Tutor@python.org <mailto:Tutor@python.org>
> > http://mail.python.org/mailman/listinfo/tutor
> >
> >
> >
> > 
> >
> > ___
> > Tutor maillist  -  Tutor@python.org
> > http://mail.python.org/mailman/listinfo/tutor
> >
>
>


-- 
Thanks and Regards,
Amit Saxena
Senior QA Engineer
Ketera
Direct: +91 4199 5028
Mobile: +91 99001 18641
[EMAIL PROTECTED]

» Visit us at http://www.ketera.com
» Watch the demo at http://www.ketera.com/resources/demos.html
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor