自动化测试基本环境的搭建_第1页
自动化测试基本环境的搭建_第2页
自动化测试基本环境的搭建_第3页
自动化测试基本环境的搭建_第4页
自动化测试基本环境的搭建_第5页
已阅读5页,还剩25页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、1安装python程序python 2.7 setup下一步> 下一步->finish2配置环境变量把python的安装路径添加到系统环境变量path中:萦统厘性计算机名|硕件高级系统保护,远程系纟潁重(s)si值"numberof.pr.2rjoswindows_ntpath%java_home%bin;xjava_hdme%jre.pathfxtrnm exe- rat cmp- vrs- re删除q新逢儈) 编辑a).取消确走t: usersadmimstrattr>pythonpython 2.7 (r27:82525二_ . -j10, 09:01 59)

2、 msc v 1500 32 bit anttl) on typt "holp", "copyright" "credit," or licenst* for more information.»>python安装成功3安装setuptools(直接装框架selenium的话容易出错,所以我下载了个工具辅助安装)下载女装setuptools ,解压setuptools压缩包后,用命令提示符转到安装包中 setup.py所在的位置,执行setup.py install ,进行安装h3 855- c:windowssyst

3、em32cmd.exe1 巳1< d>c:c: usersadftini str&tor>cd c : setuptools"28. 8. 0进入解压路径c: setuptools-28. 8. 0>dir 駆动器c中的卷是系统 卷的序列号是000a-e8a8c:stiupiools-28. 8. 0 的目录2016/11/08 2016/11/08 2016/11/04 2016/11/04 2016/11/04 2016/11/08 2016/11/04 2016/11/04 2016/11/04 2016/11/04 2016/11/04 201

4、6/11/04 2016/11/04 2016/11/08 2016/11/04 2016/11/04 2016/11/04 2016/11/04 2016/11/08 2016/11/08 2016/11/08 2016/11/0809 91a 1a 1a 1a o c? cd333737373373737373737333737337333348<uir> <dir><dir><dir><dir> <dir> <dir> <dir> 个文件 个目录5,593 bootstrap, py95,67

5、4 changes, rst240 conftest, pydocs126 easy_install. py10 317 ltuncher. c1,078 license414 manifest in640 msvc*bui 1 d-laux(ch«r cd902 pavement, py13, 250 pkg-infopk_resources440 pytest. ini10,255 readme, rst435 setup, cfc6,928seup py_ 确定路径下有setup.supt v vl ssetuptools*28 & 0 setuptools t

6、1;sts 143,292 字节487,247,360旨用字节匚:、stuptools28 8. 0/setup, py install4安装pip (保持电脑联网)o回母打开cmd命令行,将目录切换至ic:python27scripts下,输入命令"easyjnstall pip 安装pip ;si 誉理员:c:windowssystem32cmd.exec: python27scripts>dir 驱动器c中的卷是系统 卷的序列号是000a-e8a8c:python27scripts 的目录2016/11/082016/11/082016/11/082016/11/0820

7、16/11/082016/11/082016/11/082016/11/0809:4209:4209:4209:4209:4209:4209:4209:426个文件2个目录<dir>5r>43065, 53665142265 536647easy_install-2 7-script py asy_install*2 7. exe asy_install-2.7. exe mui fest t tsy_i nst ell- scr i p t pyns t all.exeeasexe mgi fest133,222 宁节 5,481,246,720 可用字节c:'py

8、thon27scripts>tasy_install piosearching for pipreading https:/pypi. python, org/simple/pip/dovnlotding https:/pypi. python, org/pack&c<s/11/b6/abcb52s026a4be042b486df43905d tar c35f01 dt33009719497f01 «4b«69<i53c9|best match: pip 9. 0.1pr*c«ssins pip-90. 1. tar <zwriti

9、nc c:usersadminilappd<talocaltempeasy_install-lf2f00pip-9. 0. lsttupruiming pi p-9.01 setup. py -q bdist_egg dist-dir c: vusersvadihinilvappdattmoc tmp-rnemgw<rninc warning x<rninc wtrninc waning warning waning warningprtvi ously-included prtviously-included previously-included pr«vi o

10、usly*included previ ously-included previ ousl jr- i ncluded previ ously-included prtvi ouslyr-includedfiles filts flits files files files filts filesfound matching " coveragerc' found matching ' mailmap' found matching ". travis. yml* found matching "l&ndsc&pe yml&

11、#39; found matching ' pip_vendormakefile found matching " tox ini"found matching dev-requirements txt found matching ' appveyor yml'no previously-includtd dirtclories found matching .github" no prviously*included dirtciories found matching '. travis' no previouslyr

12、-included directories found matching ' docs_buildtnpinstallin pip2. exe. m&ni fest script to c: python27scriptsinstalled cjibsx te-packa«spip-9. 0. l-py2. 7.>rocesng dependencies for pip ti rushedc:python27scripts>rnpip指令安装成功5安装selenium (保持电脑联网)进入pip.exe所在路径(还是在c:python27scripts )

13、 z运行命令行:pip install -u seleniumoc: pyqhon27scrip5>dir 驱动器c中的卷4魂 卷的序列号是000a-e8a8dir指令查看当前文件夹下面的所有文件c:python27scirip"的目录2016/11/08 09:45<bir>2016/11/08 09:45<dir>.2016/11/08 09:42430 easy_install-2. 7-script. py2016/11/08 09:4265,536 etsy_install-2.7. txt2016/11/08 09 426517fest201

14、6/11/08 09:42422 easy_install-scriptpy2016/11/08 09:4265*536 e<syminstall ex«2016/11/08 09:42647 etsy_install.ex© manifct2016/11/08 09:45380 pip-scriptpy2016/11/08 09:4565,2016/11/08 09:45638 pipmani2016/11/08 09:45382 pip2-script.py2016/11/08 09:45386 pip2. 7-script. py2016/11/08 09:45

15、65,536 pip2.7.«xe2016/11/08 09:45641 pip2. 7. exe. m&ni fest2016/11/08 09:4565,536 pip2 exe2016/11/08 09:45639 pip2exe manifest15个文件332,896 字节2个目录5, 475,229,696 旨闪字节c: python27scripts>pipinstall t seleniumc:python27scrinstall -u seleniumcolltctinc seleniumc: python27libsi tt-ptckagtspip-

16、9. 0. l-py2. 7. (cpip_v«ndorrequ<stsp*cktc«s in;: an mttps rtqutst has b“nbut the ski (subject name indication) txtentf»rm this may cause the server to present an incorrect tls certificate which parade to newer version of python to solve this for »ore information set htt curit

17、y ht»l#snimissinprarnincskimi ssinctfarnin(c: python27libsi t«-ptckagtspip-9. 0. hpy2. 7. y«pip_"ndor"quxtspck&“ rmyerning: a true sslcontext object is not available. this prevents urllib3 from &use certain ssl connections to fail you upgrade to a newer v«rsion

18、o£ pyth see https:/urllib3 readthedocs io/en/letest/securi ty. html#insecureplatforwarni insecureplatformwarningusing cached selenium-3.0.1 py2. py3nongy. whlinstalling collected packages: selemunsuccessfully instailed seleniwn*3.0.1c: python27libsi te-packagespip-9. 0. hpy2.7. eggpip_vendorreq

19、uestsp<cktges rmvarning: a true sslcontext object is not available this prevents urllib3 from ause certain ssl connections to fail. you ctn upgrade to newer version of pyth see https :/url lib3 readthedocs io/n/leitd/s 电 curi ty. html#i nse cxir epl at f ori»w <r ni insecureplatformwarni

20、ng成功安装selenium注意!安装编译器有两种,ecl ipse或者pycharm,我推荐 使用pycharm,安装pycharm的请转到单独的“安装并激活pycharm 教程.docx” 文档。(下面的第6第7步是针对ecl ipse的安装配置)6 安装 eclipse直接解压我的 eclipse-java-mars-r-win64.zip找到文件夹下的eclipse.exe运行即可使用(运行前请安装jdk )o名称a修改日期下戴吏面,量近访间的位置罔片3如j 乐 configuration dropins featuresa p2.plugins readmej .eclipsepro

21、ductartifact$.xml eclipse,exeh eclipse.ini 叵3 eclipsec.exe2016/11/8 9:132015/6/21 13:012015/6/21 13:012016/11/8 9:092015/6/21 13:012015/6/21 13:012015/6/3 20:072015/6/21 13:012015/6/21 13022015/6/21 13:012015/6/21 13:02文鮒 文 , 文i 文文文安装和配置jdk请前往"windows 7 jdk开发环境配置.doc(这里装的是最新的 jdk8 ,不然后面的pydev无法

22、正常安装)7安装pydev使用eclipse添加python解释器插件pydevo看我下面的安装截图步骤:location: httpy/pyd /updatesarchive.cancelname : pydev location : /updatesok之后等一下,正在联网查找(大概1分钟)选择pydev ,然后一路next f进入安装路径选择界面,使用默认设置,然后finish。eclipse将下载pydev #可以从eclipse任务栏中看到下载的进度(时间比较久大约10 分钟可以去喝杯温水暖暖胃什么的 b )o software update

23、syou will need to restart eclipse for the changes to take effect would you like to restart now?iyes|nopydev安装好后,需要重启eclipseoc security warning注意:安装过程可能警报q installing softwarewarning: you are installing software that contains unsigned content the authenticity or validity of this software cannot be es

24、tablished. do you want to continue with the installation?okcanceldetails >>警告:你正在安装一个拥有未注册内容的软件。它的真实性和有效性(不能得到保证) 如果能确定软件的可靠性,这个可以不用管,0k继续安装再次0k ,相信此安装证书。pydev安装好之后,需要配置解释器。在eclipse菜单栏中,选择window > preferences > pydev > python interpreter ,在此配置 python0 首先需要添加已安装 的解释器。点击ok后跳岀一个有很多复选框的窗口

25、,最好全选,点击ok。o selection neededselect the folders to be added to the system pythonpath!important: the folders for your projects should not be added here, but in your project configuration. checlc/manual10terpreter.html for more details £ c:python2a0lls回 fi c:python27lib回 & c:py

26、thon2aliblib-tk凰 £) c:python27y £) c:python2ahbsite-packages爲 c:python2ahbsite-packagessetuptools-28.8.0-py2.7.egg“ hi c:python2aub$ite-packagespip-9.0.1-py2.7.eggselect all not in workspaceselect alldeselect allokcancel到此pydev就已经完成了配置,可以使用eclipse开始编写python。在 eclipse 菜单栏中,选择 file > new

27、>project.python的工程项目是这样子的;3 f>yoev edipey -*ale edit navigate search project pydev run window helpquick access :舀畧诊 pydev package explorer 却e >1> p uj hdlo nos python27 (c:python27python.exe)> 产 /python27external libs> forced builtinswi predefined completions> btt system libs开始新

28、建包:demo包建立之后,有一 默认的py文件生成:pydev - hello nos/demo/_init_.py eclipseale edit source refactoring navigate search project pydev run window helpis pyoev package explorer 却a be厶 a hdlo nos協 demo> 0 jnit_.py产 python27 (c:python27python.exe) t> 1 /python27a external libsa forced builtinsba predefined

29、completions> system libsquick access i皙觀java(产 yoev0 demo £3 id q1 print i ant toa ne9可以不理它,也可以重命名它再使用,或者直接新建一个py文件:选择一个空模板的文件:注意:在新建的时候可能会遇到警报如下o eclipse version too old (4.6 neon required).this version of pydev requires a newer version of eclipse to run properly.please upgrade eclipse or u

30、se an older version of pydev.see: /download.html for requirements (for this version or older versions).没事,不理它,他只是要求更新而已,0k继续新建文件file edit source refactoring navigate search project 产、$o qpydev run window help9 1 9- q quck access :(舀 java:(pydev package explorer 口b幼|仏 hdlo nos田 dem

31、o画 deno箱2 createdmy python 2-3点击运author: administrator> 0 _init_.py> 回 mypython.pyt> r1 python27 (c:python2apython.exe)u testiorint srint rinto r" asselect e way to run 'mypython.py*:迪岀.选择descr ption description not availableo console 必二 u x< terminated > 0写上代码后运行结果如下:厂yu/匸v

32、- runiviyr-yui wii«pyuale edit source refactoring navigatesearch project pydevrun window kelpnq q quick access:皑 | 裁 java c® p/dev冏 demoh pyoev package explorer 必© mypython 23o 1 ii2 print "do you like aos?*3 print *yes, "i*,4 print 9do. 95e ui 3> p|诒 hello nos © dem

33、o0 固 _inh_.py> 回 mypython.pyi > 产 python27 (c:python27python.exe)q testio console s3<terminated > c:usersadministratorwork$pacehello nosdemomypython.py do you like nos?yes,! do.到这里/就可以用eclipse写python的代码了 ,不用进入cmd执行那么麻烦。8浏览器设置(后期测试b/s系统需要的步骤,以ie浏览器为例)找到电脑中ie浏览器的安装目录,把iedriverserver复制到里面,3

34、2位+64位都放进 去,需要什么机子再自己加载宜i岂打幵駅t文件央4 ask "访同的位体改日期大小» en-us, signup& zh-cn2015/12/10 9x)62015/12/10 9k)62015/12/10 906文件央 文件央 文际耳8砂圈片计机享i&e盘(o)(f:)a, hmmapi.dll* pde$c2009/7/14 9:41应用胃砂霉2009/6/11 4:33propdesc 文件2010/11/21 1124应用徨序扩 jb52 kb3 kb8 kbiedriverserver.64.exe2015/10/7 8273.419 kb、<4jledrivers严/ft j| 2964 kb6 iein$tal.ex< 倉 ielowutil.e 总 ieproxy.dl-'ljiwjrxoninijjna line server ror me it anver 公6 software rreedom conservancy 文展本:248.0.0

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论