Ukraine Office: +38 (063) 50 74 707

USA Office: +1 (212) 203-8264

contact@testmatick.com

Manual Testing

Ensure the highest quality for your software with our manual testing services.

Mobile Testing

Optimize your mobile apps for flawless performance across all devices and platforms with our comprehensive mobile testing services.

Automated Testing

Enhance your software development with our automated testing services, designed to boost efficiency.

Functional Testing

Refine your application’s core functionality with our functional testing services

VIEW ALL SERVICES 

Discussion – 

0

Discussion – 

0

UI Automation with SpecFlow

UI-Automation-with-SpecFlow

UI processes can be slow, contain bugs, and decelerate your work.

[highlight dark=”no”]If a DB is constantly changed, it should be maintained.[/highlight]

Test configuration, bug fixing, and adjusting to software updates can become serious issues.

This article gives a useful overview of ways to execute UI automation with SpecFlow and C#.

SpecFlow

SpecFlow

Preliminary configuration of SpecFlow and Visual Studio

When you create a project, you should install a few NuGet packages manually.

This can be done by selecting Tools > NuGet Package Manager > Manager NuGet Package Manager for Solution.

A typical build should contain the following packages:

  1. Selenium. Support
  2. Specflow
  3. Specflow.Tools.MsBuild.Generation
  4. Xunit
  5. Xunit.core
  6. Xunit.runner.visualstudio

After this, you should launch the application by using automated processes.

You can launch code with the help of Chrome that goes to a required page and maximizes a screen to make a user see everything happening in the browser’s window so that tests can start on a proper web browser’s size.

An Example of a Test

An Example of a Test

The next stage is basic work with test scripts.

SpecFlow uses scripts instead of tests.

These test scripts are based on the Gherkin syntax where any test step starts with “if” or “else”.

Before taking the next steps, you need to learn how so-called locators work.

They are used to find certain elements that are shown on a web page.

Users won’t be able to interact properly with selected elements on pages without them.

The next groups can become the most popular locators used during your work:

public IWebElement ContactSection => Driver.FindElement(By.XPath(“.//div[@class=’row contact’]//div[@class=’col-sm-5′]”));
public IWebElement FormSection => ContactSection.FindElement(By.XPath(“//form”));
public IWebElement NameTextBox => FormSection.FindElement(By.Id(“name”));
public IWebElement EmailTextBox => FormSection.FindElement(By.Id(“email”));
public IWebElement PhoneTextBox => FormSection.FindElement(By.Id(“phone”));
public IWebElement SubjectTextBox => FormSection.FindElement(By.Id(“subject”));
public IWebElement MessageTextBox => FormSection.FindElement(By.Id(“description”));
public IWebElement SubmitButton => FormSection.FindElement(By.Id(“submitContact”));

Conclusion

These are only a few examples of the main steps that can be used for test automation.

[highlight dark=”no”]But still, you should start with small actions before developing more complex steps.[/highlight]

You should operate some working tests and then increase work complexity until tests contain all required steps and tests.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

You May Also Like

Encapsulation as One of the Fundamental Principles of Object-Oriented Programming

Encapsulation as One of the Fundamental Principles of Object-Oriented Programming

Knowing the basics of object-oriented programming is necessary not only for programmers, but also, of course, for testers who interact with program code, study it, or write it. Insight into programming fundamentals enables QA experts to better understand the program behavior, give effective recommendations on how to improve the structure of program code, and, more efficiently create autotest code.

Test Automation Strategies That Really Work

Test Automation Strategies That Really Work

An approach to the development and implementation of automated tests for an application-in-test depends on numerous factors. A size and complexity of an application, a structure of a project team, instantly appearing deadlines, requirements for security, and many other details define the most suitable strategy. Further, we will describe some working strategies that can be helpful for any project that requires automation.

Using Test Retries as a Method to Hide Bugs

Using Test Retries as a Method to Hide Bugs

Every tester is in some way familiar with the concept of randomly failing automated tests. An analysis of the results of these tests can be really time-consuming and some teams prefer running tests once again if they fail. But is this efficient? The answer is not as obvious and clear as it seems.