I'm looking for a bit of assistance with my plan layout if possible
如果可能的话,我正在为我的计划布局寻求一些帮助
Currently what I have is the following which works well:
目前我所拥有的是以下哪个效果很好:
@dataprovider connects to a mysql database, then stores 300 results into an array @test loops for all 300 entries and all tests pass
@dataprovider连接到一个mysql数据库,然后将300个结果存储到一个数组@test循环中,用于所有300个条目,所有测试都通过
What I need, and I'm struggling with is:
我需要的是,我正在努力的是:
After the @test has finished I then need to somehow go back to the dataprovider (with a variable) then run the tests again.
在@test完成之后,我需要以某种方式返回到数据提供者(带有变量),然后再次运行测试。
If you imagine a directory structure, I query the database for all categories beginning with A, test the results then re-query the database for categories beginning with B and re-test the outcome.
如果您想象一个目录结构,我在数据库中查询以A开头的所有类别,测试结果然后重新查询数据库以查找以B开头的类别并重新测试结果。
Not sure how to go about this, so far I've tried to add in a loop into my @dataprovider, so the array have for example 300 A categories, 300 B categories etc. But this was giving me all sorts of issues with the array.
不知道如何解决这个问题,到目前为止我已经尝试在我的@dataprovider中添加一个循环,所以数组有例如300个A类别,300个B类别等。但这给了我各种各样的问题阵列。
Any ideas how I can achieve this or would I need a separate class for each data query? Mike
任何想法如何实现这一点,还是我需要为每个数据查询单独的类?麦克风
1 个解决方案
#1
0
Dataprovider can return an Object[][] Array. Did you try something like this:
Dataprovider可以返回Object [] []数组。你尝试过这样的事情:
@DataProvider(name="categoryloader")
public Object[][] createData(){
return new Object[][]{
{"CatgoryA",new String[300]},
{"CatgoryB",new String[300]},
};
}
#1
0
Dataprovider can return an Object[][] Array. Did you try something like this:
Dataprovider可以返回Object [] []数组。你尝试过这样的事情:
@DataProvider(name="categoryloader")
public Object[][] createData(){
return new Object[][]{
{"CatgoryA",new String[300]},
{"CatgoryB",new String[300]},
};
}