AT JSON全稱是“Automation Tool JSON”,是一種標準化的JSON數據格式,用于描述自動化測試執行的場景和結果。
{ "caseId": "001", "caseDesc": "validate login feature", "preCondition": "user is not logged in", "steps": [ { "stepDesc": "open login page", "action": "open", "url": "https://example.com/login" }, { "stepDesc": "input username and password", "action": "input", "target": "id=username", "value": "testuser", "nextStepDelay": 1000 }, { "stepDesc": "click login button", "action": "click", "target": "id=loginBtn", "nextStepDelay": 3000 }, { "stepDesc": "verify login success", "action": "verifyText", "target": "id=status", "value": "Welcome testuser!", "nextStepDelay": 0 } ], "result": { "startTime": "2021-07-01 10:00:00", "endTime": "2021-07-01 10:05:00", "status": "success", "errorMsg": "" } }
AT JSON的優點在于為測試場景和結果提供了清晰的結構和描述,方便同事之間協作和溝通,并且可以被多種測試框架和工具所識別和使用。
同時,由于是標準化的JSON格式,也方便進行數據的處理和分析,例如可以用Python的json庫進行解析和生成。對于自動化測試工程師來說,熟練掌握AT JSON是必不可少的技能之一。