帮助网站进行数据驱动的测试 [英] help with data driven testing of a website

查看:111
本文介绍了帮助网站进行数据驱动的测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试遍历一个Web请求固定次数,但是因为我的Web测试是数据绑定的,所以所有请求的运行次数是数据库中记录的次数.

我的情况如下:
我必须为数据库中的前10条记录验证Web request-1,并为接下来的10条验证Web request-2,依此类推.但是目前,由于数据绑定,所有请求都针对数据库中的所有记录运行.我可以根据某些条件执行类似的操作来限制Web请求仅运行固定次数吗?如果是,请提示我该怎么做!

在此先感谢!!

Hi

I am trying to loop through a web request a fixed number of times, but because my web test is data bound , all the requests are run the number of times as there are records in a database.

My scenario is as follows:
I have to validate web request-1 for the first 10 records in the database and web request-2 for the next 10 and so on. But presently, due to data binding all the requests are run for all the records in the database. Can I do something like restricting the web request to run only for a fixed number of times depending on some conditions? If yes, please hint on how I can do it!!

Thanks in advance!!

推荐答案

在不了解您使用的技术的情况下,您无法为每个请求修改数据源以仅返回所需的记录绑定?

因此,如果您绑定到当前使用SQL处理所有请求的SQL数据库:
Without knowing the technology that your using...can''t you modify the datasource for each request to only return the records you want to bind against?

So if you''re binding to a SQL database currently using this for all requests:
SELECT Id, FirstName,LastName,EmailAddress FROM Contact



只需为此修改请求1



Simply modify to this for Request 1

SELECT TOP 10 Id, FirstName,LastName,EmailAddress FROM Contact



只需将其修改为请求2



Simply modify to this for Request 2

SELECT TOP 10 Id, FirstName,LastName,EmailAddress FROM Contact WHERE Id>10





如果要绑定由文件名引用的XML文档,则将不同的结果集分离到不同的文件中.



etc.

If you binding against an XML document referenced by filename, then segregate the different result sets into distinct files.


这篇关于帮助网站进行数据驱动的测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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