{"id":404,"date":"2017-09-11T14:58:11","date_gmt":"2017-09-11T06:58:11","guid":{"rendered":"https:\/\/blog.jsjs.org\/?p=404"},"modified":"2017-09-11T14:58:11","modified_gmt":"2017-09-11T06:58:11","slug":"%e6%90%ad%e5%bb%ba%e5%9f%ba%e4%ba%8eseleniumtestngmavenjenkinssvn%e7%9a%84web%e7%ab%afui%e8%87%aa%e5%8a%a8%e5%8c%96%e6%b5%8b%e8%af%95%e7%8e%af%e5%a2%83","status":"publish","type":"post","link":"https:\/\/blog.jsjs.org\/?p=404","title":{"rendered":"\u642d\u5efa\u57fa\u4e8eSelenium+TestNG+Maven+Jenkins+SVN\u7684Web\u7aefUI\u81ea\u52a8\u5316\u6d4b\u8bd5\u73af\u5883"},"content":{"rendered":"<p>\u4e00\u3001 \u521b\u5efaMaven\u9879\u76ee\uff0c\u4e0b\u8f7dSelenium\u548cTestNG\u7684\u4f9d\u8d56\uff08\u4f9d\u8d56\u53ef\u4ee5\u7406\u89e3\u4e3a\u4f60\u8981\u7528\u5230\u7684jar\u5305\uff09\u3002<\/p>\n<p>1. \u00a0 \u00a0 \u95ee\u9898\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48\u8981\u521b\u5efaMaven\u9879\u76ee\u5462\uff1f<\/p>\n<p>\u7b54\uff1aMaven\u9879\u76ee\u53ef\u4ee5\u65b9\u4fbf\u7684\u7ba1\u7406\u4f9d\u8d56\uff0c\u901a\u4fd7\u7684\u8bb2\uff0c\u4f60\u9700\u8981\u7684jar\u5305\uff0c\u5199\u5230POM.xml\u6587\u4ef6\u4e2d\uff0cMaven\u53ef\u4ee5\u81ea\u52a8\u4e0b\u8f7d\u3002\u7701\u5374\u4e86\u4f60\u5148\u628ajar\u6587\u4ef6\u653e\u8fdblibs,\u518dBuildPath\u8fd9\u4e00\u6b65\u3002\u540c\u65f6\u5462\uff0c\u5176\u4ed6\u9879\u76ee\u5982\u679c\u4e5f\u7528\u5230\u8fd9\u4e9bjar\u5305\uff0cMaven\u4f1a\u81ea\u52a8\u4ece\u672c\u5730\u4ed3\u5e93\u4e2d\u76f4\u63a5\u53d6\u51fa\u6765\uff0c\u4e0d\u7528\u518d\u6b21\u4e0b\u8f7d\u3002<\/p>\n<p>\uff12.\u3000\u6b65\u9aa4\u3002<\/p>\n<p>1. \u00a0File-New-Project&#8230;<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-55e945104080b902.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>2. Maven Project- Next<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-f3dac907fc225d57.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>3. Next<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-5da5a59a81092a41.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>4. \u9009\u62e9maven-archetype-quickstart-Next<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-ab5be34538f62d34.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>5. \u8f93\u5165Group Id:\u57df.\u516c\u53f8\u7b80\u79f0\uff1bArtifact Id\uff1a\u9879\u76ee\u540d\u79f0 -Finish.<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-5a39628f8e231dbe.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>6. \u521b\u5efa\u5b8c\u6210\u540e\uff0c\u76ee\u5f55\u4e2d\u80fd\u627e\u5230\u81ea\u5df1\u521b\u5efa\u7684\u9879\u76ee\uff0c\u8bf4\u660eMaven\u9879\u76ee\u5df2\u6210\u529f\u521b\u5efa\u3002<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-1c79d70238939181.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>7. \u914d\u7f6eSelenium\u548cTestNG\u7684\u4f9d\u8d56\u3002<\/p>\n<p>\u6253\u5f00Pom.xml\u6587\u4ef6-\u5982\u4e0b\u56fe-\u6dfb\u52a0\u7ea2\u6846\u4e2d\u7684\u4f9d\u8d56\u3002\u672c\u4eba\u7528\u7684\u662ftestng6.9.10\u548cselenium\u76842.53.0\u7248\u672c\u3002\uff08\u5618\uff0c\u4e0d\u9700\u8981\u4f60\u81ea\u5df1\u6572\uff0c\u4ece\u7f51\u4e0a\u76f4\u63a5\u590d\u5236\u7c98\u8d34\u8fdb\u6765\u5373\u53ef\uff0c\u4e0d\u4f1a\u7684\u770b\u6b65\u9aa48\uff0c\u4f1a\u7684\u8bf7\u5ffd\u7565\uff09<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-730d3d5d5cad1a2a.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>8. \u6253\u5f00\u641c\u7d22\u5f15\u64ce-\u641c\u7d22repository maven-\u70b9\u51fb\u8fdb\u5165\u5b98\u7f51<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-9a7e933b1c4ce709.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>\u8f93\u5165testng-\u70b9\u51fbSearch-\u518d\u70b9\u51fborg.testng&gt;testng<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-7e7bf36c5533ff66.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>\u627e\u5230\u4f60\u9700\u8981\u7684Version-\u70b9\u8fdb\u53bb<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-a72530c67a323dc8.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>\u5355\u51fb\u7ea2\u6846\u4e2d\u7684\u4ee3\u7801-\u590d\u5236-\u7c98\u8d34\u5230Pom\u6587\u4ef6\u4e2d\uff0cIDE\u4f1a\u81ea\u52a8\u4e0b\u8f7d\u4f60\u9700\u8981\u7684jar\u3002<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-c979c8a3c200da45.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>\u5c55\u5f00\u9879\u76ee\u4e0b\u7684Maven Dependencies-\u80fd\u591f\u770b\u5230\u8bf4\u660e\u4f60\u5df2\u7ecf\u4e0b\u8f7d\u6210\u529f\u3002\u770b\u4e0d\u5230\u53ef\u4ee5\u5237\u65b0\u4e0b\u8bd5\u8bd5\u3002<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-4922e7580e6a9102.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>9. Eclipse\u4e2d\u5b89\u88c5Testng\u63d2\u4ef6-help-Eclipse MarketPlace-\u641c\u7d22testNG.(\u4e0d\u6210\u529f\u81ea\u884c\u767e\u5ea6\uff0c\u4e0d\u518d\u7f00\u8ff0\u54e6)<\/p>\n<p>\u4e8c\u3001\u5c06\u9879\u76ee\u914d\u7f6e\u5230SVN\u5e73\u53f0\u3002<\/p>\n<p>1. \u95ee\u9898\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48\u5c06\u9879\u76ee\u914d\u7f6e\u5230SVN\u5e73\u53f0\u5462\uff1f<\/p>\n<p>\u7b54\uff1a\u53ef\u4ee5\u5c06SVN\u7406\u89e3\u4e3a\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u7684\u9879\u76ee\u5bb9\u5668\uff0c\u628a\u9879\u76ee\u653e\u91cc\u8fb9\uff0c\u6240\u6709\u9879\u76ee\u7684\u5f00\u53d1\u8005\u90fd\u53ef\u4ee5\u5c06\u81ea\u5df1\u589e\u52a0\u7684\u6216\u4fee\u6539\u7684\u4ee3\u7801\u63a8\u9001\u4e0a\u53bb\uff0c\u8fd9\u6837\uff0c\u8fd9\u4e2a\u9879\u76ee\u7684\u4ee3\u7801\u603b\u662f\u6700\u65b0\u7684\uff0c\u8fd0\u884cSVN\u4e0a\u8fd9\u4e2a\u9879\u76ee\u5c31\u53ef\u4ee5\u6267\u884c\u6700\u65b0\u7684\u4ee3\u7801\u3002<\/p>\n<p>2. \u6b65\u9aa4\u3002<\/p>\n<p>\u672c\u5730\u5b89\u88c5SVN\u5ba2\u6237\u7aef\u3001\u670d\u52a1\u5668\u7aef\u5b89\u88c5SVN Server\u7aef\u7684\u6b65\u9aa4\u8bf7\u81ea\u884c\u767e\u5ea6\uff0c\u672c\u8282\u53ea\u8bb2\u5982\u4f55\u5728SVN\u4e0a\u914d\u7f6e\u4f60\u7684\u811a\u672c\u9879\u76ee\u3002<\/p>\n<p>\u6253\u5f00\u4efb\u610f\u6587\u4ef6\u5939-\u53f3\u51fb-TortoiseSVN-\u70b9\u51fb\u8fdb\u5165Repo-browser<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-216ab3a7320c0855.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>\u8f93\u5165SVN\u7684url-\u70b9\u51fbOk<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-e871a6137eadc092.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>\u5728trunk\u4e0a\u53f3\u51fb-Add folder&#8230;<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-49fe155de0c905e0.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>\u9009\u62e9\u4f60\u7684\u811a\u672c\u9879\u76ee-\u70b9\u51fb\u201c\u9009\u62e9\u6587\u4ef6\u5939\u201d<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-ef073e577daab1a0.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>\u5728Message\u4e2d\u5199\u660e\u5907\u6ce8-Ok<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-446011b12c7c4cd2.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>\u4f1a\u53d1\u73b0\u9879\u76ee\u5df2\u7ecf\u914d\u7f6e\u5230\u4e86SVN\u4e0a\uff0c\u5b8c\u5de5\u3002\u6ce8\u610f\uff1a\u8fd9\u4e2a\u9879\u76ee\u7684URL\u4f1a\u5728Jenkins\u4e2d\u914d\u7f6e\u65f6\u7528\u5230\u54e6\u3002<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-34543de639098e05.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>\u4e09\u3001\u5728Jenkins\u4e0a\u914d\u7f6e\u4efb\u52a1\uff0c\u81ea\u52a8\u6267\u884c\u81ea\u52a8\u5316\u811a\u672c\u3002<\/p>\n<p>\u6253\u5f00Jeknins\u767b\u5f55-\u70b9\u51fb\u65b0\u5efa-\u6784\u5efa\u4e00\u4e2a\u81ea\u7531\u98ce\u683c\u7684\u9879\u76ee-\u8f93\u5165\u9879\u76ee\u540d\u79f0-OK<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-6a78c72cda4ec1f3.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-fc25b67ed98b7b16.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>\u5c55\u5f00\u6e90\u7801\u7ba1\u7406\u9009\u4e2dSubversion-\u8f93\u5165SVN\u4e0a\u8be5\u9879\u76ee\u7684URl\u5730\u5740-\u70b9\u51fbAdd\u53ef\u4ee5\u6dfb\u52a0\u8bbf\u95eeSVN\u7684\u6743\u9650<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-35d4a8ea70c5d547.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>\u9009\u62e9Kind\u4e3aUsername with password-\u7136\u540e\u8f93\u5165SVN\u7684\u767b\u5f55\u7528\u6237\u540d\u548c\u5bc6\u7801-\u70b9\u51fbAdd<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-645d7db077c084ad.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>\u7136\u540e\u5728Credentials \u4e2d\u9009\u62e9\u521a\u624d\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-67c3baf7127d34f0.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>\u6784\u5efa-\u9009\u62e9Execute Windows batch command\uff08\u56e0\u4e3a\u6211Jenkins\u7684\u670d\u52a1\u5668\u662fWindows\u7cfb\u7edf\uff0c\u5982\u679c\u4f60\u7684\u662fLinux\uff0c\u5c31\u8981\u9009\u62e9Execute shell\uff09<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-b7f88719b9236474.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4-\u4fdd\u5b58\u3002<\/p>\n<p>\uff08\u8fd9\u4e24\u884c\u547d\u4ee4\u7684\u610f\u601d:1. \u76ee\u5f55\u5207\u5230Jenkins\u7684WorkSpace\u4e0b\u7684MavenAutoProject\u9879\u76ee\uff1b2. \u6267\u884c\u8be5\u9879\u76ee\uff09<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-a946c11d69e76661.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>\u6784\u5efa-\u70b9\u51fb\u8be5\u9879\u76ee\u53f3\u65b9\u5c0f\u7bad\u5934-\u9009\u62e9\u7acb\u5373\u6784\u5efa<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-baaebfa2221bd37a.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>\u6784\u5efa\u5b8c\u6210\u540e\uff0c\u70b9\u51fbConsole Output\u67e5\u770b\u63a7\u5236\u53f0\u4e0a\u7684\u6d4b\u8bd5\u7ed3\u679c<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-4269dabedf9c36cb.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-6fb7cfd5b3638b9f.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>\u56db\u3001\u642d\u5efa\u5e73\u53f0\u8fc7\u7a0b\u4e2d\u9047\u5230\u7684\u9519\u8bef\u53ca\u5904\u7406\u529e\u6cd5\uff1a<\/p>\n<p>1. Jenkins\u4e0a\u63d0\u793a\u6784\u5efa\u6210\u529f\uff0c\u4f46\u662f\u7528\u4f8b\u4e00\u4e2a\u90fd\u6ca1\u8fd0\u884c\u3002<\/p>\n<p>\u539f\u56e0\uff1atestCase\u653e\u5230\u4e86src\u4e0b\uff0c\u5e94\u8be5\u653e\u5230test\u4e0b\u9762\u3002\u56e0\u4e3amaven-surefire-plugin\u9ed8\u8ba4\u6267\u884ctest\u5e95\u4e0b\u7684case\u3002<\/p>\n<p>2. \u603b\u662f\u62a5\u5173\u4e8emaven-surefire-plugin\u7684\u9519\u8bef\u3002<\/p>\n<p>\u539f\u56e0\uff1a\u63d2\u4ef6\u7248\u672c\u592a\u9ad8\uff0c\u8d77\u521d\u7528\u7684\u662f2.18.1\uff0c\u540e\u6539\u62102.12.4\uff0c\u89e3\u51b3\u3002<\/p>\n<p>3. compile\u65f6\u62a5\u627e\u4e0d\u5230testngjar\u5305\uff0c\u627e\u4e0d\u5230\u7b26\u53f7\u3002<\/p>\n<p>\u539f\u56e0\uff1a\u662f\u56e0\u4e3apom\u4e2dtestng\u7684\u4f9d\u8d56\u4e2d\u5199\u4e86&lt;scope&gt;test&lt;\/scope&gt;,\u53bb\u6389\u5373\u53ef\u3002<\/p>\n<p>4. \u7248\u672c\u95ee\u9898\uff0c\u603b\u662f\u62a5\u7248\u672c\u4e0d\u5339\u914d\u3002<\/p>\n<p>\u539f\u56e0\uff1aJRE\u7248\u672c\u9ed8\u8ba4\u603b\u6539\u62101.5.\u5c06JRE1.7\u5199\u5230Maven\u7684\u5168\u5c40\u914d\u7f6e\u6587\u4ef6\u4e2d\u5373\u53ef\u3002\u5728IDE\u7684preference-Maven-\u4e2d\u914d\u7f6e\u4e24\u4e2a\u5730\u65b9\uff0c\u4e00\u4e2a\u662finstallations\u52a0\u4e0aMaven\u7684\u5b89\u88c5\u8def\u5f84\uff0c\u4e00\u4e2a\u662fUser\u00a0 settings\u4e2d\uff0c\u4e24\u4e2a\u5730\u65b9\u90fd\u9009\u62e9Maven\u5b89\u88c5\u8def\u5f84\u4e0b\u7684Settings\u6587\u4ef6\u5373\u53ef\u3002<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-e211a7cbea3990de.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/div>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-f60b35678942ad25.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>Settings.xml\u7684\u914d\u7f6e\u65b9\u6cd5\uff1a\u52a0\u4e0a\u4ee5\u4e0b\u4ee3\u7801\u5373\u53ef\u3002\u5728Maven\u7684\u5168\u5c40\u914d\u7f6e\u6587\u4ef6\u4e2d\u52a0\u4e0a\u5982\u4e0b\u4ee3\u7801\uff0c\u610f\u5473\u7740\u53ea\u8981\u662fMaven\u9879\u76ee\uff0c\u9ed8\u8ba4\u7528JRE1.7\u3002<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-15eec367b17d4c0a.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<p>\u7efc\u4e0a\uff0c\u53ef\u4ee5\u770b\u51fa\uff0c\u4ee3\u7801\u6267\u884c\u65f6\u62a5\u9519\uff0c\u76f8\u5f53\u4e00\u5927\u90e8\u5206\u539f\u56e0\u662f\u914d\u7f6e\u6ca1\u914d\u597d\uff0c\u6240\u4ee5\u5efa\u8bae\u5927\u5bb6\u914d\u7f6e\u597d\u4e00\u5957\u73af\u5883\u540e\uff0c\u8bb0\u5f55\u4e0b\u5404\u79cd\u7248\u672c\u53f7\uff0c\u4e00\u52b3\u6c38\u9038\u3002\u73b0\u5c06\u6211\u7684\u73af\u5883\u603b\u7ed3\u5982\u4e0b\uff1aselenium2.53.0+testng6.9.10+JDK1.7+maven-surefire-plugin2.12.4+EclipseVersion: Mars.2 Release (4.5.2)\u3002<\/p>\n<p>\u8fd8\u62c5\u5fc3\u4f1a\u914d\u9519\uff1f\u8bf7\u67e5\u770b\u7b2c\u4e94\u6761\uff0c\u6211\u5b8c\u6574POM\u6587\u4ef6\u7684\u622a\u56fe\u3002<\/p>\n<p>\u4e94\u3001Pom.xml\u6587\u4ef6\u5b8c\u6574\u622a\u56fe\u3002<\/p>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-da623f136e04c212.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-af882a438ce1bb34.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n<div class=\"image-package\"><img decoding=\"async\" src=\"http:\/\/upload-images.jianshu.io\/upload_images\/3871423-c8e1c0aba3a341fb.png?imageMogr2\/auto-orient\/strip%7CimageView2\/2\/w\/1240\" alt=\"\" \/><\/p>\n<div class=\"image-caption\">Xr-\u539f\u521b<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001 \u521b\u5efaMaven\u9879\u76ee\uff0c\u4e0b\u8f7dSelenium\u548cTestNG\u7684\u4f9d\u8d56\uff08\u4f9d\u8d56\u53ef\u4ee5\u7406\u89e3\u4e3a\u4f60\u8981\u7528\u5230\u7684jar\u5305\uff09\u3002 1. \u00a0 \u00a0 \u95ee\u9898\u3002 \u4e3a\u4ec0\u4e48\u8981\u521b\u5efaMaven\u9879\u76ee\u5462\uff1f \u7b54\uff1aMaven\u9879\u76ee\u53ef\u4ee5\u65b9\u4fbf\u7684\u7ba1\u7406\u4f9d\u8d56\uff0c\u901a\u4fd7\u7684\u8bb2\uff0c\u4f60\u9700\u8981\u7684jar\u5305\uff0c\u5199\u5230POM.xml\u6587\u4ef6\u4e2d\uff0cMaven\u53ef\u4ee5\u81ea\u52a8\u4e0b\u8f7d\u3002\u7701\u5374\u4e86\u4f60\u5148\u628ajar\u6587\u4ef6\u653e\u8fdblibs,\u518dBuildPath\u8fd9\u4e00\u6b65\u3002\u540c\u65f6\u5462\uff0c\u5176\u4ed6\u9879\u76ee\u5982\u679c\u4e5f\u7528\u5230\u8fd9\u4e9bjar\u5305\uff0cMaven\u4f1a\u81ea\u52a8\u4ece\u672c\u5730\u4ed3\u5e93\u4e2d\u76f4\u63a5\u53d6\u51fa\u6765\uff0c\u4e0d\u7528\u518d\u6b21\u4e0b\u8f7d\u3002 \uff12.\u3000\u6b65\u9aa4\u3002 1. \u00a0File-New-Project&#8230; Xr-\u539f\u521b 2. Maven Project- Next Xr-\u539f\u521b 3. Next Xr-\u539f\u521b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-404","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/posts\/404","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=404"}],"version-history":[{"count":0,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/posts\/404\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}