首页 文章 精选 留言 我的

精选列表

搜索[搭建],共10000篇文章
优秀的个人博客,低调大师

Selenium + Python + Chrome 自动化测试 环境搭建

一、下载Python 相关的教程很多,此处不详细记录了,下面是官网下载地址: https://www.python.org/downloads/ 我使用的python版本为 Python 3.6.1 注意:下载完成后配置python和pip的环境变量 二、下载Selenium 如果环境变量配置成功,在命令提示符下输入以下指令即可安装 pip install -U selenium 出现 Successfully 表示下载成功 三、下载对应驱动 官网(需要科学上网): https://sites.google.com/a/chromium.org/chromedriver/downloads 第三方: https://npm.taobao.org/mirrors/chromedriver 下载后放至 "C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe" 并添加环境变量 四、运行Python # -*- coding: utf-8 -*- from selenium import webdriver driver = webdriver.Chrome() driver.maximize_window() driver.get('http://www.baidu.com') 注意:此处运行后我报了有关driver的错误,理论上应该配了环境变量就可以了,但是配置了还是有错,最后的方法是将下载的driver放到与python文件相同的目录下 成功运行后可以自动打开百度的首页,就代表环境配置成功啦!

优秀的个人博客,低调大师

Appium+Python3+iOS真机环境搭建

前言: Appium 是一个自动化测试开源工具,支持 iOS 平台和 Android 平台上的原生应用,web 应用和混合应用。 本次环境配置相关: macOS:10.13.4 Appium-desktop:1.6.1 Xcode:9.3.1 一、环境配置 1、 安装homebrew: $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 2、 安装libimobiledevice: $ brew install libimobiledevice --HEAD 3、 安装carthage: $ brew install carthage 4、安装node: $ brew install node 5、安装npm: $ brew install npm 6、安装ios-deploy: $ npm install -g ios-deploy 8、安装xcpretty: $ gem install xcpretty 9、安装appium,appium-doctor 进入官网,下载Appium-1.6.1.dmg,安装即可。 当然你可以使用命令:npm install -g appium来安装appium,但是后面就会各种报错!!(别问我是怎么知道的,我搞了2天。) $ npm install -g appium-doctor 10、使用appium-doctor 检查Appium iOS环境环境 appium-doctor --ios info AppiumDoctor Appium Doctor v.1.4.3 info AppiumDoctor ### Diagnostic starting ### info AppiumDoctor The Node.js binary was found at: /usr/local/bin/node info AppiumDoctor Node version is 10.1.0 info AppiumDoctor Xcode is installed at: /Applications/Xcode.app/Contents/Developer info AppiumDoctor Xcode Command Line Tools are installed. info AppiumDoctor DevToolsSecurity is enabled. info AppiumDoctor The Authorization DB is set up properly. info AppiumDoctor Carthage was found at: /usr/local/bin/carthage info AppiumDoctor HOME is set to: /Users/wangjuan info AppiumDoctor ### Diagnostic completed, no fix needed. ### info AppiumDoctor info AppiumDoctor Everything looks good, bye! info AppiumDoctor 二、安装WebDriverAgent 1、进入appium安装目录下WebDriverAgent文件夹,具体路径参照自己的路径,可以通过find命令查找 cd /Applications/Appium.app/Contents/Resources/app /node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent 2、在WebDriverAgent目录下执行以下命令 mkdir -p Resources/WebDriverAgent.bundle sh ./Scripts/bootstrap.sh 3、编译WebDriverAgent.xcodeproj Xcode打开当前目录下的WebDriverAgent.xcodeproj文件 WebDriverAgent.xcodeproj.png 注意️:进入项目后要编辑一些内容,请无比按照步骤全部修改。步骤见下图!! 1、TARGETS->WebDriverAgentLib的Bundle Identifier更改为自己命名的Identifier。(所有Identifier注意保持一致!!) 2、TARGETS->WebDriverAgentLib的Signing选择使用个人的证书。 image.png 3、TARGETS->WebDriverAgentRunner的Signing选择使用个人的证书。 image.png 4、PROJECT->WebDriverAgent的Product Bundle Identifier更改为自己命名的Identifier。(所有Identifier注意保持一致!!) image.png 5、TARGETS->WebDriverAgentLib的Product Bundle Identifier更改为自己命名的Identifier。(所有Identifier注意保持一致!!) image.png 6、TARGETS->WebDriverAgentRunner的Product Bundle Identifier更改为自己命名的Identifier。(所有Identifier注意保持一致!!) image.png 7、Device选择已连接的测试机 8、点击build按钮来测试,按照步骤设置后,可build succeeded~ image.png 9、测试机上安装证书,执行以下命令: xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=测试机的udid' test 如果没有报错证明安装成功,同时手机上会安装一个WebDriverAgent软件。需要在手机设置->通用->设备管理->信任开发者。如下图: image.png image.png 三、Appium Client端 Appium Client有Ruby,Python,Java三个版本,可自行选择自己喜欢的安装即可,本次只针对Python版安装: pip install Appium-Python-Client 以上,接下来可以定位元素,推荐使用App Inspector,开始iOS自动化之旅吧~~

优秀的个人博客,低调大师

使用ECS和mysql搭建mysql服务器

一、首先得在阿里云等云主机上申请两台主机 二、现在连上去安装mysql 1、通过安装源将mysql下载下来 [root@iz2ze2llim71y07x3numlbz ~]# wget 'https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm' --2018-03-26 16:52:00-- https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm 正在解析主机 dev.mysql.com (dev.mysql.com)... 137.254.60.11 正在连接 dev.mysql.com (dev.mysql.com)|137.254.60.11|:443... 已连接。 已发出 HTTP 请求,正在等待回应... 302 Found 位置:https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm [跟随至新的 URL] --2018-03-26 16:52:02-- https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm 正在解析主机 repo.mysql.com (repo.mysql.com)... 104.127.195.16 正在连接 repo.mysql.com (repo.mysql.com)|104.127.195.16|:443... 已连接。 已发出 HTTP 请求,正在等待回应... 200 OK 长度:25680 (25K) [application/x-redhat-package-manager] 正在保存至: “mysql57-community-release-el7-11.noarch.rpm” 2、将源里面的信息读取出来 [root@iz2ze2llim71y07x3numlbz ~]# rpm -Uvh mysql57-community-release-el7-11.noarch.rpm 警告:mysql57-community-release-el7-11.noarch.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY 准备中... ################################# [100%] 正在升级/安装... 1:mysql57-community-release-el7-11 ################################# [100%] 3、安装mysql 方法一:安装下载包 [root@iz2zeap06av7ci1sytmil8z ~]# ls mysql57-community-release-el7-11.noarch.rpm [root@iz2zeap06av7ci1sytmil8z ~]# yum -y install mysql57-community-release-el7-11.noarch.rpm 已加载插件:fastestmirror 正在检查 mysql57-community-release-el7-11.noarch.rpm: mysql57-community-release-el7-11.noarch mysql57-community-release-el7-11.noarch.rpm 将被安装 正在解决依赖关系 方法二:直接安装最新的服务器版本 [root@iz2ze2llim71y07x3numlbz ~]# yum -y install mysql-community-server 已加载插件:fastestmirror base | 3.6 kB 00:00 epel | 4.7 kB 00:00 extras | 3.4 kB 00:00 mysql-connectors-community | 2.5 kB 00:00 4、安装完毕 已安装: mysql-community-libs.x86_64 0:5.7.21-1.el7 mysql-community-libs-compat.x86_64 0:5.7.21-1.el7 mysql-community-server.x86_64 0:5.7.21-1.el7 作为依赖被安装: libaio.x86_64 0:0.3.109-13.el7 mysql-community-client.x86_64 0:5.7.21-1.el7 mysql-community-common.x86_64 0:5.7.21-1.el7 替代: mariadb-libs.x86_64 1:5.5.56-2.el7 完毕! 5、启动mysql [root@iz2ze2llim71y07x3numlbz ~]# service mysqld start Redirecting to /bin/systemctl start mysqld.service [root@iz2ze2llim71y07x3numlbz ~]# 6、查看是否已经启动了(如下就是已经启动了) [root@iz2ze2llim71y07x3numlbz ~]# systemctl status mysqld ● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: active (running) since 一 2018-03-26 17:03:05 CST; 50s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 10570 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS) Process: 10497 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Main PID: 10575 (mysqld) CGroup: /system.slice/mysqld.service └─10575 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/my... 3月 26 17:02:57 iz2ze2llim71y07x3numlbz systemd[1]: Starting MySQL Server... 3月 26 17:03:05 iz2ze2llim71y07x3numlbz systemd[1]: Started MySQL Server. 7、查看初始密码 [root@iz2zeap06av7ci1sytmil8z ~]# grep "password" /var/log/mysqld.log 2018-03-26T09:03:00.568391Z 1 [Note] A temporary password is generated for root@localhost: qAC(+wqJp8dA [root@iz2ze2llim71y07x3numlbz ~]# 8、修改密码 [root@iz2ze2llim71y07x3numlbz ~]# 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.21 Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> 9、修改密码设置规则 mysql> set global validate_password_policy=0; Query OK, 0 rows affected (0.00 sec) 10、设置密码 mysql> SET PASSWORD FOR 'root'@'localhost' = 'hello123456'; Query OK, 0 rows affected (0.00 sec) 11、接下来就可以远程连接了

优秀的个人博客,低调大师

Android 快应用环境搭建(Windows和Mac通用)

快应用官网 快应用官方文档 1. 安装Node.js 图1.png 尽量按照官网推荐的来安装对应包。 查看Node.js版本 node -v 图2.png 2. 安装hap-toolkit # npm设置国内镜像 npm config set registry https://registry.npm.taobao.org # npm查看镜像 npm config get registry # 通过npm仓库安装 npm install -g hap-toolkit # 验证是否安装成功 hap -V 图3.png 3. 资源下载 下载调试器和预览版工具 图4.png 4. 创建项目 创建项目hap init <ProjectName> hap init HelloWorld 图5.png 项目根目录主要结构如下: ├── sign rpk包签名模块 │ └── debug 调试环境 │ ├── certificate.pem 证书文件 │ └── private.pem 私钥文件 ├── src │ ├── Common 公用的资源和组件文件 │ │ └── logo.png 应用图标 │ ├── Demo 页面目录 │ | └── index.ux 页面文件,可自定义页面名称 │ ├── app.ux APP文件,可引入公共脚本,暴露公共数据和方法等 │ └── manifest.json 项目配置文件,配置应用图标、页面路由等 └── package.json 定义项目需要的各种模块及配置信息 安装npm依赖-进入项目的根目录再执行命令 npm install 手动编译项目 npm run build 自动编译项目 npm run watch 5. 安装应用 扫码安装 # 开启Http服务器 npm run server # 自定义端口的Http服务器 npm run server -- --port 8080

资源下载

更多资源
优质分享App

优质分享App

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册
修改密码
忘记密码