# 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...
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。中间不需...
首先,不要把你的模块名写成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...
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
#-*- 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"
} ...
<?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 ...