SpecSource DataSource Attribute for Testing Multiple Browsers

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>

...
+4
2

- agnostic. Coypu. , - (, Selenium, Phantom JS, WaitN) .

- factory (. ):

sessionConfiguration.Driver = Type.GetType("Coypu.Drivers.Selenium.SeleniumWebDriver, Coypu");
sessionConfiguration.Browser = Drivers.Browser.Parse("firefox");

Selenium FireFox "firefox" "chrome", Chrome.

, . , .

0

Baseclass.Contrib.SpecFlow.Selenium.NUnit dll.

. :

@Browser:IE

@Browser:Chrome

@Browser:Firefox

:

@Browser:.......... . 3 , , .

.

0

Source: https://habr.com/ru/post/1570026/


All Articles