specflow

Navigate to Specflow step from within Step Definitions

天涯浪子 提交于 2019-12-12 03:43:03
问题 So I have a few tests where i've reused steps from within steps. But i'm now having a nightmare on the maintenance front, in that I cant easily navigate between the steps. Here's an example: [Given(@"I have an order")] public void GivenIHaveAnOrder() { Given("an open store"); Given("I am an existing customer"); Given("I am on homepage"); When("I search for a component"); When("I add the component to my basket"); } How do I navigate to one of those internal steps? If I wanted to navigate to

Getting Specflow Tag in WebDriver Method

狂风中的少年 提交于 2019-12-12 03:33:42
问题 I am running an automated test suite using c#, selenium, and specflow. If possible, I would like to be able to see what tag(s) are assigned to the current scenarios so I can instantiate a certain browser type per scenario. Is this even possible using XUnit?? Login Feature File: Feature: Login In order to login to DRIVE As a user We have to enter login details Background: Given I am on the login page @headless Scenario: Logging in as a valid user And I enter a valid user and password When I

Gherkin tests for webservice calls

只愿长相守 提交于 2019-12-12 02:37:34
问题 We are using Specflow for automating our regression suite but now we would like to take it to a next level of automating our webservices. Using the Gherkin “Gven-When-Then”, how can I use / write the webservices calls. For e.g : How do I write my given - when - then for the below request? Request <soapenv:Header/> <soapenv:Body> <ns:GetConsolidatedBookingAccountHistory> <ns:request> <ns1:ServiceAuthenticationRequest> <ns1:Password>?</ns1:Password> <ns1:Station>?</ns1:Station> <ns1:UserName>?<

Setting input textbox text and then retrieving it in Specflow & Selenium

爱⌒轻易说出口 提交于 2019-12-12 02:22:43
问题 Could someone explain to me why in the following .Net Specflow code if my textboxElement's text is empty, then I send keys to it, why is text still empty? (when on screen the textbox's text changes): textboxElement.SendKeys("John Smith"); var text = textboxElement.Text; // text == "" Is it not possible to "refresh" the value of an element? (or have I just missed something really obvious :-)) 回答1: Since it's an input element, you'll need to get it's value property as opposed to it's text . So:

Specflow nunit test report is blank

拟墨画扇 提交于 2019-12-12 02:08:34
问题 I'm writing a Xamarin UI Test app via specflow. Im using Specflow nunit reporting to try and generate a test report I run the unit tests with "C:\Program Files (x86)\NUnit.org\bin\nunit-console.exe" path_to_project_dll I then run the specflow report within the directory of the testresults.xml file "path\specflow.exe" nunitexecutionreport path_to_csproj /out:path_to_html_output The output is a test report that recognises the features but doesnt give any information about the tests. Appreciate

Can't run SpecFlow tests from Visual Studio with MSTest

心不动则不痛 提交于 2019-12-12 01:46:22
问题 I had this working on a previous project and now on a new project I've setup SpecFlow, got it generating tests from my feature file but I can't run the tests from the feature file and instead have to go to the code behind to run the tests. I've also installed the VS extension "Spec Flow for Visual Studio". What can I try? 回答1: as Greg suggested the first thing to check is that your config is set up correctly for ms test. you basically need this: <specflow> <unitTestProvider name="MSTest"/> <

Executing scenario even if one of the step is failed

…衆ロ難τιáo~ 提交于 2019-12-11 18:55:18
问题 Following is just normal example, If Test failed at Step Then I see Level2 MenuLinks It skip all next steps. I would like to know if there is any option to keep executing other steps? Thank you Feature: Menu In order to check MenuLinks Scenario Outline: Open a Page Given I have open the Page Given I see MenuLinks When I click on Level1 in MenuLinks Then I see Level2 MenuLinks And I go back to pagetemplate Given I see Level2 in MenuLinks When I click on Level2 Then I see Level3 MenuLinks 回答1:

SpecFlow Parallel and non Parallel tests

时光怂恿深爱的人放手 提交于 2019-12-11 15:28:07
问题 I'm using SpecFlow to automate my web tests and using parallel execution to speed them up. The issue i have is that one test which checks that invalid passwords are rejected will lock the user account if run 3 times without a successful login. I've set them up to perform a successful login afterwards however running in parallel means against multiple targets they are ran at the same time and still lock the account. Is there a way I can set just this test to not run in parallel so it doesn't

Calling entire feature file(or only when steps) into another feature file

三世轮回 提交于 2019-12-11 10:22:20
问题 I have been trying to call one base feature file which has steps which are repetitive across most of my other scenarios in suite. Since base/common feature file has around 50 odd steps(based on manual TC) and I had to verify every page/element hence it's becoming very long feature file. To avoid confusion I had divided entire base file into small sections by giving the scenario steps after every 4-5 steps to avoid the chain and added "#" as a prefix since I wanted whole file to execute as a

Can we Ignore particular @tag using specflow

北慕城南 提交于 2019-12-11 09:37:23
问题 I am using specflow for writing my feature files .my feature files contains "@Tags"(like:@Authentication,@Login,@Permission,etc...) so i want to run all of them except @Authentication .. so can we use tag like: ~@Authentication so this will execute all test cases except test case containing @Authentication tag 回答1: As you have stated that you are running the tests from the command line using MSTest.exe then you should be able to run tests that are not in a category (according to the command