Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8057135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:55:42+00:00 2026-06-05T08:55:42+00:00

We are trying to do some automated UI testing using Selenium. So far for

  • 0

We are trying to do some automated UI testing using Selenium. So far for one function, we write at least 3 tests for IE, FF, Chrome.

For example, we wrote 3 tests: LoginTestFF, LoginTestIE, LoginTestChrome for the login function. This way, we can see 3 items in the VS Test View, and can select one or all of them to run.

Thanks to Selenium, the test code for each browser are pretty much same. So we don’t want to repeat that again.

Is it possible to see the tests in the VS Test View like:

LoginTestFF
LoginTestIE
LoginTestChrome

but using one set of test code?

I’ve found that the [Browser] attribute in xUnit should be OK.

How do develop such an attribute for Visual Studio Testing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T08:55:43+00:00Added an answer on June 5, 2026 at 8:55 am

    If you still want to see all three of them is VS test view, you may try this. (But what if you have ten different browsers?)

    [TestMethod]
    public void LoginTestFF() {
        ExecuteLoginTest();
    }
    
    [TestMethod]
    public void LoginTestIE() {
        ExecuteLoginTest();
    }
    
    [TestMethod]
    public void LoginTestChrome() {
        ExecuteLoginTest();
    }
    
    public void ExecuteLoginTest() {
        //real test steps
    }
    

    If you just want to reuse code for all browsers, you may define your desired browser in App.config, then use a switch case to select.

    <add key="Browser" value="Chrome"/>
    
    IWebDriver driver;
    string browser = ConfigurationManager.AppSettings["Browser"];
    switch (browser) {
        case "Firefox":
            driver = new FirefoxDriver();
            break;
        case "IE":
            driver = new InterntExplorerDriver();
            break;
        case "Chrome":
            driver = new ChromeDriver();
            break;
        default:
            break;
    }
    
    // if this test can only be run against FF and Chrome, add test category to it
    [TestMethod, TestCategory("Firefox"), TestCategory("Chrome")]
    public void LoginTestTest() {
        //real test steps
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently trying to write some automated tests within instruments and am having
I am trying to do some automated testing against a complex Android app and
I am trying to do some automated web testing of my ASP.NET application. I
I am currently trying to set up WatiN to do some automated testing of
I'm trying to get some automated UI testing going on a GWT application and
We are trying to integrate tests in our daily builds using TestComplete, so far
I'm trying to incorporate some JavaScript unit testing into my automated build process. Currently
I'm trying to use the Java Robot class to do some automated testing for
I am trying build an automated testing framework for some of our internal web
I am trying to perform some automated tests on a JSF page that is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.