顯示具有 Testing 標籤的文章。 顯示所有文章
顯示具有 Testing 標籤的文章。 顯示所有文章

2014年12月22日 星期一

Selenium IEDriverServer doesn't work after installing Microsoft KB 3025390

Not sure why selenium (using IEDriverServer) doesn't work after installing Microsoft KB 3025390.

Not only execue script failed but also can't look up any element...

Uninstalling KB 3025390 is the only way I can solve this problem.

Keeping follow https://code.google.com/p/selenium/issues/detail?id=8302 for more information.





2014年4月18日 星期五

Allow plug-in run in chrome driver

有些網站需要執行 plug-in(ex: java, flash...),當 selenium 使用 chrom driver 自動測試遇到此類網站,chrome 會詢問是否允許執行 plug-in, 造成測試中斷。


解決方式是加入--always-authorize-plugins 這個參數。

程式碼如下:

        ChromeOptions options = new ChromeOptions();
        options.addArguments("start-maximized");
        options.addArguments("--always-authorize-plugins");

        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setJavascriptEnabled(true);
        capabilities.setCapability(ChromeOptions.CAPABILITY, options);
       
        WebDriver driver = null;
        try {
            driver = new RemoteWebDriver(new URL("http://localhost:9515"), capabilities);
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }


2011年5月11日 星期三

Selenium 2 / WebDriver deal with Modal Dialogs

又遇到難題了, Selenium 2 / WebDriver 要怎麼處理 Modal Dialog 哩?

目前看起來還沒有解決, 以下連結有 workaround 解法, 但我試不出來(也許是 for selenium 1), 僅供參考.


Working with Modal Dialogs and Selenium - 2

Issue 284

2011年5月6日 星期五

GTAC 2010: The Future of Front-End Testing

GTAC 2010: The Future of Front-End Testing

摘要如下:

Migrate to Selenium 2 / WebDriver



因為某些網站沒好好地處理 https 混雜 http 連結的問題, 當瀏覽器遇到這種情況, 會跳出警告視窗. 導致原本應該"自動化"的程式, 還需要人點掉警告視窗才能繼續...

剛好最近比較有時間, 就把原本 selenium 的程式改為 selenium 2.
(se2處理方式如下:

WebDriver.switchTo().alert().accept() ;
)
不知道是不是因為 se2 還在 bata 的關係, 改寫過程並不是很順利.
以下是改寫時遇到的問題紀錄(bata3)


2009年6月17日 星期三

Automated Testing Framework - Tellurium(碲)

今天網上沖浪時不小心逛到的


與Selenium(硒)相似的Web UI測試工具(for Acceptance Test)
官網

2009年5月24日 星期日

自動化測試 - Selenium

拜XP(extreme programming)方法論之賜,測試先行(Test before Write)的概念廣為人知。
也因此出現了Test-Driven Development(TDD)的開發方法論。

其實不管是XP或是傳統的瀑布式開發,測試本身都是軟體品質管理裡很重要的一環。
現在與以前的最大的差異,大概是傳統Client介面幾乎已被Web介面取代,甚至Web介面本身都進入2.0的時代(連Web3.0都有人提出了)...

那在自動化測試上有沒有什麼好的解決之道呢?
今天要介紹的是一個開源的Web自動化測試軟體 Selenium

下圖為Selenium官網的架構介紹: