SpecFlow | SpecFlow automates | Functional Testing library

 by   SpecFlowOSS C# Version: v4.0.31-beta License: Non-SPDX

kandi X-RAY | SpecFlow Summary

kandi X-RAY | SpecFlow Summary

SpecFlow is a C# library typically used in Testing, Functional Testing, Cucumber applications. SpecFlow has no bugs, it has no vulnerabilities and it has medium support. However SpecFlow has a Non-SPDX License. You can download it from GitHub.

SpecFlow is a pragmatic BDD solution for .NET. It provides test automation for .NET (.NET Framework, .NET Core and Mono), based on the Gherkin specification language and integrates to Visual Studio. For questions please post them in our community discussion group. For issues/bugs please use the issue tracker on GitHub.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              SpecFlow has a medium active ecosystem.
              It has 2104 star(s) with 753 fork(s). There are 152 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 237 open issues and 1524 have been closed. On average issues are closed in 44 days. There are 12 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of SpecFlow is v4.0.31-beta

            kandi-Quality Quality

              SpecFlow has 0 bugs and 0 code smells.

            kandi-Security Security

              SpecFlow has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              SpecFlow code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              SpecFlow has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              SpecFlow releases are available to install and integrate.
              Installation instructions are available. Examples and code snippets are not available.
              SpecFlow saves you 109 person hours of effort in developing the same functionality from scratch.
              It has 705 lines of code, 6 functions and 743 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of SpecFlow
            Get all kandi verified functions for this library.

            SpecFlow Key Features

            No Key Features are available at this moment for SpecFlow.

            SpecFlow Examples and Code Snippets

            No Code Snippets are available at this moment for SpecFlow.

            Community Discussions

            QUESTION

            Unable to click web element by xpath via selenium chrome driver
            Asked 2022-Apr-11 at 11:48

            Hellow, i have pop-up window with 'select' element in chrome browser, i need to click this 'select' element in my ui-test scenario. It is on image: my web page

            I am using c# and TechTalk.SpecFlow. I am trying to click it like this:

            ...

            ANSWER

            Answered 2022-Apr-11 at 11:48

            A couple of suggestions. I would try suggestion 1 first. If that doesn't work, try suggestion 2 as well:

            1. Don't Use Exact XPaths — I see this frequently. Use a combination of tag names, attributes and parent elements to make your locators more robust. In fact, the tag has an Id. Use that. Id attributes must be unique in the HTML document (if they aren't, it is a bug that should be fixed): Browser.ClickWebElementNew("//select[@id = 'state']", FoundBy.XPath); This can help keep your tests passing when minor HTML changes are made in the future. Use An Explicit Wait — You will likely need this as well. You will need to wait for the element to be clickable. If using Selenium 3 or if you have the DotNetSeleniumExtras NuGet package installed, use ExpectedConditions in the ClickWebElementNew method: public void ClickWebElementNew(string findElement, FoundBy f) { var wait = new WebDriverWait(_chromeDriver, TimeSpan.FromSeconds(30)); By locator = null; if (f == FoundBy.XPath) { locator = By.XPath(findElement) } else if (f == FoundBy.CssSelector) { locator = By.CssSelector(findElement); } else { throw new InvalidOperationException("Unsupported FoundBy"); } var element = wait.Until(ExpectedConditions.ElementToBeClickable(locator)); element.Click(); } If using Selenium 4 and you don't have the DotNetSeleniumExtras package installed, this should work: var element = wait.Until(d => { d.FindElement(locator).Click(); return true; }); element.Click(); The main reason for "waiting for the element to be clickable" is because certain user interface animations prevent Selenium from interacting with elements. These can be subtle, but important. Any movement, or fade-in can cause issues with interacting with the page. If ideas 1 and 2 do not work, look to see if the element is inside a frame or iframe. You need to switch to the frame before interacting with its elements. Also look for elements that overlap that same region of the page. This can cause problems too, especially if running in headless mode and you are not setting a window size.

            Source https://stackoverflow.com/questions/71824703

            QUESTION

            C# SendKeys command is not working in full execution
            Asked 2022-Apr-10 at 14:55

            Sendkeys is entering the value for below search dropdown only in debug mode.It doesn't work in full run even after adding waits or clicking and entering the value. Using Javascript, I'm able to enter the value in full run but search results are not shown which is not allowing me to select the value from the list of search results. HTML code: code image

            Code for sendkeys used: driver.FindElement(FirstDestination).SendKeys("italy");

            Code for javascript used:

            ...

            ANSWER

            Answered 2022-Apr-10 at 14:55

            You can use WebDriverWait to send the keys like below:

            Source https://stackoverflow.com/questions/71814470

            QUESTION

            How to update "Area Path" of a test case in Azure Devops using Azure Devops Services Rest API
            Asked 2022-Apr-02 at 15:24

            I write test cases in Visual Studio - Specflow feature file. Post that, I use "AzureDevops Test Connector" to migrate test cases into Azure Devops - Test Plan -> Test Suite(Which are already created in Azure Devops by me).

            My requirement is to update, "Area Path" and "Iteration" for the newly created test cases.

            I am able to update "Area Path" and "Iteration" for Test Plan and Test suite using Azure Devops Services Rest APIs. But, there is no provision to update these values in Test Case. Any lead will be much appreciated. Below is what i tried. Thanks in advance!

            .

            PATCH CALL TO UPDATE AREA PATH AND ITERATION PATH - BUT IT IS NOT WORKING | SCREENSHOT FROM POSTMAN

            ...

            ANSWER

            Answered 2022-Apr-02 at 14:40

            I was able to achieve this by using "work item" instead of "Test Case". Using this, I am able to update all the field values.

            Postman - add Content-Type = application/json-patch+json | under headers separately. Keep body as "raw" and "JSON" in drop down.

            Azure Devops Work Items Rest API Details

            Source https://stackoverflow.com/questions/71717822

            QUESTION

            Cosmos Emulator randomly failing tests on Linux
            Asked 2022-Mar-25 at 00:30

            I'm trying to run Cosmos Emulator on Linux, to run tests using SpecFlow.

            After installing it following these instructions, and successfully running it, a variable number of tests randomly failed all the times I tried to run them.

            The failed tests throw a CosmosException with a 503 (Service Unavailable) status code.

            All these tests work just fine on Windows and, depending on how I run them, either via the terminal or VSCode, the number of failures differs.

            ...

            ANSWER

            Answered 2022-Mar-25 at 00:30

            The problem was with the docker command provided within the documentation:

            Source https://stackoverflow.com/questions/71520048

            QUESTION

            Is it possible to load SpecFlow tests from a file?
            Asked 2022-Mar-18 at 14:19

            I'd like to give a library + SpecFlow project to a client and let them add new SpecFlow scenarios without needing to generate source code / compile.

            Is it possible to load a set of tests from a text file and run those?

            ...

            ANSWER

            Answered 2022-Mar-18 at 14:19

            SpecFlow scenarios are just plain text files. There is nothing stopping your client from opening up Notepad or any other text editor and writing new scenarios or features. They could even just write them in an e-mail and send it to you.

            Visual Studio and the SpecFlow extension just make it easier to write new scenarios, because it enables auto-complete for steps. If your client doesn't need step suggestions, then any text editor will do.

            Once you have their new scenarios, you can add new feature files to your test project. This will enable the step bindings and allow you to run the tests.

            If you want the client to write scenarios and be able to run them, you are out of luck. That isn't supported unless you create a windows app that imports your step definitions, test dependencies and then parses the feature files into test classes before executing them.

            So, you can partially get what you want.

            1. Clients can write new scenarios in any text editor they want.
            2. You would need to copy those scenarios into feature files in your test project.
            3. You would be the one running the tests, not the client.

            Source https://stackoverflow.com/questions/71527482

            QUESTION

            Could not load type 'OpenQA.Selenium.Internal.IWrapsElement' from assembly 'WebDriver, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null'
            Asked 2022-Mar-16 at 04:05

            I am creating automated tests with selenium and specflow using C#. Today I had to update Selenium.WebDriver to version 4.0.0-beta4 because of logging functionality, which has a bug in previous versions with AvailableLogTypes property, which was always throwing null reference exceptions. After updating to selenium 4, another problem raised up. Build works fine without errors or warnings but when I run tests, following exception is thrown:

            ...

            ANSWER

            Answered 2021-Sep-10 at 06:24

            So here is how I fixed this:

            1. I removed DotNetSeleniumExtras packages from code.
              After that, I was finally able to gather performance logs from browser because I got rid of errors shown in my question.
            2. After removal of DotNetSeleniumExtras package I lost PageFactory for initialization of page objects.
              I fixed this problem by converting all web elements (properties of page object) into computed properties:

            Source https://stackoverflow.com/questions/68725481

            QUESTION

            Access internal constructor outside the assembly
            Asked 2022-Mar-10 at 07:44

            I reviewed the code of Specflow in github and found a tricky issue that I cannot understand.

            Line 69 in https://github.com/SpecFlowOSS/SpecFlow/blob/master/TechTalk.SpecFlow/ScenarioContext.cs

            ...

            ANSWER

            Answered 2022-Mar-10 at 07:44

            Because of InternalsVisibleTo. This enables access to internal types, methods, etc. to every object calling from the authorized assembly.

            In https://github.com/SpecFlowOSS/SpecFlow/blob/master/TechTalk.SpecFlow/AssemblyAttributes.cs the assembly TechTalk.SpecFlow is decorated with some of this attributes, exposing all the internal methods to the listed assemblies:

            • TechTalk.SpecFlow.RuntimeTests
            • TechTalk.SpecFlow.PluginTests

            It's a very common and useful technique used to test methods that should not be accessible to anyone, but that need to be tested.

            Source https://stackoverflow.com/questions/71420335

            QUESTION

            What does red text on a green line mean in a AWS Pull Request diff?
            Asked 2022-Feb-22 at 10:28

            Today I saw this for the first time in a pull request diff in AWS. The line is green and with a plus, so it is added. But the text is red and with slightly red background. The file is a SpecFlow (*.feature) file.

            Does it signify spell-checker, or something else?

            ...

            ANSWER

            Answered 2022-Feb-22 at 10:28

            I have never used SpecFlow or AWS CodeCommit, but a little bit of experimentation (for lack of thorough available documentation) strongly suggests that AndrewF's suspicion is correct:

            Syntax highlighting rules highlight invalid statements for a SpecFlow feature file (example found on toolsqa.com) are highlighted with red background. On the left, the same rule seems to cause the grey background for removed invalid statements.

            The highlighting rules seem to support And clauses, just not in the Then part of a scenario, although the language grammar seems to allow this. I blame a bad syntax highlighting rule.

            However, I have a hard time finding a formal grammar specification for Cuccumber/Gherkin that would tell me exactly what is and isn't allowed where (and what a compliant parser would make of it).

            Edit

            Why didn't I think of checking the source view first? Looking at the HTML/CSS rules of the above diff, one can see the markup in black and white: Red background equals . The same applies to the grey Foo on the left side of the diff.

            Source https://stackoverflow.com/questions/70751955

            QUESTION

            SpecFlow tests no longer appear in Visual Studio 2019 Test Explorer after PackageReference migration
            Asked 2022-Feb-21 at 17:26

            I did a recent migration of my company's legacy app from packages.config to PackageReferences. We have 5 projects: the main ASP.NET web app, a SQL connector model project, an xUnit test project, a FluentAssertions test project, and a SpecFlow project (and no I did not set this all up). My current goal was to move all of the packages.config to properly use NuGet in PackageReference in the csproj files for an eventual move from .NET Framework 4.6.1 to .NET Core. Unfortunately, we are not ready for such a move yet.

            I have done the migration for all the projects. With some fiddling, all of them build and most run correctly. Our web project builds and runs (we still need proper smoke testing but it looks good so far). Our FluentAssertions and XUnit projects also build and run all of their tests flawlessly. We do have some warnings, but there is less of them then there was before this migration.

            What is not working is the SpecFlow tests. Specifically, the SpecFlow tests are not being populated in the Test Explorer automatically in Visual Studio 2019. They were before this migration. We need these tests to run (for now) in our automated build process. We are fixing our technical debt in stages.

            I have investigated online for the past couple of days and can make the following claims about our SpecFlow project:

            1. We have NUnit3 added in the Extensions and it appears to be "functioning". Same with SpecFlow for Visual Studio 2019 extension.
            2. We have all of the NUnit3, MSTest, and SpecFlow NuGet packages from before the migration (in the same versions) as NuGet references post-migration.
            3. If I run the tests from the project's context menu, it says there are 0 tests run.
            ...

            ANSWER

            Answered 2022-Feb-17 at 13:22
            1. If you still have the Visual Studio Extension (VSIX) for the NUnit Visual Studio Test Adapter (and it appears you do from your comment "We have NUnit3 added in the Extensions"), you need to disable or remove it. The VSIX adapter will be used over the Nuget packaged adapter and causes conflicts with the Nuget packaged adapter. The VSIX extension also shouldn't be used in VS 2017 or higher. You can check in Main Menu -> Tools-> Extensions and Updates and look for Nunit3TestAdapter.

              Using VSIX extensions was the old way to use test adapters and runners. It was brittle because you had one version installed in VS that needed to support many different projects and the VS extensions framework is pretty convoluted with awkward hooks into the build life cycle. The new way is to package test adapters and runners as NuGet packages. There is nothing to install and Visual Studio finds the version-specific test adapter and runner libraries for your project besides your test assemblies. You need to use one or the other, and Nuget packages are preferred now, or Visual Studio will fight against you and you'll have issues similar to what you are seeing.

            2. The Visual Studio Test Explorer cache sometimes gets out of whack. Try closing all copies of Visual Studio and cleaning its temp files and folders at C:\Users{$username}\AppData\Local\Temp\VisualStudioTestExplorerExtensions\

            3. You might be running into an issue where the test process is running on the is selecting the wrong architecture of the adapter or other library during test discovery orchestration. Try changing the default processor architecture for tests (Main Menu Test -> Test Settings). Try changing x86 to x64 or vice versa.

            Source https://stackoverflow.com/questions/71149857

            QUESTION

            Azure Devops - Release Pipeline when re-running failed tests azure devops shows failure status even if re-run succeeded
            Asked 2022-Feb-10 at 14:22

            I use Specflow with SpecRunner+ I am using the Deafult.srprofile to to re-run failed tests 3 times in visual studio it shows 2passed 1 failed but the status of the test is a failure, the same goes for azure devops if a re-ran test passes the outcome of the run is a failure. The Failures are sometimes caused by locator timeouts or server timeouts not often but saw it happen few time thats why we decided to implement a re-run.

            Could anyone help on this?

            ...

            ANSWER

            Answered 2022-Feb-10 at 14:22

            The behavior of the report is the correct one and sadly this can't be configured to be changed.

            What you can do is to adjust how the results are reported back to Azure DevOps. You can configure it via the VSTest element in the srProfile- File.

            This example means, that at least one retry has to be passing:

            Source https://stackoverflow.com/questions/71063194

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install SpecFlow

            You can download it from GitHub.

            Support

            Developer Discord channel: #contributing. The main development happens on the master branch. If you are interested in contributing, there is some useful information on this page: Contributing.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/SpecFlowOSS/SpecFlow.git

          • CLI

            gh repo clone SpecFlowOSS/SpecFlow

          • sshUrl

            git@github.com:SpecFlowOSS/SpecFlow.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link