Newbie needs help

F

frankrentef

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
 
E

Eric Wertman

Is the loginout file named loginout.py ? It needs to be for the
import to work. If the import works, you have to refer to those
variables within the right namespace, ie : loginout.url,
loginout.adminlogin, etc.
 
F

frankrentef

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)
 
F

frankrentef

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top