specflow

Is it possible to create reusable and generic Specflow step definitions for multiple similar screens using page objects?

只谈情不闲聊 提交于 2020-05-15 10:18:06
问题 I am working on an app with many similar datatable / CRUD screens. I use Selenium with page objects pattern to navigate in the app, and object mothers to create predefined test data especially for forms with many inputs. While writing feature files, it occurred to me that the tests are so similar to each other and that it should be possible to generalize some common steps for the sake of reuse and DRYness. The DataTable page object was easy, since selectors are the same for all the pages. So

How to execute specflow feature files in different environments and different browsers through dynamical

和自甴很熟 提交于 2020-04-30 06:27:06
问题 I am using specflow + specrun for automation project.we have 3 environments staging, uat and production .so I have to pass environments dynamically through command line which I want to run and some times I have to run the scripts in single browser and for some times to run in multiple browsers so how to pass same dynamically through command line, so we have to handle multiple environments at a time different browsers through command line in specrun, I have tried to set different targets but I

Request body does not contain required parameter 'handle'

别说谁变了你拦得住时间么 提交于 2020-03-04 00:11:31
问题 could you please help me, I have problem, when perform tests ON VM (c#/Safari 12/macOS 10.13). Selenium.Support: version=3.141.0 Selenium.WebDriver version=3.141.0 SpecFlow version="2.1.0 I've catch: Current window:page-6CF4B0C0-1AD6-43A0-8E64-2F9EC720E260 New window:page-6CF4B0C0-1AD6-43A0-8E64-2F9EC720E260 error: Request body does not contain required parameter 'handle'. Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:13:22.693Z' System info: host: 'itako39021.prod

Yes, I know about Scenario outline

旧时模样 提交于 2020-02-08 11:29:38
问题 But we use group of scenarios as 1 Test Case, so the one scenario is a one step in a test and therefore we need to define parameters for group of scenarios. In case of Scenario outline and several scenarios only scenario with Outline performs with different parameters: Scenario Outline: scenario A When bla Then bla bla Examples: | Param | | 1 | | 2 | Scenario: Scenario B When param 'Param' Then do 'Param' In this case Scenario A will be executed 2 times then it goes to Scenario B. But I need

Yes, I know about Scenario outline

穿精又带淫゛_ 提交于 2020-02-08 11:29:31
问题 But we use group of scenarios as 1 Test Case, so the one scenario is a one step in a test and therefore we need to define parameters for group of scenarios. In case of Scenario outline and several scenarios only scenario with Outline performs with different parameters: Scenario Outline: scenario A When bla Then bla bla Examples: | Param | | 1 | | 2 | Scenario: Scenario B When param 'Param' Then do 'Param' In this case Scenario A will be executed 2 times then it goes to Scenario B. But I need

Skipping Feature - SpecFlow C#

耗尽温柔 提交于 2020-02-06 10:18:50
问题 I'm looking to intercept a test using the [BeforeFeature] SpecFlow Hook and ignore the entire feature file. private static string FeatureName = FeatureContext.Current.FeatureInfo.Title; [BeforeFeature] public static void BeforeFeature() { Console.WriteLine("Before feature"); if (TestFilter.ShouldBeIgnored(FeatureName)) { // Ignore Feature if it matches TestFilter Requirements } } 回答1: If you are using Specflow + Nunit, you can call Assert.Ignore("ignore message here"); This will cause the

is there a way to use .feature file as input

只愿长相守 提交于 2020-01-25 17:51:33
问题 i'm currently trying to learn bdd techniques and trying frameworks for it. the idea comes from test to code, but i want to use it in revers way if possible. i'm currently using specflow, selenium and nunit combination. i want to open my work to anyone (non-developers) for adding new examples or test cases. let's say i have implemented all use cases but changing step orders or modifying/adding examples would enrich my test cases. the problem is that i have to build the project for each change

Using a background step like an Outline Step

蓝咒 提交于 2020-01-25 09:49:04
问题 I would like to be able to define a set of run rules that will run for every scenario in the file. and the easiest place to put these would be in the background but they would need to have an examples table much like a scenario outline. Feature: Example Feature File In order to perform as task As I user I want this test to work Background: Given I have used <data> in my test Examples: | data | | test string | | test String 2 | Scenario Outline: Running a test Given I have prepared the test

Error CS7036 There is no argument given that corresponds to the required formal parameter 'driver' of 'SpecflowBaseTest.SpecflowBaseTest(IWebDriver)'

社会主义新天地 提交于 2020-01-24 19:46:09
问题 I am creating a new framework as PageFactory has been deprecated. I am getting the error Error CS7036 There is no argument given that corresponds to the required formal parameter 'driver' of 'SpecflowBaseTest.SpecflowBaseTest(IWebDriver)' UnitTestProject1 D:\Selenium Projects\Olympus\UnitTestProject1\UnitTestProject1\Steps\LoginSteps.cs 14 Active My full code snippet of my framework is below. I am trying the dependency injection because PageFactory is deprecated, not used anymore. I am not

SpecFlow + Selenium2 + ASP.NET MVC + TeamCity Not Working

好久不见. 提交于 2020-01-24 15:05:26
问题 I have some SpecFlow features which are using Selenium 2 to automate some UI testing of an ASP.NET MVC 3 application. When I run these locally, it runs fine and the tests pass. Once committing my changes to Git and pushing the commits to our remote repository for our TeamCity instance to pick up, the tests run and take a hell of a lot longer, only to fail with the following. Test(s) failed. OpenQA.Selenium.WebDriverException : No response from server for url http://localhost:7055/hub/session