Run Selenium tests in multiple browsers one after another from C# NUnit

前端 未结 8 1685
清酒与你
清酒与你 2020-11-29 01:39

I\'m looking for the recommended/nicest way to make Selenium tests execute in several browsers one after another. The website I\'m testing isn\'t big, so I don\'t need a par

8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-29 02:03

    I was wondering about the same issue and finally i got solution

    So when you install plugin you then are able to controll in which browser should scenario be tested.

    Feature example:

    @Browser:IE
    @Browser:Chrome
    Scenario Outline: Add Two Numbers
        Given I navigated to /
        And I have entered  into summandOne calculator
        And I have entered  into summandTwo calculator
        When I press add
        Then the result should be  on the screen
        Scenarios:
            | SummandOne | SummandTwo | Result |
            | 50 | 70 | 120 |
            | 1 | 10 | 11 |
    

    Implementation

    [Given(@"I have entered '(.*)' into the commentbox")]
    public void GivenIHaveEnteredIntoTheCommentbox(string p0)
    {
                Browser.Current.FindElement(By.Id("comments")).SendKeys(p0);
    }
    

    More info

提交回复
热议问题