![](/img/trans.png)
[英]How do I specify the Selenium Hub URL when running Serenity tests from Eclipse?
[英]How do I specify base url for REST API tests with WebTau
在有關如何測試 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
}
如何設置要使用的基本網址?
如果您使用的是Groovy 獨立運行程序,您可以通過命令行建立 url
webtau --url=http://localhost:8080
或者有一個 groovy 配置文件webtau.cfg.groovy
url = "http://localhost:8080
如果是 Java src/test/resources/webtau.properties
文件
url = http://localhost:8080
或通過系統屬性傳遞它以執行測試
-Durl="http://localhost:8080"
對於 Java 和 Groovy,您還可以通過環境變量提供基本 url
WEBTAU_URL=http://localhost:8080
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.