Is it possible to convert a .spec file to a .feature file? - cucumber

I am using gauge framework for testing. I wish to store the execution results in Jira/Xray. But Jira/Xray only support cucumber for automated testing. I am thinking of converting the .spec file to .feature file and add it to the Xray test scenario. Then after executing the gauge test I am translating the gauge-json report to a cucumber-json myself. I am looking for a tool or a convinient way to translate the .spec file to .feature file.

Gauge does not provide a way to convert specifications(.spec) into Gherkin (.feature). Gauge specifications follow Markdown format, there might be tools which can convert markdown to Gherkin. But Gauge will not be able to execute Gherkin syntax.
For the reporting bit writing a reporting plugin which can generate the report in a format which is accepted by Jira/Xray might be useful.

I'm not aware of a spec=>Gherkin converter but in theory, you could convert the markdown to a Gherkin kind of layout just as means to have visibility of the steps in Xray.
If you aim to have visibility of the spec and detailed results, another option would be to convert the gauge report to Robot Framework XML kind of report that Xray can process. That would give visibility of each step result as seen in this Robot tutorial, on the test run execution screen. Then you would need to submit this transformed report to the respective Robot REST API endpoint.

Related

Handling Excel Spreadsheets with Cucumber

I am planning to work on the Cucumber feature file with Groovy code (Katalon Studio) for step definitions. I wanted to use the excel file in Cucumber file or to see is there any other option to use it.
I have not yet tried as of now any other option. I am thinking just passing the cucumber step file without any parameter and then using the excel file with in the step definition and access excel file and get the corresponding value.
I see there is a post in this forum suggesting to use QMetry Automation Framework for this type of question. But it does not look like this will help on this or should I use the passing the row index from cucumber file and based on that retrieve the value. Please guide on this.
Handling excel spreadsheets with Cucumber Scenario Outline
You should know that this is not supported by Cucumber.
As specified in the FAQ:
"We advise you not to use Excel or csv files to define your test cases; using Excel or csv files is considered an anti-pattern.
One of the goals of Cucumber is to have executable specifications. This means your feature files should contain just the right level of information to document the expected behaviour of the system. If your test cases are kept in separate files, how would you be able to read the documentation?
This also means you shouldn’t have too many details in your feature file. If you do, you might consider moving them to your step definitions or helper methods. For instance, if you have a form where you need to populate lots of different fields, you might use the Builder pattern to do so."
If you are using cucumber java 5+ you can add qaf-cucumber dependency. It should work with groovy as well. It will enable to have examples from external source like CSV, XML, JSON, EXCEL, DB.

how to generate excel vba code in selenium ide

I am using Selenium IDE 2.9.1 (a Firefox plugin) to get web element. I am unable to see VBA code when I go to options > format. Does anybody know how to get or set VBA source code?
This is the info from the documentation. This seems to imply format VBA is not a supported feature.
Format
Format, under the Options menu, allows you to select a language
for saving and displaying the test case. The default is HTML.
If you will be using Selenium-RC to run your test cases, this feature
is used to translate your test case into a programming language.
Select the language, e.g. Java, PHP, you will be using with
Selenium-RC for developing your test programs. Then simply save the
test case using File=>Export Test Case As. Your test case will be
translated into a series of functions in the language you choose.
Essentially, program code supporting your test is generated for you by
Selenium-IDE.
Also, note that if the generated code does not suit your needs, you
can alter it by editing a configuration file which defines the
generation process. Each supported language has configuration settings
which are editable. This is under the Options=>Options=>Formats tab.
Note
At the time of this writing, this feature is not yet supported by the
Selenium developers. However the author has altered the C# format in a
limited manner and it has worked well.

Java converter from kml/shapefile to Geojson

I would like to write a command line program using Java that take in KML/Shapfile and output GeoJSON file.
What I usually did is go over ogre2ogre and manually convert my file.
Once I got the GeoJson I modified the content of it a little bit before output final GeoJSON.
I would like to skip the manual part and find some API that do the conversion for me.
Anyone could help please.
Thanks
OSMBonusPack provides a KML+GeoJSON toolkit, with both a KML parser/writer and a GeoJSON parser/writer, all in Java.
So this allows to read KML content, and write it as GeoJSON.
You can test this conversion using the demo app OSMNavigator.
It is targeting Android, so for your need you would have to pick the relevant classes, and remove code sections you don't need (icon loading, overlay building, Parcelable implementation, for instance).

Can we make change in Seccubus tool to support Retina Scanner

I want to add Support for Retina scanner in Seccubus tool, will it easy? Actually i want to automate the things which Nessus does in Seccubus tool. Can anybody help?
Yes, it is quite easy. You need to convert the output to simple XML format named IVIL and make a script to run and import scans.
You can use the other scanners as a guide to help write a collector for Retina, if anyone is still doing this. do-scan calls seccubus/scanners/[scan name]/scan which then runs the actual scanner with arguments and all. Then the report is saved in /tmp/seccubus.$$ ($$ is the process ID) then it is used as an input file to the command seccubus/bin/[something2ivil] and an output file of /tmp/seccubus.$$.ivil.xml is created which is the input to seccubus/bin/load_ivil and /seccubus/bin/attach_file.
If Retina by default outputs an XML report, then you can take a lot from say the Zap scanner and change things as needed to suit Retina. You would need the files seccubus/scanners/Retina/defaults.txt description.txt help.html and scan to have Retina a viable option on the web interface and a seccubus/bin/retina2ivil script that would convert the XML report to the IVIL format.
If Retina does output an XML report, then a lot of the work is already done for you with all the Zap files. But, to get retina2ivil done correctly you will have to experiment with correctly parsing the XML structure of Retina's outputs. Using the statement
"print Dumper([xml data field/fields]);"
should help you determine if you are correctly parsing the XML or if you're assuming the structure incorrectly.

How to generate a file consisting of all scenarios tagged by #manual?

I have a bunch of feature files. Some of scenarios and features are tagged with #manual. I'd want to generate a file that will contain all scenarios and features tagged with this tag so that it will be easier to find them out. Obviously I can write parser of feature files myself. But is there existing library or built in way that will do it?
I don't know of any existing library to do it, but I would probably run
cucumber --tags #manual > manual.feature
Then open up "manual.feature" and remove the extra content!

Resources