Glossary — Robot Framework¶
คำศัพท์ทั้งหมดที่ใช้ใน course นี้ เรียงตามตัวอักษร
| คำศัพท์ | คำอธิบายภาษาไทย | SOURCE |
|---|---|---|
| Acceptance Testing | การทดสอบว่าระบบทำงานตาม business requirement ที่ตกลงกันไว้ — RF ถูกออกแบบมาสำหรับ acceptance testing โดยเฉพาะ | RF User Guide |
| Argument | ค่าที่ส่งให้ Keyword เมื่อเรียกใช้ เช่น Login As admin pass123 → admin และ pass123 คือ arguments |
RF User Guide - Keywords |
| Browser Library | Library สำหรับ web testing ที่ใช้ Playwright เบื้องหลัง เร็วกว่าและรองรับ modern web app ดีกว่า SeleniumLibrary — แนะนำสำหรับโปรเจคใหม่ | Browser Library GitHub |
| BuiltIn Library | Library ที่ RF import ให้อัตโนมัติทุกครั้ง มี keyword พื้นฐานเช่น Log, Should Be Equal, Set Variable, Run Keyword And Return Status |
BuiltIn Library Docs |
| Collections Library | Library สำหรับจัดการ List, Dictionary เช่น Get From List, Get From Dictionary, Append To List ต้องสั่ง import เอง |
Collections Library Docs |
| CSS Selector | วิธีระบุ element บนหน้า web โดยใช้ CSS syntax เช่น css:button.primary หรือ css:input[name='email'] |
MDN CSS Selectors |
| Data-Driven Testing | แนวทางเขียน test ที่แยก logic ออกจาก data — ใช้ Test Template รัน logic เดิมกับ data หลายชุด | RF User Guide - Data-Driven |
| Dictionary Variable | Variable แบบ &{name} เก็บข้อมูลแบบ key-value เช่น &{USER} username=admin role=admin |
RF User Guide - Variables |
| FOR Loop | การทำซ้ำ keyword สำหรับแต่ละ item ใน list ใช้ syntax FOR ${item} IN @{list} ... END |
RF User Guide - FOR Loops |
| Headless Mode | การรัน browser โดยไม่แสดง UI ให้ผู้ใช้เห็น เร็วกว่าและเหมาะสำหรับ CI/CD ตั้งด้วย headless=True |
Browser Library Docs |
| Keyword | หน่วยพื้นฐานของ RF — ชื่อที่แทน action หนึ่งอย่าง เช่น Click Login Button หรือ Verify Welcome Message ซ่อน implementation ไว้ข้างใน |
RF User Guide - Keywords |
| Keyword-Driven Testing | แนวทาง test ที่ใช้ Keyword เป็นหน่วยหลัก — QA เขียน test case โดยเรียง keyword โดยไม่ต้องรู้ implementation | RF User Guide |
| Library | ชุด keyword สำเร็จรูปที่ import มาใช้ เช่น Browser, Collections, OperatingSystem บาง library ต้อง pip install ก่อน |
RF User Guide - Libraries |
| List Variable | Variable แบบ @{name} เก็บข้อมูลหลายค่า เช่น @{BROWSERS} chromium firefox webkit |
RF User Guide - Variables |
| Locator | วิธีบอกให้ RF หา element บนหน้า web เช่น id:username, css:button.primary, xpath=//button[@type='submit'] |
Browser Library - Selectors |
| log.html | ไฟล์ที่ RF สร้างหลังรัน test แสดงรายละเอียดทุก step ที่รัน ใช้สำหรับ debug เมื่อ test fail | RF User Guide - Output |
| Page Object Pattern | Pattern การจัด code ที่แยก keyword ของแต่ละหน้า web ออกเป็น resource file ของตัวเอง ช่วยให้แก้ locator ที่เดียว | Page Object Best Practices |
| Playwright | Browser automation library จาก Microsoft ที่ Browser Library ใช้เบื้องหลัง รองรับ Chromium, Firefox, WebKit | Playwright Docs |
| report.html | ไฟล์สรุปผล test ที่ RF สร้าง แสดง pass/fail summary, tag statistics, suite breakdown | RF User Guide - Report |
| Resource File | ไฟล์ .resource ที่เก็บ keyword และ variable รวมกันเพื่อ share ระหว่าง test file หลายๆ อัน |
RF User Guide - Resource Files |
| RETURN | keyword สำหรับส่งค่าออกจาก keyword (RF 5+ ใช้ RETURN uppercase) เช่น RETURN ${result} |
RF User Guide - Return Values |
| Robot Framework | Open-source framework สำหรับ test automation ที่ใช้ keyword-driven approach สร้างด้วย Python รองรับ web, API, database, mobile | robotframework.org |
| Scalar Variable | Variable แบบ ${name} เก็บค่าเดี่ยว เช่น ${USERNAME} admin หรือ ${TIMEOUT} 10 seconds |
RF User Guide - Variables |
| SeleniumLibrary | Library สำหรับ web testing ที่ใช้ Selenium WebDriver เบื้องหลัง — ยังใช้งานได้ดีแต่ Browser Library แนะนำมากกว่าสำหรับโปรเจคใหม่ | SeleniumLibrary GitHub |
| Settings Section | Section ใน .robot file ที่ใช้ import library, resource file, และกำหนด setup/teardown |
RF User Guide - Settings |
| Suite Setup / Teardown | Keyword ที่รันก่อน/หลัง test ทุก case ใน file/suite ใช้กำหนดใน Settings section | RF User Guide - Setup and Teardown |
| Tag | label ที่ติดกับ test case ใช้กรอง test เมื่อรัน เช่น --include smoke หรือ --exclude slow |
RF User Guide - Tags |
| Teardown | Keyword ที่รันหลัง test case เสร็จ (ทั้ง pass และ fail) มักใช้ปิด browser, cleanup ข้อมูล | RF User Guide - Teardown |
| Test Case | unit ของการทดสอบ 1 scenario ประกอบด้วยลำดับ keyword เช่น "User Can Login With Valid Credentials" | RF User Guide - Test Cases |
| Test Setup | Keyword ที่รันก่อนแต่ละ test case ใช้เตรียม state เช่น เปิด browser, login ก่อน | RF User Guide - Setup |
| Test Template | กลไก Data-Driven Testing ที่กำหนด keyword 1 อัน แล้วรัน data หลายชุดแทน test case หลายอัน | RF User Guide - Templates |
| Variable | ค่าที่เก็บไว้ใช้ซ้ำ มี 3 แบบหลัก: ${scalar}, @{list}, &{dict} |
RF User Guide - Variables |
| Variables Section | Section ใน .robot file ที่ประกาศ variable ที่ใช้ในไฟล์นั้น |
RF User Guide - Variables |
| Virtual Environment | การแยก Python environment ของแต่ละโปรเจคออกจากกัน ป้องกัน package version ชนกัน สร้างด้วย python3 -m venv .venv |
Python venv Docs |
| Wait For Elements State | Keyword ของ Browser Library ที่รอจน element เป็น state ที่กำหนด (visible, hidden, enabled) ดีกว่า Sleep | Browser Library Docs |
| XPath | ภาษา query สำหรับ navigate ใน XML/HTML document ใช้เป็น locator ได้ แต่มักเปราะบาง — แนะนำให้ใช้ id หรือ CSS แทนเมื่อทำได้ | MDN XPath |