selenium集成到eclipse的方法_第1页
selenium集成到eclipse的方法_第2页
selenium集成到eclipse的方法_第3页
selenium集成到eclipse的方法_第4页
selenium集成到eclipse的方法_第5页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

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

文档简介

web测试,selenium集成到eclipse中的方法在eclipse中插入Selenium,主要想用于web客户端测试。如下描述如何在windows中搭建eclipse和Selenium集成的环境。具体步骤如下。1、 安装jdk,并且已经配置好环境变量,java下载路径:2、 安装了eclipse,eclipse下载路径:3、 安装Firefox,Firefox下载路径:4、安装firebug插件:安装Firebug的目的,用于查找Firebug的安装方法[3]安装完毕最新版火狐浏览器后(本例版本为5.0.1),点击左上角firefox菜单,选择附加组件,之后在出现的搜索栏中输入“firebug”关键词,出现firebug搜索结果,点击安装后,重启浏览器即可完成安装过程。Firebug的启动完成安装,重启浏览器后,即可按“F12”快捷键启动Firebug插件,也可点击firefox地址栏右边firebug图标启动,启动后,页面将分栏显示,Firebug各项功能显示在下方。5、下载Selenium的包,需要找如下这个包;selenium-java-2.26.0.jarselenium-server-standalone-2.26.0.jar,具体的包位置如下面截图:selenium-java-2.26.0.jar,插件包位置:lium◎启动seleniu... lium◎启动seleniu... @亚马逊图书…@亚马逊:SSH、|■百度搜索fir...'||S|FireBug一百…'间菜鸟学自动化..'间seleniumRC...|金Java集或Downloadversion2.25.0TousetheSeleniumServerinaGridconfigurationseethewikipage.TheInternetExplorerDriverServerThisisrequiredifyouwanttomakeuseofthelatestandgreatestfeaturesoftheWebDriverInternetExplorerDriver.Pleasemakesurethatthisisavailableonyour$PATH(or%PATH%onWindows)ino「de「fortheIEDrivertoworkasexpected.Downloadversion2.25.2for(recommended)32bitWindowsIEor64bitWindowsIESeleniumClientDriversInordertocreatescriptsthatinteractwiththeSeleniumServer(SeleniumRC,SeleniumRemoteWebdriver)orcreatelocalSeleniumWebDriverscriptyouneedtomakeuseoflanguage-specificdientdrivers.Unlessotherwisespecified,driversincludeboth1.xand2.xstyledrivers.Whiledriversforotherlanguagesexist,thesearethecoreonesthataresupportedbythemainproject.LanguzgeClientVersionReleaseDateJava2.25.02012-07Download1ChantIlogJavadocC#2.25.12012-07・19DownloadChaIlogAPIdocsRuby2.25.02012・07-18DownloadChaIlogAPIdocsPython2.25.02012-07-18DownloadChalogAPIdocsselenium-server-standalone-2.26.0.jar,插件包位置:絆Downloads世界之窗絆Downloads世界之窗3.6 文件(E)查看但)呦1但)工RIQI./'”◎多色玄[0/download/ T・IH喙SeleniumIDEisaFirefoxpluginthatdoesrecord-and-playbackofinteractionswiththebrowser.Usethistoeithercreatesimplescripts,assistinexploratorytesting.ItcanalsoexportRemoteControlorWebDriverscripts,thoughtheytendtobesomewhatbrittleandshouldbeoverhauledintosomesortofPageObject-ystructureforanykindofresiliency.Downloadversion1.9.0releasedon24/July/2012orviewtheReleaseNotesSeleniumServer(formerlytheSeleniumRCServer)TheSeleniumServerisneededinordertoruneitherSeleniumR.CstylescriptsorRemoteSeleniumWebdriverones.The2.xserverisadrop-inreplacementfortheoldSeleniumR.Cserverandisdesignedtobebackwardscompatiblewithyourexistinginfrastructure.Downloadversion2.25.0TousetheSeleniumServerinaGridconfigurationseethewikipage.6、导入selenium插件包在eclipse里面新建一个java工程输入一个工程名,点击Finish在功能的名字上右键然后点击Properties,出现下图:3)点击AddLibrary...出现下图界面,点击Next选择JUnit4,然后点击Finish;4)导入Selenium的java客户端和selenium-server.jar包,如图所示;注意导入的路径就是步骤5下载的2个包的存放路径。1^7SelemurNew-translat■£^hiyangGoIntoOpeninNewWindowOpenTypeHierarchyF4ShowInAlt+Shift4-W►CopyCtrl+CCopyQualifiedName歯PasteCtrl+VXDeleteDelete雾R已movefromContextCtrl-FAlt4-Shift-I-Down1BuildPath►te~ir-| 1LinkSource..・SourceAlt+Shift4-S►NewSourceFolder...RefactorAlt+Shift+T►UseasSourceFolder[L£gImport...园AddExternalArchives...Export...aAddLibraries...FindBugs►魁ConfigureBuildPath...RefreshF57、加载selenium插件包确定完了之后,需要加载selenium-java-2.26.0.jar和selenium-server-standalone-2.26.0.jar包,如下图,选中步骤9刚刚导入的包,右键BuildPath-AddtoBuildPath。

辛Java-com.web.test/src/He11oWorld.java-EclipseSDKFileEditSourc已RefactorNavigate5已旦irhProjec鬥〒昌暑 -o-<1-当曲矽〒酋PackageExplorer^hHierarchy a曰【一笃▽I3com.test&src蟲selenium-2.26.0©libsECHANGELOGElseleniumJava-2.26.0-srcsJaraJRESystemLibraryjre7]JUnit4aReferencedLibraries丽seleniumJava-2.26.0jar?s:s:咖seleniums已rv已「-stand日Ion已-2.25.0jm「18、大功告成,现在可以编写程序来测试喽。新建一个Open.java里面测试代码如下:importorg.openqa.selenium.WebDriver;importorg.openqa.selenium.firefox.FirefoxDriver;publicclassOpenGoogle{/***@paramargs*/publicstaticvoidmain(String[]args){//TODOAuto-generatedmethodstubWebDriverdriver=newFirefoxDriver();driver.get("xxxxxxxx");}}就会自动打开火狐浏览器,并输入google主页了。9、SeleniumIDE的安装和使用SeleniumIDE是基于FIREFOX浏览器的一个插件,提供GUI界面来运行Selenium测试。SeleniumIDE提供脚本录制功能,可以将用户在浏览器中执行的操作记录下来,生成各种形式的脚本,可以将这些脚本保存供seleniumrc使用1)下载SelenimIDE(这是一个XPI后缀的文件)。DocumKDownloads屬C技术问答-讨论区-开直亚马逊图书:三合之众rSelemumHQsearchseleniuSeleniumDownloadsDocumKDownloads屬C技术问答-讨论区-开直亚马逊图书:三合之众rSelemumHQsearchseleniuSeleniumDownloadsPreviousReleasesLatestBuildsSourceCodeMavenInformationDownloadsBelowiswhereyoucanfindthelatestreleasesofalltheSeleniumcclistpreviousreleases

温馨提示

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

评论

0/150

提交评论