Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98221

Is there a way to set the number of rows to run on the TestContext from the number of rows that was returned

$
0
0

Hi I know we can use DataSource attribute to decorate a testmethod and do data driven test. My question is it possible to set number of rows to run after the data has returned. Meaning if i get back 100 rows is there a way to specify that i only want to run 25rows instead of 100rows.

 [DataSource(connectionstring, "tableName"),
    TestMethod]
    public void Dosomething()
    {

    }

I was also thinking of doing a for loop withing the test method and call the datasource and get the number of rows i want from the datasourse but the problem i would still have is to be able to set TestContext but if the test fails inside of the for loop it seems like it would be more of a headache to code and make sure that it returns to the loop. I haven't fleshed this idea out but just stating alternatives that i've thought about.


Viewing all articles
Browse latest Browse all 98221

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>