在有關如何測驗 CRUD 的WebTau 檔案中,示例使用的是相對 url
def customerPayload = [firstName: "FN", lastName: "LN"]
def id = http.post("/customers", customerPayload) {
return id
}
http.get("/customers/${id}") {
body.should == customerPayload 3
}
如何設定要使用的基本網址?
uj5u.com熱心網友回復:
如果您使用的是Groovy 獨立運行程式,您可以通過命令列建立 url
webtau --url=http://localhost:8080
或者有一個 groovy 組態檔webtau.cfg.groovy
url = "http://localhost:8080
如果是 Javasrc/test/resources/webtau.properties檔案
url = http://localhost:8080
或通過系統屬性傳遞它以執行測驗
-Durl="http://localhost:8080"
對于 Java 和 Groovy,您還可以通過環境變數提供基本 url
WEBTAU_URL=http://localhost:8080
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/489909.html
