# Hands-on Example4-1 {%hackmd 48QQ4miqSxmUyp2CZ-kBSw %} ## 重點提示 1. 了解Robot的變數宣告和取用的syntax,及各種寫法的==目的==。 2. 檔案擺放和種類。 - Test Suite的層級 - Resource file - Library file - Variable file 2. 了解Build-in keywords的用法 - `Catenate`、`Create List`、`Create Dictionary`、`Evaluate` :::info :bulb: **溫馨叮嚀** - 變數使用是基礎記得耐心地核對一下每個結果是不是如你預期? - 另外也要特別注意Import進來的resource file, variable file和library的呼叫方式 - 當然最重要的就是個撰寫方式的效果和目的、目的、目的,==自測開發能讓程式動是最簡單的事,能夠達成什麼目的才是最重要的!== ::: ## 下載/更新 Repository :::info :bulb: 有問題請先服用[開發環境問題/Git](/H1voIxJwSA2f5gSs_xfDMQ) ::: 1. 下載repo/commit - 若還未載過repo,須從remote下載repo ```bash= git clone http://mhqnetgitlab.moxa.com:10080/SimonWX_Zhao/auto-test-practice.git ``` - 如果已經載過repo那麼只需從remote下載新的commits ```bash= git fetch ``` 2. 檢查tag,包含`example4-r`就對了。 ## 執行Robot Framework example 1. 移動標有`example4-r`的commit ```bash=1 #要執行這行才會到robot這個commit上 git checkout example4-r ``` 2. 檢查在git tree上的位置,`HEAD`指到`example4-r`就對了 ```bash=+ #看看有沒有到這個commit上 git log --graph --oneline --all ``` 3. 檢查測試結果 ```bash=+ robot -d result variable.robot ``` - 在Terminal中長這樣 ![](https://i.imgur.com/ghW9dch.png) - 到Windows相對應的資料夾中開啟log.html,察看有排版的格式(僅擷取部分) :::info :bulb: **變數宣吿是基礎**記得耐心的確確認每一個變數使用都理解了! ::: ![](https://i.imgur.com/0u1Nzf2.jpg) --- :::info :heart: **感謝共同編輯** Sabrina、Nickson :::