2009年8月27日 星期四

Selenium Docs (1) - 基本介紹

Selenium 介紹
Selenium 包含三大部分:(1) Selenium-IDE;(2) Selenium-RC;(3) Selenium-Grid。
  • Selenium-IDE:Firefox 的附加元件,可以錄下操作網頁的動作作為 test cases,也可以自己編輯這些 test cases。
  • Selenium-RC:讓會寫程式的人利用現有的程式語言做自動化測試,selenium 提供 API 並支援多種語言 (HTML, Java、C#、Perl、PHP、Python、Ruby) 方便寫 test cases。
  • Selenium-Grid:平行測試、跨瀏覽器測試。

Selenium 指令 (Selenese)
指令有三種型態:(1) 動作 Actions;(2) 存取 Accessors;(3) 判斷 Assertions。
  • 動作:用來操作頁面,例如:點擊(click)、輸入(type) ...等動作。如果動作執行出問題,這個測試會被中止。
  • 存取:查看目前頁面的狀態,或者把頁面內容存起來,例如 storeTitle。也會被用來判斷(Assertions)
  • 判斷:類似存取(Accessors),但更進一步地做些檢查,例如看目前頁面的標題是否為X,某個欄位是否被勾選...等。有三種用法:宣稱(assert)、驗證(verify)、等候(waitFor)。宣稱某個正確的內容時,若實際內容與宣稱內容不符合,此測試會中斷。驗證則稍微寬鬆一些,測試會繼續執行而把錯誤存在紀錄的 log 中。等候則用來確認某些內容出現在頁面上(常見的情況是搭配有 ajax 的頁面使用),當該內容未在設定的時間內出現時 (timeout),則中斷測試。
(... 閱讀「Selenium Docs (1) - 基本介紹」全文)

2009年4月28日 星期二

Selenium Note

[Tutorial] [Documentation] [API] [Forum]

selenium 不能測的功能:
(1) 檔案上傳 - 無法控制 windows file chooser
(2) ActiveX 的操作
(3) applet 的操作
(4) Flash - [對策]
(5) 切換 domain [The Same Origin Policy]

Reference:
  • Google Developer Talk: http://tw.youtube.com/watch?v=EDb8yOM3Vpw

  • C. Titus Brown, Gheorghe Gheorghiu, Jason Huggins, An Introduction to Testing Web Applications with twill and Selenium , O'REILLY, 2007. [Google Preview]
  • (... 閱讀「Selenium Note」全文)

    2008年9月25日 星期四

    Redirect 網址的方法

    Reference: [WEB][PHP][SEO] 轉導、轉向(Redirect)網址的方法

    在將網站更換成新網址的情況下,可能會在舊網址上使用到一些『轉導網址』的方法,以便將原本的使用者及其流量引導到新的網址去。
    以下整理、討論到幾種轉導(Redirect)網址的技術方法,並且探討該方法對 SEO 的影響:

    1. 使用 HTTP 通訊協定 301 Moved Permanently 來完成轉導網址 (永久轉址)
    (建議使用,不會對 SEO 有不良影響)
    PHP 程式範例:
    <?php
       header("HTTP/1.1 301 Moved Permanently");
       eader("Location: http://www.new-url.com/");
    ?>
    <p>The document has moved <a href="http://www.new-url.com/">here</a>.</p>
    • 註1: 使用者的瀏覽器必須根據 HTTP header 的 Location 欄位值(稱做URI)來轉導網址。
    • 註2: 除非 Request Method 是 HEAD,不然伺服器端回覆的訊息內必須包含一短的新網址的連結(hyperlink)資訊。
    (... 閱讀「Redirect 網址的方法」全文)

    2007年9月25日 星期二

    [Research] Ontology (Some Notes)

    From Wikipedia - Ontology (computer science)
    1. ontology:
    • individual - 個體 (object)
    • classes - 個體的集合, 群組
    • attribute - 描述個體的屬性
    • relations - 個體與個體之間的關係 (連結)
    • events - ?
    2. classes:
    • extensional - 若 class C 與 class C' 擁有相同成員,則 C = C'。也就是該 class 不受外部影響。
    • intensional - 非 extensional 的 class
    (... 閱讀「[Research] Ontology (Some Notes)」全文)

    2007年7月26日 星期四

    [Research] Related Work

    Search keywords: photo, metadata, temporal, social network ZoneTag: Designing Context-Aware Mobile Media Capture to Increase Participation
  • using mobile device and suggested tags to help user annotation.

  • suggested tags: - past tags from the user - user's social network, the public - related tags near the user's location

  • From Context to Content: Leveraging Context to Infer Media Metadata
  • leverage photo metadata when cameraphone capture the picture.

  • use location information to infer context.

  • combining and sharing spatial, temporal, and social contextual metadata from a given user and across users allows us to make inferences about media content.
  • (... 閱讀「[Research] Related Work」全文)

    2007年7月23日 星期一

    [Research] Think about It

  • Suppose we assume that social network has been constructed (in some ways), what can we do based on this network?
  • It is important to experiment conducting social network is necessary.

  • (... 閱讀「[Research] Think about It」全文)