selenium集成到eclipse的方法_第1頁
selenium集成到eclipse的方法_第2頁
selenium集成到eclipse的方法_第3頁
selenium集成到eclipse的方法_第4頁
selenium集成到eclipse的方法_第5頁
已閱讀5頁,還剩4頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

web測試,selenium集成到eclipse中的方法在eclipse中插入Selenium,主要想用于web客戶端測試。如下描述如何在windows中搭建eclipse和Selenium集成的環(huán)境。具體步驟如下。1、 安裝jdk,并且已經(jīng)配置好環(huán)境變量,java下載路徑:2、 安裝了eclipse,eclipse下載路徑:3、 安裝Firefox,F(xiàn)irefox下載路徑:4、安裝firebug插件:安裝Firebug的目的,用于查找Firebug的安裝方法[3]安裝完畢最新版火狐瀏覽器后(本例版本為5.0.1),點擊左上角firefox菜單,選擇附加組件,之后在出現(xiàn)的搜索欄中輸入“firebug”關鍵詞,出現(xiàn)firebug搜索結果,點擊安裝后,重啟瀏覽器即可完成安裝過程。Firebug的啟動完成安裝,重啟瀏覽器后,即可按“F12”快捷鍵啟動Firebug插件,也可點擊firefox地址欄右邊f(xié)irebug圖標啟動,啟動后,頁面將分欄顯示,F(xiàn)irebug各項功能顯示在下方。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,出現(xiàn)下圖:3)點擊AddLibrary...出現(xiàn)下圖界面,點擊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、大功告成,現(xiàn)在可以編寫程序來測試嘍。新建一個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提供腳本錄制功能,可以將用戶在瀏覽器中執(zhí)行的操作記錄下來,生成各種形式的腳本,可以將這些腳本保存供seleniumrc使用1)下載SelenimIDE(這是一個XPI后綴的文件)。DocumKDownloads屬C技術問答-討論區(qū)-開直亞馬遜圖書:三合之眾rSelemumHQsearchseleniuSeleniumDownloadsDocumKDownloads屬C技術問答-討論區(qū)-開直亞馬遜圖書:三合之眾rSelemumHQsearchseleniuSeleniumDownloadsPreviousReleasesLatestBuildsSourceCodeMavenInformationDownloadsBelowiswhereyoucanfindthelatestreleasesofalltheSeleniumcclistpreviousreleases

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論