<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[C_TestMG的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/C_TestMG</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; C_TestMG]]></copyright><item><title><![CDATA[linux服务器配置jpress以及出现的问题记录]]></title><link>https://blog.youkuaiyun.com/C_TestMG/article/details/108998902</link><guid>https://blog.youkuaiyun.com/C_TestMG/article/details/108998902</guid><author>C_TestMG</author><pubDate>Sat, 10 Oct 2020 16:05:45 +0800</pubDate><description><![CDATA[mysql&gt; use jpress;
Database changed
mysql&gt; create user 'jpress'@'%' identified by 'Root123.';
Query OK, 0 rows affected (0.06 sec)

mysql&gt; grant all privileges on *.* to 'jpress'@'%' with grant option;
Query OK, 0 rows affected (0.02 sec)
mys...]]></description><category></category></item><item><title><![CDATA[selenium总结-脑图版]]></title><link>https://blog.youkuaiyun.com/C_TestMG/article/details/108823869</link><guid>https://blog.youkuaiyun.com/C_TestMG/article/details/108823869</guid><author>C_TestMG</author><pubDate>Sun, 27 Sep 2020 11:03:32 +0800</pubDate><description><![CDATA[]]></description><category></category></item><item><title><![CDATA[python操作数据库步骤以及操作过程中经常出现的异常]]></title><link>https://blog.youkuaiyun.com/C_TestMG/article/details/108723663</link><guid>https://blog.youkuaiyun.com/C_TestMG/article/details/108723663</guid><author>C_TestMG</author><pubDate>Tue, 22 Sep 2020 10:14:32 +0800</pubDate><description><![CDATA[第一部分：dos窗口操作，创建相应数据库、表

1、进入mysql ：mysql -uroot -p

2、查看所有数据库：show batabases;

3、创建数据库：create batabase test;

4、选择数据库： use test;

5、创建user表：CREATE TABLE `user` ( `uid` INT PRIMARY KEY AUTO_INCREMENT, `uname` VARCHAR(30) NOT  NULL, `pwd` VARCHAR(30)...]]></description><category></category></item><item><title><![CDATA[pytest框架setup和teardown的调用]]></title><link>https://blog.youkuaiyun.com/C_TestMG/article/details/108695872</link><guid>https://blog.youkuaiyun.com/C_TestMG/article/details/108695872</guid><author>C_TestMG</author><pubDate>Sun, 20 Sep 2020 17:34:02 +0800</pubDate><description><![CDATA['''
模块级（setup_module/teardown_module）在模块始末调用
函数级（setup_function/teardown_function）在函数始末调用(在类外部）
类级（setup_class/teardown_class）在类始末调用（在类中）
方法级（setup_method/teardown_methond）在方法始末调用（在类中）
方法级（setup/teardown）在方法始末调用（在类中）
'''

# -*- coding: utf-8 -*-

def setu.]]></description><category></category></item><item><title><![CDATA[PYTEST中对测试用例标记执行]]></title><link>https://blog.youkuaiyun.com/C_TestMG/article/details/108695247</link><guid>https://blog.youkuaiyun.com/C_TestMG/article/details/108695247</guid><author>C_TestMG</author><pubDate>Sun, 20 Sep 2020 17:00:54 +0800</pubDate><description><![CDATA[标记三种方式：

1、显式指定函数名，通过::标记


pytest test.py :: test01

2、模糊查询，使用-k标识


pytest  -k test test.py

3、使用pytest.mark在函数上标记

  创建pytest.ini文件--注意缩进


[pytest]
markers=
        do: do
        undo: undo

  具体使用：


import pytest
# pytest 的简单使用

class Test_dem...]]></description><category></category></item><item><title><![CDATA[关于pytest自动化测试框架的总结]]></title><link>https://blog.youkuaiyun.com/C_TestMG/article/details/108598135</link><guid>https://blog.youkuaiyun.com/C_TestMG/article/details/108598135</guid><author>C_TestMG</author><pubDate>Tue, 15 Sep 2020 13:53:45 +0800</pubDate><description><![CDATA[]]></description><category></category></item><item><title><![CDATA[selenium中验证码识别简单封装]]></title><link>https://blog.youkuaiyun.com/C_TestMG/article/details/108433143</link><guid>https://blog.youkuaiyun.com/C_TestMG/article/details/108433143</guid><author>C_TestMG</author><pubDate>Sun, 06 Sep 2020 16:31:47 +0800</pubDate><description><![CDATA[先简单封装一下，后续也可将定位元素方法封装，直接调用方法，


import random
import string
import time
import pickle

from lib.ShowapiRequest import ShowapiRequest
from PIL import Image
import os

#   对识别验证码进行封装
def get_code(driver,xpath):
    #   获取验证码图片
    t = time.time()
    #   保存.]]></description><category></category></item><item><title><![CDATA[selenium对验证码识别校验解决方法]]></title><link>https://blog.youkuaiyun.com/C_TestMG/article/details/108432013</link><guid>https://blog.youkuaiyun.com/C_TestMG/article/details/108432013</guid><author>C_TestMG</author><pubDate>Sun, 06 Sep 2020 15:40:53 +0800</pubDate><description><![CDATA[1、进入https://www.showapi.com/apiGateway/view?apiCode=184，

注：需注册，再购买此api，1毛钱玩一个月，看自身需求情况

2、下载sdk，安装requests库，



3、将ShowapiRequest.py文件放至项目中，根据需求复制所需java/python示例文件新建test.py，复制请求示例中的代码

详情如下，

my_appID和my_appSecret都均在我的应用-图片验证码识别找到

r.addBodyPara("typeId".]]></description><category></category></item><item><title><![CDATA[retina屏幕截取验证码]]></title><link>https://blog.youkuaiyun.com/C_TestMG/article/details/108424413</link><guid>https://blog.youkuaiyun.com/C_TestMG/article/details/108424413</guid><author>C_TestMG</author><pubDate>Sat, 05 Sep 2020 20:53:36 +0800</pubDate><description><![CDATA[# 截取全屏
        picture1 = str('yzm1')+'.png'
        self.driver.save_screenshot(picture1)
        # 定位验证码
        code = self.driver.find_element_by_xpath('xxx')
        print(code.location)
        # 定位像素
        left = code.location['x']
      ...]]></description><category></category></item><item><title><![CDATA[pip install pli 提示：Could not find a version that satisfies the requirement PIL]]></title><link>https://blog.youkuaiyun.com/C_TestMG/article/details/108423486</link><guid>https://blog.youkuaiyun.com/C_TestMG/article/details/108423486</guid><author>C_TestMG</author><pubDate>Sat, 05 Sep 2020 19:33:53 +0800</pubDate><description><![CDATA[1、【win64】

pip installpytesseract

pip install pli 提示：


Could not find a version that satisfies the requirement PIL

故：


pip install wheel

pip installPillow-7.2.0-cp37-cp37m-win_amd64.whl

链接：https://pan.baidu.com/s/1PyNhC1TTon2mnNqDFQtDQA
提取码：jsmy

...]]></description><category></category></item><item><title><![CDATA[关于selenium部分元素定位不到的解决办法]]></title><link>https://blog.youkuaiyun.com/C_TestMG/article/details/108422464</link><guid>https://blog.youkuaiyun.com/C_TestMG/article/details/108422464</guid><author>C_TestMG</author><pubDate>Sat, 05 Sep 2020 19:03:27 +0800</pubDate><description><![CDATA[注册页需要勾选隐私，定位勾选框



第一种：使用ActionChains


elem = driver.find_element_by_id('agree')
    actions = ActionChains(driver)
    actions.move_to_element(elem).click().perform()

第二种：用PyAutoGui模块来定位，



PyAutoGui是一个图形用户界面自动化工具，通过屏幕xy坐标系统，确定目标位置，控制鼠标和键盘发送虚拟击键和鼠标点...]]></description><category></category></item><item><title><![CDATA[ERROR 1054 (42S22): Unknown column ‘password‘ in ‘field list‘]]></title><link>https://blog.youkuaiyun.com/C_TestMG/article/details/108363986</link><guid>https://blog.youkuaiyun.com/C_TestMG/article/details/108363986</guid><author>C_TestMG</author><pubDate>Wed, 02 Sep 2020 15:58:21 +0800</pubDate><description><![CDATA[D:\TestSoftware\mysql5731&gt;cd bin

D:\TestSoftware\mysql5731\bin&gt;mysql -uroot -p
Enter password: ****
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.31 MySQL Community Server (GPL)

Copyrig.]]></description><category></category></item><item><title><![CDATA[Navicat  MySQL 连接出现 Authentication plugin ‘caching_sha2_password‘ cannot be loaded]]></title><link>https://blog.youkuaiyun.com/C_TestMG/article/details/108294777</link><guid>https://blog.youkuaiyun.com/C_TestMG/article/details/108294777</guid><author>C_TestMG</author><pubDate>Sat, 29 Aug 2020 15:01:52 +0800</pubDate><description><![CDATA[1、进入mysql ，密码输入当前密码


mysql -u root -p

2、修改账户密码加密规则并更新用户密码


ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY "root";


ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';

3、刷新权限，重置密码


FLUSH PRIVILEGES;

]]></description><category></category></item><item><title><![CDATA[selenium中定位frame中的元素]]></title><link>https://blog.youkuaiyun.com/C_TestMG/article/details/108280439</link><guid>https://blog.youkuaiyun.com/C_TestMG/article/details/108280439</guid><author>C_TestMG</author><pubDate>Fri, 28 Aug 2020 15:22:57 +0800</pubDate><description><![CDATA[from selenium import webdriver
from time import  sleep

class TestCase(object):
    def __init__(self):
        self.driver = webdriver.Chrome()
        self.driver.get('http://sahitest.com/demo/framesTest.htm')
        self.driver.maximize_window()

    .]]></description><category></category></item><item><title><![CDATA[selenium中截屏以及按照时间格式保存到相应文件夹]]></title><link>https://blog.youkuaiyun.com/C_TestMG/article/details/108276026</link><guid>https://blog.youkuaiyun.com/C_TestMG/article/details/108276026</guid><author>C_TestMG</author><pubDate>Fri, 28 Aug 2020 11:14:05 +0800</pubDate><description><![CDATA[#   selenium中对截屏的操作

from selenium import webdriver
from time import sleep, strftime, localtime, time
import os


class TestCase(object):
    # 初始化
    def __init__(self):
        self.driver = webdriver.Chrome()
        self.driver.get('https://www.baidu.]]></description><category></category></item><item><title><![CDATA[Selenium中核心属性以及方法]]></title><link>https://blog.youkuaiyun.com/C_TestMG/article/details/108272544</link><guid>https://blog.youkuaiyun.com/C_TestMG/article/details/108272544</guid><author>C_TestMG</author><pubDate>Fri, 28 Aug 2020 09:19:37 +0800</pubDate><description><![CDATA[一、操作定位元素

selenium提供了定位元素的API，这些方法都被定义在webDriver类中，需要以find开头，

例如：find_Element_by_id('')



二、 Selenium WebDriver属性



三、 Selenium WebDriver方法



四、 WebElement常用属性



五、 WebElement常用方法



六、 selenium操作下拉列表，需要用到select类，下面是一些常用方法



七、 selenium操作弹窗的方法

页面上的弹]]></description><category></category></item><item><title><![CDATA[selenium中关于js脚本的一些操作]]></title><link>https://blog.youkuaiyun.com/C_TestMG/article/details/108252494</link><guid>https://blog.youkuaiyun.com/C_TestMG/article/details/108252494</guid><author>C_TestMG</author><pubDate>Thu, 27 Aug 2020 09:04:20 +0800</pubDate><description><![CDATA[from selenium import webdriver
from time import sleep

'''
selenium中关于js一些常用操作
'''
class TestCase(object):
    def __init__(self):
        self.driver = webdriver.Chrome()
        self.driver.get('http://www.baidu.com')
        self.driver.maximize_window.]]></description><category></category></item><item><title><![CDATA[selenium中鼠标单击、双击、右击和键盘输入、键盘组合键应用]]></title><link>https://blog.youkuaiyun.com/C_TestMG/article/details/108252080</link><guid>https://blog.youkuaiyun.com/C_TestMG/article/details/108252080</guid><author>C_TestMG</author><pubDate>Thu, 27 Aug 2020 08:26:48 +0800</pubDate><description><![CDATA[from selenium import webdriver
from selenium.webdriver import ActionChains
from time import sleep

from selenium.webdriver.common.keys import Keys


class TestCase(object):
    def __init__(self):
        self.driver = webdriver.Chrome()
        self.driv.]]></description><category></category></item><item><title><![CDATA[设计测试用例的思路整理]]></title><link>https://blog.youkuaiyun.com/C_TestMG/article/details/108251636</link><guid>https://blog.youkuaiyun.com/C_TestMG/article/details/108251636</guid><author>C_TestMG</author><pubDate>Thu, 27 Aug 2020 07:15:01 +0800</pubDate><description><![CDATA[]]></description><category></category></item><item><title><![CDATA[selenium函数封装]]></title><link>https://blog.youkuaiyun.com/C_TestMG/article/details/108234028</link><guid>https://blog.youkuaiyun.com/C_TestMG/article/details/108234028</guid><author>C_TestMG</author><pubDate>Wed, 26 Aug 2020 09:52:05 +0800</pubDate><description><![CDATA[from selenium import webdriver
from time import sleep
'''
常规操作：
    1、启动浏览器
    2、访问Url
    3、元素定位
    4、输入
    5.点击
    6.退出
'''
def open_browser(browser_type):
    driver = getattr(webdriver, browser_type)()
    return driver
class TestUtils:
    #   构造.]]></description><category></category></item></channel></rss>