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 · 583 阅读 · 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 · 414 阅读 · 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 · 1409 阅读 · 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 · 421 阅读 · 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 · 1971 阅读 · 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 · 300 阅读 · 0 评论 -
unittest参数化
# -*- coding: utf-8 -*-import unittest class ParametrizedTestCase(unittest.TestCase): """ TestCase classes that want to be parametrized should inherit from this class. """ def __ini原创 2016-03-31 17:00:39 · 1359 阅读 · 1 评论 -
Python excel转xml
#! encoding=utf-8import xlrd import xml.dom.minidom import os def open_excel(file): try: data = xlrd.open_workbook(file) return data except Exception, e: print str(e) de原创 2016-03-31 16:48:37 · 3488 阅读 · 1 评论 -
Python 测试webservice
#! encoding=utf-8 # auth : leikai # 2016-03-30 v1.0 from suds.client import Client from ParametrizedTestCase import ParametrizedTestCase import HTMLTestRunner import unittest import sys reload(sys) sys原创 2016-03-31 16:41:08 · 1613 阅读 · 0 评论 -
Python 操作MySQL数据库
#encoding=utf-8 import os, sys, string, random import MySQLdb reload(sys) sys.setdefaultencoding('utf-8') # 连接数据库 class Mysql: conn = '' cursor = '' def __init__(self, host='127.0.0.1', usr原创 2016-03-31 16:33:47 · 368 阅读 · 0 评论 -
Python 读取excel
#! encoding=utf-8 import xlrd,xlwt import xml.dom.minidom import os,sysclass OpExcel(): table = '' tabledata = [] def __init__(self,path,sheet): try: data = xlrd.open_wo原创 2016-03-31 16:32:34 · 531 阅读 · 0 评论 -
python webdriver 简单框架
以百度搜索为例 一、首先写百度的元素定位类,后期可以用excel表代替,命名为locators.py# -*- coding: utf-8 -*- from selenium.webdriver.common.by import By class BaiduLocator(object): Search_Input = (By.ID,"kw") Search_Submit_Butt原创 2016-03-31 15:36:15 · 2220 阅读 · 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 · 399 阅读 · 0 评论
分享