webtest--python

# coding=utf-8 from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By class WeTes...
2017-01-16 17:25 | 阅读 2226 次 | 评论 0 条

python去掉每行中的换行符 取整数范围

eslid = open(r"D:\test.txt").readlines() for line in eslid: line = line.strip('\n') print server.send_cmd('ESL_QUERY_REALTIME',[{"eslid":line}]) def jb1(self): print 'jb1 start' +ctime() n = 0 jb1_eslid = open(r".\118.txt").readlines() #数据格式为eslid+sku。中间不需...
2016-10-19 10:27 | 阅读 46023 次 | 评论 0 条

python socket 1

首先,不要把你的模块名写成socket.py ,因为python自动把当前目录的py文件当作模块来import了 # -*- coding: utf-8 -*- import socket,sys from fileinput import filename host = "" port = 51423 s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1) s.bi...
2016-08-10 09:31 | 阅读 46211 次 | 评论 0 条

python pyc

python -m compileall %JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar;%JMETER_HOME%\lib\ext\ApacheJMeter_core.jar;%JMETER_HOME%\lib\jorphan.jar;%JMETER_HOME%\lib\logkit-2.0.jar
2016-08-09 17:02 | 阅读 10725 次 | 评论 0 条

python shopweb urllib2

#-*- coding:UTF-8 -*- import urllib2 import urllib import cookielib import re login_url = 'http://192.168.2.127:8080/shopweb/login' bind_url = 'http://192.168.2.127:8080/shopweb/bind'; # 登陆用户名和密码 data={ "username":"chengtao", "password":"000000" } ...
2016-08-09 16:21 | 阅读 101756 次 | 评论 0 条

python class train3

<?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> ...
2016-03-29 15:28 | 阅读 11511 次 | 评论 0 条

python class train 2

在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...
2016-03-28 14:18 | 阅读 11852 次 | 评论 0 条

python lei

#-*- 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...
2016-03-27 18:40 | 阅读 11907 次 | 评论 1 条

python train2

#-*- 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[...
2016-03-25 15:52 | 阅读 11801 次 | 评论 0 条

python train1

#-*- 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...
2016-03-25 15:43 | 阅读 11976 次 | 评论 0 条

python auto software test 2

注册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...
2016-03-24 09:22 | 阅读 11440 次 | 评论 0 条

python auto software test 1

传参有返回 __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 ...
2016-03-24 09:10 | 阅读 11381 次 | 评论 0 条
浏览2354300次