python
fqlike
这个作者很懒,什么都没留下…
展开
-
厕所
coding=utf-8import unittest import sys sys.path.append(r’./ars’) from common import HTMLTestRunner import os,timefrom apscheduler.scheduler import Schedulerfrom common import mailutilfrom conf impo原创 2016-04-26 14:58:15 · 526 阅读 · 0 评论 -
oracle
import cx_Oracle as orcl from conf import configdef query(sql, username, passwd, host, port, sid): ”’ :param username: 用户名 :param passwd: 密码 :param host: 地址 :param port: 端口原创 2016-04-26 14:51:52 · 333 阅读 · 0 评论 -
mail
!/bin/env pythoncoding=utf-8import email import mimetypes from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText from email.MIMEImage import MIMEImage from email.MIMEAud原创 2016-04-26 14:49:46 · 1321 阅读 · 0 评论 -
logunit
-- coding: utf-8 --import logging from conf import config import time import osdef initLog(logfile):if os.path.exists(config.logpath) != True: os.makedirs(config.logpath)logfile = config.logpat原创 2016-04-26 14:49:07 · 365 阅读 · 0 评论 -
excellibrary
!/usr/bin/env pythonCopyright 2013-2014 NaviNet Inc.#Licensed under the Apache License, Version 2.0 (the “License”);you may not use this file except in compliance with the License.You may obtain a copy原创 2016-04-26 14:48:11 · 1890 阅读 · 0 评论 -
上传文件
upload_button = self.driver.find_element(*ImportLocators.Import_Order_Button) upload_button.click() upload_window = win32gui.GetForegroundWindow() win32gui.SetForegroundWindo原创 2016-04-26 14:44:32 · 245 阅读 · 0 评论 -
unittest参数化
# -*- coding: utf-8 -*-import unittestclass ParametrizedTestCase(unittest.TestCase): """ TestCase classes that want to be parametrized should inherit from this class. """ def __ini原创 2016-03-31 17:00:39 · 1281 阅读 · 1 评论 -
Python excel转xml
#! encoding=utf-8import xlrdimport xml.dom.minidomimport osdef open_excel(file): try: data = xlrd.open_workbook(file) return data except Exception, e: print str(e)de原创 2016-03-31 16:48:37 · 3344 阅读 · 1 评论 -
Python 测试webservice
#! encoding=utf-8# auth : leikai# 2016-03-30 v1.0from suds.client import Clientfrom ParametrizedTestCase import ParametrizedTestCaseimport HTMLTestRunnerimport unittestimport sysreload(sys)sys原创 2016-03-31 16:41:08 · 1552 阅读 · 0 评论 -
Python 操作MySQL数据库
#encoding=utf-8import os, sys, string, randomimport MySQLdbreload(sys)sys.setdefaultencoding('utf-8')# 连接数据库 class Mysql: conn = '' cursor = '' def __init__(self, host='127.0.0.1', usr原创 2016-03-31 16:33:47 · 307 阅读 · 0 评论 -
Python 读取excel
#! encoding=utf-8import xlrd,xlwtimport xml.dom.minidomimport os,sysclass OpExcel(): table = '' tabledata = [] def __init__(self,path,sheet): try: data = xlrd.open_wo原创 2016-03-31 16:32:34 · 461 阅读 · 0 评论 -
python webdriver 简单框架
以百度搜索为例 一、首先写百度的元素定位类,后期可以用excel表代替,命名为locators.py# -*- coding: utf-8 -*-from selenium.webdriver.common.by import Byclass BaiduLocator(object): Search_Input = (By.ID,"kw") Search_Submit_Butt原创 2016-03-31 15:36:15 · 2108 阅读 · 0 评论 -
webdriver 执行js
send_start_day = self.driver.find_element(*AutoorderLocators.Send_Start_Day_Input) self.driver.execute_script(“$(arguments[0]).removeAttr(arguments[1])”, send_start_day, “readonly”)原创 2016-05-03 09:49:12 · 339 阅读 · 0 评论