• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
    • 軟件測試技術
    • 軟件測試博客
    • 軟件測試視頻
    • 開源軟件測試技術
    • 軟件測試論壇
    • 軟件測試沙龍
    • 軟件測試資料下載
    • 軟件測試雜志
    • 軟件測試人才招聘
      暫時沒有公告

    字號: | 推薦給好友 上一篇 | 下一篇

    開源功能測試工具Selenium使用之我見

    發布: 2010-1-20 14:12 | 作者: 領測版主BUG | 來源: 領測軟件測試網 | 查看: 2439次 | 進入軟件測試論壇討論

    領測軟件測試網

     

    MILY: 宋體; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">下面說CORE。

    安裝過程就不扯了。這個地址已經很明白的告訴了你如何安裝。

    你按照這個這樣做,絕對是配置不起來的,知道原因嗎?我告訴你!

     

    正確的做法應該是在

    server.xml中。配置下tomcat的虛擬目錄。

     

    這里我告訴大家一些其他方面

    這個地址需要重新配置。道理很簡單,因為你可以根據模塊的不同制定不同的連接機制什么的,然后把你IDE過來的東西全部放到這里進行執行。

    那么我就說說這個過程。

     

    上面前3個是系統自帶的html。

    根據邏輯。你可以自己去模仿寫,就如我寫的那樣,只要路徑正確就OK

    然后自然的你就可以看到并執行了。

     

    希望的是能夠進行模塊化。

     

     

    下面說下RC。

    我這里也僅僅是模擬著做。

     

    Rc的安裝很簡單。

    1.       去下載rc包。我下的是1.0.1

    2.       然后用命令行進入

    D:\selenium-remote-control-1.0.1-dist\selenium-remote-control-1.0.1\selenium-server-1.0.1目錄。然后輸入:

    java –jar selenium-server.jar.

    這樣啟動好。

    打開你的myeclipse,然后新建項目,新建包,新建一個junitclass

    加入你們的junit 4的包和selenium的包

    看明白了。selenium只要一個jar包就夠了

     

    然后把你IDE錄制的代碼拷入

    但是,請注意:

    IDE是這樣。

    package com.example.tests;

     

    import com.thoughtworks.selenium.*;

    import java.util.regex.Pattern;

     

    public class Untitled extends SeleneseTestCase {

             public void setUp() throws Exception {

                       setUp("http://dev.bizcn.com/", "*chrome");

             }

             public void testUntitled() throws Exception {

                       selenium.open("/");

                       selenium.type("login_name", "jie");

                       selenium.click("http://input[@type='image']");

                       selenium.waitForPageToLoad("30000");

             }

    }

     

    但是放入到myeclipse就應該是下面這樣。

    package selenium;

     

    import com.thoughtworks.selenium.DefaultSelenium;

    import com.thoughtworks.selenium.Selenium;

     

    import junit.framework.TestCase;

     

    public class Caichang extends TestCase {

        private Selenium selenium;

     

        protected void tearDown() throws Exception {

            selenium.stop();

          

        }

     

    /*  public void setUp() throws Exception {

           String url = "http://www.google.cn/";

            selenium = new DefaultSelenium("localhost", 4444, "*iehta", url);  //4444 is default server port

            selenium.start(); 

           //setUp("http://change-this-to-the-site-you-are-testing/", "*chrome");

        }

        public void testUntitled2() throws Exception {

           selenium.open("/webhp?hl=zh-CN&source=hp&btnG=Google+%E6%90%9C%E7%B4%A2");

           selenium.type("q", "java");

           selenium.click("btnG");

        }*/

       

        public void setUp() throws Exception {

           String url = "http://dev.bizcn.com/";

            selenium = new DefaultSelenium("localhost", 4444, "*iehta", url);  //4444 is default server port

            selenium.start(); 

           //setUp("http://change-this-to-the-site-you-are-testing/", "*chrome");

        }

        public void testUntitled() throws Exception {

           selenium.open("/");

           selenium.type("login_name", "jie");

           assertEquals("caichang",selenium.getTitle());

           selenium.click("http://input[@type='image']");

           assertEquals("button",selenium);

           selenium.waitForPageToLoad("30000");

        }

     

    }

    注意setUp方法的區別和前面加的東西。

     

    至于assertEquals("caichang",selenium.getTitle());      assertEquals("button",selenium);

    是我加的,也就是junit的斷言。

    哥們,如果你junit不熟悉,那這個就沒辦法繼續下去了

     

    然后下面的你想要做成什么樣子,那就看你了,斷言自己加,要什么自己就按照junit的規則進行書寫吧!

     

     

     

    說下總結:

    1.  我也是在不斷的學習中。如果上面文檔有什么不好的地方,指出來下。

    2.  Selenium rc的高級操作,這個需要一些junit的東西了。這個我也是要慢慢的學。目前還不能給大家很好的例子什么的。

    3.  IDE的操作我希望是模塊化,這樣你維護起來或者交互給客戶的時候很方便運用。

    4.  Selenium更多的是用在驗收測試中,所以我覺得一定要你系統穩定了,不會有大變化的情況下做。不然。。。。后果是痛苦的。。

    延伸閱讀

    文章來源于領測軟件測試網 http://www.kjueaiud.com/

    TAG: selenium Selenium 工具 功能 開源

    33/3<123

    關于領測軟件測試網 | 領測軟件測試網合作伙伴 | 廣告服務 | 投稿指南 | 聯系我們 | 網站地圖 | 友情鏈接
    版權所有(C) 2003-2010 TestAge(領測軟件測試網)|領測國際科技(北京)有限公司|軟件測試工程師培訓網 All Rights Reserved
    北京市海淀區中關村南大街9號北京理工科技大廈1402室 京ICP備10010545號-5
    技術支持和業務聯系:info@testage.com.cn 電話:010-51297073

    軟件測試 | 領測國際ISTQBISTQB官網TMMiTMMi認證國際軟件測試工程師認證領測軟件測試網

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>