校驗屬性
校驗屬性的功能一般用在結果的校驗上,通常我們校驗的是被校驗對象的數(shù)據(jù)值或者某一個對我們的測試結果有統(tǒng)計價值的對象的某一具體屬性值。對他們進行校驗可以幫助我們更好地統(tǒng)計分析測試執(zhí)行過程中出現(xiàn)的問題。
在進行校驗的時候,AR會自動執(zhí)行校驗語句,如果校驗的結果和預期的結果一致,在腳本執(zhí)行完畢的時候會自動返回一個布爾值true,如果校驗的結果和預期結果不一致,則會返回一個布爾值false。
下面我們來看一下這個校驗屬性的用法:
我們在crm里添加一個客戶,類型為:潛在客戶,然后我們再進入到潛在客戶列表去查看,是否添加成功:
1.錄制腳本:
ar.window("IEFrame_上海澤眾軟件科技有限公司客戶管理系統(tǒng) - Windows Internet Explorer").clickControl("INPUT_text_Client_Company", 54, 10, "left");
ar.window("IEFrame_上海澤眾軟件科技有限公司客戶管理系統(tǒng) - Windows Internet Explorer").setValue("INPUT_text_Client_Company", "dfj");
ar.window("IEFrame_上海澤眾軟件科技有限公司客戶管理系統(tǒng) - Windows Internet Explorer").clickControl("INPUT_submit_確 認", 57, 10, "left");
ar.window("IEFrame_上海澤眾軟件科技有限公司客戶管理系統(tǒng) - Windows Internet Explorer").clickControl("A_潛在客戶", 22, 8, "left");
ar.window("IEFrame_上海澤眾軟件科技有限公司客戶管理系統(tǒng) - Windows Internet Explorer").clickControl("A_潛在客戶", 22, 8, "doubleLeft");
ar.window("IEFrame_上海澤眾軟件科技有限公司客戶管理系統(tǒng) - Windows Internet Explorer").clickControl("TD", 27, 13, "left");

2.添加校驗:

檢查點語句:【ar.window("IEFrame_上海澤眾軟件科技有限公司客戶管理系統(tǒng) - Windows Internet Explorer").checkProperty("TD", "innerText", " dfj");】

執(zhí)行下腳本:

期望值與實際值相符,腳本執(zhí)行成功,校驗的結果是潛在客戶添加成功!
當然我們也可以把成功這個消息打印到輸出區(qū)域!詳細方法請見《AR場景異常處理》一文。