[英]How to use both Karate and Selenium to write an end to end test case using Cucumber?
Can we run part of Selenium and Karate together?我们可以同时运行 Selenium 和空手道的一部分吗? I need to invoke a SOAP service, capture a value from the SOAP response and then pass that value in GUI, and run the GUI test using Selenium.
我需要调用 SOAP 服务,从 SOAP 响应中捕获一个值,然后在 GUI 中传递该值,然后使用 Selenium 运行 GUI 测试。 So- how can we create a single Test Runner- which can include @Runwith- for both- Cucumber.class and Karate.class- To write a Scenario in a feature file something like this- Scenario: soap 1.1 Given request """ 2 3 """ When soap action ' http://tempuri.org/Add ' Then status 200 And match /Envelope/Body/AddResponse/AddResult == 5 And print 'response: ', response Then user logs in to the GUI app And passes value of "variable" from the response in field X
So- how can we create a single Test Runner- which can include @Runwith- for both- Cucumber.class and Karate.class- To write a Scenario in a feature file something like this- Scenario: soap 1.1 Given request """ 2 3 """ 当 soap action ' http://tempuri.org/Add ' 然后状态 200 并匹配 /Envelope/Body/AddResponse/AddResult == 5 并打印 'response: ', response 然后用户登录到 GUI 应用并从字段 X 的响应中传递“变量”的值
Karate can replace Selenium now , you can use Karate for your entire end-to-end flow. 空手道现在可以代替 Selenium ,您可以将空手道用于您的整个端到端流程。 Pay attention to point (9).
注意第(9)点。
Also see this answer: https://stackoverflow.com/a/47233301/143475另请参阅此答案: https://stackoverflow.com/a/47233301/143475
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.