Use of Scenario outline in passing the scenario name as example - selenium

Can I use scenario outline concept in scenario name in Specflow so that I pass the scenario name in Example. For example if I want to run my scenario in three browsers IE, FF and chrome, I'll pass three examples.
I have tried it in Cucumber and it works, can I do it with Specflow in VS ?
Like
Scenario outline : <Scenario name>
steps 1
step 2
Examples:
|Scenario name|
|scenario 1 |
|scenario 2 |
|scenario 3 |
can I implement that ?

Related

How to render Karate.Config values in Scenario outline

I am just wondering if there is a way to make use of karate.config values in Scenario Outline statement. Please have a look at the example below:
Feature: Sample feature
Scenario Outline: Sample scenario for id: <id>
Examples:
| id |
| partnerId |
Here the partnerId is defined in Karate.config file (just say it is '123'). When I run the file I want to see '123' in scenario outline in reports rather than the value holder 'partnerId'
Expected:
You are asking for variables to be able to be substituted into the title. Sorry, that's not supported. You can always print these values so they will show in the HTML report, but yes - not as the title.

Karate: how to pass dynamic path parameters?

Suppose I have test scenario with exact same requirements but one path variable change as follows:
Scenario: Some scenario
Given path /mypath/param1
When method get
Then status 200
I need to run the same test for /mypath/param2, /mypath/param3 as well.
Is there a simpler way to do it without requiring to separate the feature into a separate file and using data driven test?
Yes, use the Scenario Outline which is a standard Cucumber pattern.
Scenario Outline: Some scenario
Given path /mypath/<param>
When method get
Then status 200
Examples:
| param |
| foo |
| bar |

Selenium, does it support multiple input values

Does Selenium support passing a range of input values?
I did some Selenium training a few years ago and seem to recall there was a feature that allowed you to pass a table of values to a testcase. I can't recall the details, and can't find any reference to it in the docs? I could have been dreaming! My general recollection was that you could pass something like;
FirstName | Lastname
Bob | Smith
Andy | Franks
And somehow make this data the subject of the test.
Given what you show in your question I'm thinking what you are remembering is something like:
Scenario: fooing the bar
Given some data
When the user foos the bar
Then the bar shows
| FirstName | Lastname |
| Bob | Smith |
| Andy | Franks |
That's the Gherkin language. Test runners that understand Gherkin exist for most general purpose languages. The table in the last step is something that the test runner will pass to the implementation of the step. You have to write the implementation of the step yourself and are responsible for passing the data to Selenium in a format that Selenium understands. How you do this depends on the specific test you are trying to perform with Selenium.

How to overwrite some data's in columnFicture?

my ColumnFicture test table look like this:
|categoryId|subcategoryId|showResults?|
| 2 | 1 | |
I overwrite in my ficture code (C#) categoryId (2) if subcategory is more than 0. Is that possible overwrite categoryId on fitnesse test site? That evry one can see what happend.
No, from your fixture code you can not change the test in the FitNesse wiki. A test in the wiki is rendered into HTML, passed to a FitServer, parsed into a tree structure, passed to your fixture which can modify the tree, and then rendered into the test result HTML. So your fixture is too far down the pipeline to access the original wiki test source.

Do the blue dashes in cucumber features output always mean skipped?

I've understood that blue dashes in features output means the step was skipped because something before it failed but in all of my scenario outlines I get blue dashes but also a line that says all passed.
Here is my Scenario Outline.
Scenario Outline: Attempt to assign a role when not authorized
Given a <user_who_can_not_assign_roles> exists with email: "johndoe#example.com"
And that user is signed in
And I am on the user's show page
And a role exists with name: "<other_role1>"
And a role exists with name: "<other_role2>"
When I follow "Edit"
Then I should not see "Admin"
And I should not see "Manager"
And I should not see "Salesperson"
When I fill in "username" with "spuds"
And I fill in "password" with "potatoes"
And I fill in "password confirmation" with "potatoes"
And I fill in "email" with "spuds#gmail.com"
And I press "Save"
Then I should see "success"
And a role should exist with name: "<other_role1>"
And that role should not be one of the user's roles
And a role should exist with name: "<other_role2>"
And that role should not be one of the user's roles
Examples:
| user_who_can_not_assign_roles | other_role1 | other_role2 |
| manager | Admin | Salesperson |
| salesperson | Admin | Manager |
When I run this feature I get this output.
-------------------......
2 scenarios (2 passed)
38 steps (38 passed)
0m3.300s
I get that its 2 scenarios because I have 2 examples listed and 38 steps would be the 19 run twice. What I don't understand is why it shows the blue dashes (like it normally shows for skipped steps) when it also says 38 steps passed.
I would assume that this is intended when running outlines because if I change on of the steps marked with a blue dash it will show failed. I was just looking for some confirmation in the cucumber docs and I can't find anything.
I'm running rails 3.0.0, cucumber 0.9.3, and pickle 0.4.2.
The blue dashes in this case represent the parsing of the scenario outline, which is more metadata than test. I find it confusing as well. To get a better idea of what is going on, try executing:
cucumber -f pretty <your_fancy_scenario.feature>
This will force cucumber to display the actual scenario text with the color coding, instead of just the dots and dashes.
Hope that helps!