I have some ui web tests in C # that run through selenium in a browser. Currently, these are just simple unit tests and they run again in different browsers. I want to port the test to specflow, but I really don't know how to perform a bit of testing for multiple browsers.
Currently, to run these tests in multiple browsers, I use the DataSource attribute , which basically uses different inputs for the same tests from the XML file
[TestMethod]
[Ignore]
[DeploymentItem("JLL.Specs\\Browsers.xml")]
[DataSource("Microsoft.VisualStudio.TestTools.DataSource.XML", "|DataDirectory|\\Browsers.xml", "Row", DataAccessMethod.Sequential)]
public void LoadHomePageAndFindSearchBox()
{
...
}
The problem is that Specflow does not support the DataSource attribute. Any idea?
This is the XML file:
<?xml version="1.0" encoding="utf-8" ?>
<Rows>
<Row>
<browser>Firefox</browser>
<browser_version>31.0</browser_version>
<os>Windows</os>
<os_version>7</os_version>
<resolution>1280x1024</resolution>
<browserName></browserName>
<platform></platform>
<device></device>
</Row>
<Row>
<browser>Chrome</browser>
<browser_version>36.0</browser_version>
<os>Windows</os>
<os_version>XP</os_version>
<resolution>1024x768</resolution>
<browserName></browserName>
<platform></platform>
<device></device>
</Row>
...