#-*- coding:UTF-8 -*-
'''
'''
import time
from appium import webdriver
descried_caps={}
descried_caps["unicodeKeyboard"] = "True"
descried_caps["resetKeyboard"] = "True"
descried_caps['device']='2014813'
descried_caps['platformName']='Android'
descried_caps['deviceName']='...
import smtplib
from email.mime.text import MIMEText
from email.MIMEMultipart import MIMEMultipart
class SendEmailReporter(object):
def SendMail(self,filename):
sender = 'mobile@139.com'
receiver = ['554646@qq.com','554646@qq.com']
subject = "test report"...
import unittest,time
from publicfunction import sendEmail
n = sendEmail.SendEmailReporter()
from publicfunction import PublicFunClass
m = PublicFunClass.PublicFunClass()
from publicfunction import readXml
yang = readXml.denglu1()
from publicfunction import sendReport
k = sendReport.sendR...
#-*- coding:UTF-8 -*- #
'''
Created on 2016-4-8
@author: poptest
'''
import time
from appium import webdriver
class PublicFunClass(object):
def clickAct(self,getType,getValue):
if getType == "id":
return lee.find_element_by_id(getValue).click()
...
#-*- coding:UTF-8 -*- #
'''
Created on 2016-4-8
@author: poptest
'''
import time
from appium import webdriver
class PublicFunClass(object):
def clickAct(self,getType,getValue): #将点击动作封装成def
if getType == "id":
return lee.find_element_by_id(getValue).click...
#-*- coding:UTF-8 -*- #
'''
Created on 2016-4-8
@author: poptest
'''
import time
from appium import webdriver
class PublicFunClass(object):
def addgoodsaddress(self,userName,userTel,userAddr):
time.sleep(3)
#登陆进去,点击头像、
lee.fin...
#-*- coding:UTF-8 -*- #
'''
Created on 2016-4-8
@author: poptest
'''
import time
from appium import webdriver
class PublicFunClass(object):
def addgoodsaddress(self):
time.sleep(3)
#登陆进去,点击头像、
lee.find_element_by_id("com.subje...
#-*- coding:UTF-8 -*- #
'''
Created on 2016-4-8
@author: poptest
'''
import time
from appium import webdriver
def addgoodsaddress():
time.sleep(3)
#登陆进去,点击头像、
lee.find_element_by_id("com.subject.zhongchou:id/avatar_img").click()
time.sleep(2)
#点击地址
lee.f...
-----------------------------------
create table biao1(
stid smallint(4) zerofill primary key auto_increment,
stname varchar(20),
sex char(5),
area char(50)
)charset utf8
insert into stubase(stid,stname,sex,area) values (0001,"李小龙","男","中国香港");
insert into biao1(stid,s...
<?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 ...
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
mmo1: TMemo;
mmo2: TMemo;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sen...
uses DateUtils
●function DateOf(const AValue: TDateTime): TDateTime;
描述:
使用 DateOf 函数用来把一个 TDateTime 类型的变量转变成一个只带有日期的 TDateTime 类型变量。
例如:
showmessage(DateTimetostr(dateof...
时间函数在窗体中可以直接使用。如果是无窗体的还是需要声明,下面是实现对象。
program Project1;
uses
Messages, SysUtils,Dialogs;
{$R *.res}
function MyDateTime(StartDate, EndDate, Preaching: TDateTime): Boolean;
begin
Result:=false;
if (Preaching>=StartDate)and(Preaching>=EndDate) then
Result:=true;
end;...
program Project1;
uses
Windows, Messages, SysUtils,
Dialogs, StdCtrls,Tlhelp32,shellapi; //DateUtils 用时间需要定义
{$R *.res}
function CheckTask(ExeFileName: string): Boolean; //监视进程函数
const
PROCESS_TERMINATE=$0001;
var
ContinueLoop: BOOL;
FSnapshotHandle: THandle;
FProcessEntry32: TPro...