在空手道配置文件中编写的用户名/密码在功能文件的 Post 请求中不起作用



配置文件: var 配置 = { 环境: 环境, baseurl:'https://*inggateway.**ls.com', 用户名:'r567@mai***ator.com', 密码:"****we12!

Post request in feature file:
Given url baseurl + '/gateway/user/login'
And header sessionkey = sessionkey
And request '{"emailAddress": username ,"password": password}'
When method POST
Then status 200

It gives error :
Invalid grant or invalid username/password
I have tried many ways but nothing works.
Can somebody tell me how can I make it work? What is the correct way of passing config variables in 
Post request body.

正如@peter建议的那样,您可以使用嵌入式表达式

And request {"emailAddress": "#(username)" ,"password": "#(password)"}

运行测试后,您可以观察到表达式在日志中更改为实际值。

最新更新