How can reports be generated in Cucumber while running multiple test cases? - selenium

I am working on the automation of test cases with the Cucumber 4.0.0 framework and Selenium. Each test case corresponds to a Feature file.
When I run multiple test cases, the report is only generated until the end of the entire run. So what I would like is that when multiple test cases are run, the report is generated at the end of each test case and not until the end of all cases.

Related

How to Include Test Suite Name When Running Test Case in Azure DevOps

We have some generic test cases in Azure DevOps that are included in multiple test suites. When you run a test case for a web app, the test runner window displays the test case ID and name but not the test suite name. Our client is finding this is leading to some confusion as to what is actually being tested. is there a way to display the test suite name as well as the test case name? I've just discovered that you can use parameters in a test case so I'm about to investigate that, but I think that it may apply only to steps and not the title.
For the record, I have decided to use configurations for this. It's more of a workaround than a solution, because it means creating lots of configurations and assigning them to test suites and also that configurations can't be used for other purposes.

Execute Test Suite Without Refreshing Page in Selenium IDE

I'm trying to create a test case in Selenium IDE.
The idea is to split my whole test in smaller ones to help find problems in the execution.
Example of my test suite
I've created a test suite with all my small tests inside, and I'd like that the next test starts right where the last one stopped. But in the beginning of the execution, every test refreshes the browser.
Test Refreshing Browser on start of the execution
My question is:
Is it possible to run an entire test suite without refreshing the browser when a new test starts?
thanks a lot

How to handle failures in Test Suite in selenium webdriver

Suppose I have 10 test cases in my Test suite and when I execute the Test suite I get an error for test case no.7.
Now is there any way that I can restart my execution from test case no.7 after correcting the changes?
I'm using TestNG.
Do we have recovery scenarios in Selenium?
TestNG generates .xml configuration with failed tests http://testng.org/doc/documentation-main.html#rerunning
Or you can use org.testng.IRetryAnalyzer which runs failed tests again and you have more control over it.
Example here http://seleniumeasy.com/testng-tutorials/execute-only-failed-test-cases-using-iretryanalyzer.
Yes you can do that if you are using Eclipse IDE. Click on the arrow just before test class name, it will show you all the methods(test cases) of that test class. Right click on the one which you want to run. It will run that specific test only.

Selenium command level reporting using testNG

I’m new to Selenium WebDriver, Currently working on reporting testcases & test suits using TestNG (import org.testng.Reporter)on eclipse, At present TestNG produces high level reporting features for test cases ,methods & suites on test- output folder, similar to this --> http://testng.org/test-output/index.html.
I'm looking for a way to have following in the report created by testNG,
All selenium commands executed in my test method(s) should be displayed in index.html &
Failed screenshots for the relevant failure command with the reports, something similar to loggingSelenium ---> http://loggingselenium.sourceforge.net/samples/sampleResultSuccess.html
The reason I prefer this way is its easier, because this way I know exactly what selenium commands which were executed , I would have correct information what goes wrong, and when this occurs and the input parameters belong to specific selenium commands.
Is it possible in testNG?

Selenium Test Runner and variables problem

In my selenium test suite (html), I define a first test case to initialize variable called in the next test case.
Sample :
In first script :
store|//div[#id="myfield"]|myvar
In my second script :
type|${myvar}|myvalue
But when I start test runner (from maven), it returns an error telling that ${myvar} is not found
The value contained in the stored var is not used.
Any suggestion ?
Thans a lot
Maybe you could use cookies to store variable?
createCookie is in selenium and to read it you might use javascrpt(getEval)
As far as I know you cannot reference variables declared in a different test when running HTML suites.
What you need is Test and/or Suite "Setup" and "Teardown" functionality.
Test setup and teardown happen before and after each test. Suite setup and teardown only happen once, before and after the suite is run.
As you are using Maven, I assume that your development is in Java, so you could use JUnit
http://www.junit.org/
This has both test and suite setup and teardown:
Test Setup
http://kentbeck.github.com/junit/javadoc/latest/org/junit/Before.html
Test Teardown
http://kentbeck.github.com/junit/javadoc/latest/org/junit/After.html
Suite Setup
http://kentbeck.github.com/junit/javadoc/latest/org/junit/BeforeClass.html
Suite Teardown
http://kentbeck.github.com/junit/javadoc/latest/org/junit/AfterClass.html
I've created separate tests in Selenium IDE and then batched them in a test suite
After that ... when I ran them, the ${variable_name} stored in test 1 works fine in test 2.
Damien
The current version of selenium test runner doesn't pass variables from test to test like the IDE does. There is a javascript work around, check out Nick G's post on http://jira.openqa.org/browse/SEL-605