Webservice调用的“按时间提供"方案 [英] Given-When-Then scenarios for Webservice calls

查看:122
本文介绍了Webservice调用的“按时间提供"方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用Specflow自动化我们的回归套件,但是现在我们希望将其带入自动化Web服务的新水平.

使用小黄瓜"Gven-When-Then",我如何使用/编写Web服务调用.

例如:对于以下请求,我如何编写给定的-什么时候-然后?

<ns:request>
    <ns1:ServiceAuthenticationRequest>
        <ns1:Password>?</ns1:Password>
        <ns1:Station>?</ns1:Station>
        <ns1:UserName>?</ns1:UserName>
    </ns1:ServiceAuthenticationRequest>
    …
</ns:request>

解决方案

除非您自己编写Web服务代码,否则通用Web服务的行为可能并不那么有趣.

您的网络服务做什么?

1)您能举个例子吗?

2)在任何情况下,您的Web服务的行为都将与此不同吗?

如果您可以回答这些问题,则可能会更好地了解将什么用作第一个场景,然后是第二个场景. Web服务行为不同的情况是上下文(给定);这些环境所带来的结果将是结果(变化).调用网络服务将是您的活动.如果您的Web服务具有不同的功能,则每个服务可能会有不同的事件.

与任何与BDD相关的内容一样,与某人进行对话,看看是否可以给他们一些您正在思考的示例/请他们提供一些示例,以使他们比您了解的更多.

We are using Specflow for automating our regression suite but now we would like to take it to a next level of automating our webservices.

Using the Gherkin "Gven-When-Then", how can I use / write the webservices calls.

For e.g : How do I write my given - when - then for the below request?

<ns:request>
    <ns1:ServiceAuthenticationRequest>
        <ns1:Password>?</ns1:Password>
        <ns1:Station>?</ns1:Station>
        <ns1:UserName>?</ns1:UserName>
    </ns1:ServiceAuthenticationRequest>
    …
</ns:request>

解决方案

Unless you're writing webservice code itself, the behaviour of a generic webservice probably isn't that interesting.

What does your webservice do?

1) Can you give me an example?

2) Is there any situation in which your webservice would behave differently to that?

If you can answer those questions, you'll probably have a better idea of what to use as your first, and then second, scenario. The situations in which the webservice behaves differently are the contexts (givens); what you get as a result of those contexts will be the outcomes (thens). Calling the webservice will be your event. If your webservice has different capabilities, you'll probably have different events for each one.

As with anything related to BDD, have a conversation with someone and see if you can give them some examples of what you're thinking / ask them for some examples if they're more knowledgeable than you are.

这篇关于Webservice调用的“按时间提供"方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆