<?xml version="1.0" encoding="utf-8"?>
<LoginData>
<login001>
<url1>http://192.168.242.128:8088/Tinyshop/</url1>
<user>a@a.com</user>
<passwd>123456</passwd>
<type1>xpath</type1>
<value1>.//*[@id='header']/div[1]/div/ul/li[1]/a</value1>
...
在used包中新建suckpy文件,次为被调py文件(函数库)
#-*- coding:UTF-8 -*- # 解码方式
__author__ = 'suck'
from selenium import webdriver
class Login():
def BrowOpen(self,url): #定义浏览器登录动作
global bruce
bruce = webdriver.Firefox()
bruce.maximize_window() # max windows
bru...
#-*- coding:UTF-8 -*- # 解码方式
__author__ = 'poptest'
import unittest
import time
from selenium import webdriver
class RegUser(unittest.TestCase):
def setUp(self):
global bruce
bruce = webdriver.Firefox() #start firfox brower .bruce定义为火狐浏览器
bruce.ma...
#-*- coding:UTF-8 -*- # 解码方式
__author__ = 'poptest'
import time
from selenium import webdriver
sh = webdriver.Firefox()
from selenium.webdriver.common.action_chains import ActionChains
def editinfor():
#点击收货地址
#sh.find_element_by_xpath(".//*[@id='header']/div[2]/div/div[...
#-*- coding:UTF-8 -*- # 解码方式
__author__ = 'pop'
from selenium import webdriver #
import time
def testLogin(testname,testpassword,repass,revtype,realvalue):
bruce = webdriver.Firefox() #start firfox brower .bruce定义为火狐浏览器
bruce.maximize_window() # max windows
bruce.get...
注册7条case
#-*- coding:UTF-8 -*- # 解码方式
__author__ = 'pop'
from selenium import webdriver
import time
def testLogin(testname,testpassword,revtype,realvalue):
bruce = webdriver.Firefox() #start firfox brower .bruce定义为火狐浏览器
bruce.maximize_window() # max window...
传参有返回
__author__ = 'pop'
def add(c,d):
s = c + d
return s
def sub(g,h):
s = g - h
return s
def mul(m,n):
s = m * n
return s
def mov(o,p):
s = o / p
return s
a = input("please enter number")
b = input("please enter next number")
j ...