specflow

How to properly manage and access webdriver instances to avoid problems with parallel execution of tests?

ⅰ亾dé卋堺 提交于 2019-12-24 00:38:04
问题 I've seen several approaches to instantiate web driver in Specflow examples. Creating it in the steps definition class and disposing it in Dispose method for the class Why is it horrible? Cause 1 scenario doesn't equal 1 steps definition class as some steps are just shared between features and there will be more than 1 web driver instantiated. Example: https://www.softwaretestinghelp.com/specflow-and-selenium/ Creating it in hooks [BeforeScenario] and destroying int in [AfterScenario] It won

Having Multiple Step Files Opens Multiple Browsers

爱⌒轻易说出口 提交于 2019-12-23 22:27:51
问题 The Problem: If I have more than one Steps file, when I execute tests it seems that the WebDriver creation for each is being happening regardless of which test(s) I run. I was seeing a seemingly random Chrome Browser open up whenever I ran my tests. In an attempt to see if there was some sort of incompatibility between SpecFlow and ChromeDriver (a long shot, I know), I changed the WebDriver for my search tests to Firefox and left the WebDriver for my login tests as Chrome. No matter what test

OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server timeout

Deadly 提交于 2019-12-23 21:47:43
问题 I'm getting the following error from my TeamCity CI server. The Specflow BDD I'm running works fine locally - the build server has its firewall turned off, All ports open, IE, Firefox and Chrome drivers installed - same result with all 3 drivers. I've set timeouts to 100 seconds, tried putting the thread to sleep without change. Is there a way to run the test manually on the CI server to see what the issue is? Test(s) failed. OpenQA.Selenium.WebDriverException : The HTTP request to the remote

How do I use SpecFlow's “Scenarios” keyword?

前提是你 提交于 2019-12-23 09:15:04
问题 In my feature file, IntelliSense says that there is a keyword called Scenarios . Note that it is plural . I've poured through the documentation and can't find any references to it. Can anybody explain what it is for and how it can be used? 回答1: That's a synonym to the Examples word used in for different Scenarios using the Scenario Outline construct... Or in plain English; if you use a Scenario Outline you can list the different examples under the keyword "Examples", or under the keyword

How to get Gherkin syntax highlighting for .feature files in Visual Studio?

青春壹個敷衍的年華 提交于 2019-12-23 08:29:15
问题 There's no highlighting for Feature, Scenario, Given, When, Then, etc. keywords by default. Is there a ready made template out there to enable this? 回答1: The recent vesions of SpecFlow have a built-in syntax highlighting for VS2010. 回答2: http://github.com/henritersteeg/cuke4vs does exactly this. 来源: https://stackoverflow.com/questions/2959173/how-to-get-gherkin-syntax-highlighting-for-feature-files-in-visual-studio

Make SpecFlow / Cuke4VS understand non-English .feature files

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 04:09:16
问题 I'm trying to use SpecFlow in our (Visual Studio 2008) project to define executable acceptance tests. It was a decision made by the dev team to use our native German as the language for the feature files - so we added this little snippet of config to our test project: <configuration> <configSections> <section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow"/> </configSections> <specFlow> <language feature="de-DE" tool="" /> </specFlow> <

SpecRun returning exit code 120 with @ignore tests

大兔子大兔子 提交于 2019-12-22 14:59:37
问题 Running SpecRun from command line as part of a Continuous Integration setup, and recently an ignored ( @ignore ) test generated an exit code of 120 when SpecRun completed. Currently, we break the build on any exit code not equal to 0 (universal success indicator!). What does exit code 120 mean exactly? Is it simply "A test was ignored"? or does it imply more? What other values are returned? Sample build output below. We collect all exit codes (currently 1 SpecRun task, so only 1 exit code is

specflow fails when trying to generate test execution report

我的未来我决定 提交于 2019-12-22 04:18:14
问题 I've got a project that's using SpecFlow, NUnit and Coypu to do acceptance tests on a web application. I've got the project building OK via Jenkins on a build server. Jenkins calls a psake script which runs msbuild on the specs project, then the script calls nunit-console to run the specs/tests, and then I want to generate a report from SpecFlow. Framework "4.0" task Default -depends RunSpecs task BuildSpecs { $env:EnableNuGetPackageRestore = "true" msbuild /t:Rebuild ReturnsPortal.Specs

Specflow use parameters in a table with a Scenario Context

左心房为你撑大大i 提交于 2019-12-21 03:57:23
问题 I am using Specflow in C# to build automatic client side browser testing with Selenium. The goal of these tests is to simulate the business scenario where a client enters our website in specific pages, and then he is directed to the right page. I Want to use parameters inside a Scenario Context, for example: When I visit url | base | page | parameter1 | parameter2 | | http://www.stackoverflow.com | questions | <questionNumber> | <questionName> | Then browser contains test <questionNumber>

Unit Test Adapter threw exception: Unable to load one or more of the requested types

倾然丶 夕夏残阳落幕 提交于 2019-12-21 03:45:37
问题 I am attempting to run SpecFlow tests from the Visual Studio 2010 Command Prompt, and I am getting a rather obtuse error message: Unit Test Adapter threw exception: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.. Some info about my VS2010 Project setup: Windows 7 Enterprise, 64 bit (Version 6.1.7601 Service Pack 1 Build 7601) Visual Studio 2010 Premium (v10.0.40219.1 SP1Rel) Using Coded UI Tests Using SpecFlow 1.9.0, which