I am quite new with cucumber and I try to find on the web if it is possible to Use cucumber java library without using feature file from cucumber
What I would like to do is to instantiate Java object with Step definition in it (GIVEN/WHEN/THEN) from a string that will store my gherkin test.
If any of you have already been in same position it will be great to discuss it
Thanks
PS: I could use the feature file but I will have to do little more dev to retrieve it and write it on the disk as Cucumber is on my XRay company server
AFAIK it's not something possible with Cucumber right now and even if possible it would require a non negligible amount of work.
Have you read this documentation on how to use Cucumber with XRay though?
Related
I'm planning to automate some website using Selenium WebDriver + Java + POM(Page Object Model) + TestNG.
I've all other WebPages common for the given website but for each transaction one WebPage which is almost like a form would be different.
So, I've following choices.
Have a Page Object Model (POM) Created for all static common pages and Start creating POMs for the pages which differs in each transaction.
Have a Page Object Model (POM) Created for all static common pages and using some external data source (XML, Excel etc) I can generate the tests for that perticular page.
I'm in favour of second approach here as I don't need to write code again for each new transaction just because there is one page is different?
Any thoughts? or anybody implemented something like this already?
Yes 2nd approach- 'Page Obj model' based is best to keep your code isolated and easily maintainable.
For your test data maintenance I'd suggest you using Cucumber based (BDD driven) framework.
It goes very well with automation FW (POM, Selenium, Java, TestNG/Junit and Maven based) projects.
By using cucumber you need not depend on any other source of test data, i.e. excel or xml, this can easily be maintaned with feature files of cucumber.
Also BDD gives you the main advantage of keeping 'BA-QA-DEV and Management' on same page.
If you dont want to use Cucumber/BDD, then you can use Test NG data provider feature with Excel to achieve better test data management.
If you want to learn Cucumber/BDD-> there are lots of very good video tutorials available online. One of my Fav is here-
https://www.youtube.com/playlist?list=PL6tu16kXT9PpteusHGISu_lHcV6MbBtA6
for web reading:
https://www.lambdatest.com/blog/automation-testing-with-selenium-cucumber-testng/
Happy Testing!
I have worked in similar kind of project. I would suggest to with #1. The reason is that might be possible in future you find difference in web pages, So common function will not be always applicable to each page.
So if you go with #2 as of now then its fine but you gonna end up by following #1 in such cases.
The above answers are mixing the Page object model with a data-driven framework.
Basically in data-driven framework, the data is read from an external file
Well if you want to build a simple pure data-driven framework then it should have
Independent tests
All tests should read data from JSON/XML/YAML/XLS... any source
Properties file having your locators and other settings
You should also create a base class which will have the common reusable functions which can be used in tests
You should make it in such a way that running on grid is easy and by just chaning external flag.. tests should run in GRID
Proper HTML reporting with screenshots, errors, failures should be done
Also watch this video
https://youtu.be/s-W8pw9GnWc
I am trying to automate the creating and running the performance test script. Firstly, I create the UML activity diagram and I can export this diagram to outside as a xml file. I write a java program that can read this xml file. Now I want to create test script with using the properties which is a separate file that include host, username, time, etc. knowledge about the configuration. I want to use these two files and create a test script for performance test. Which performance test tool is useful and appropriate for my plan? Also I read the jmeter documentation and it can not be run from the script. Jmeter is manually configured.
JMeter's .jmx scripts are basically XML files so you could come up with an XSLT transformation which will convert your UML diagram into an XML file which can be consumed by JMeter. Check out build-web-test-plan.jmx which implements Building a Web Test Plan user manual chapter
Given you're able to write Java programs you can create/execute a JMeter test plan programmatically using JMeter API. Check out Five Ways To Launch a JMeter Test without Using the JMeter GUI article for general instructions and jmeter-from-code sample project
There are is Taurus tool which provides possibility of creating/running a JMeter test plan using simple declarative YAML syntax
I would like your support by providing information (scripts, videos, or books) regarding how to enter input data (for example: username and password) to a selenium project from an Excel file using Cucumber and Serenity DB.
Is it possible?
Thanks for all.
By principle, Cucumber doesn't supports data from external files. Instead it encourages to provide examples with scenario. However there are few non standard way available with cucumber to use examples from the external file. One of them, you can refer in grasshopper's post.
Another alternate is using gherkin with QAF which provides lots of features inbuilt data-providers including XML/CSV/JSON/EXCEL/DB. Here is the step-by-step-tutorial to start with.
From 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."
I'm new to BDD and particularly Cucumber.
Can I get a features and its steps from a variable? Also, I want to get a feature and its steps from a test tracker (TestRail) before running tests by the special selection of this tests, and put it in a list, then one by one get a scenario and run it.
Is there such a possibility? Should I use Cucumber or another framework for this?
No, you can't define a Cucumber scenario in code (or at least not in a supported way). But if you were going to write code to get a scenario and its steps from your test tracker and run it, you could equally well write code to put the scenario and its steps in files and run the scenario with the cucumber executable.
I don't know of a Java testing framework in which you can define tests dynamically. You could do that in Ruby with RSpec or (less cleanly) minitest. But I don't know whether a Ruby test framework would be acceptable, or whether it would be OK for the people writing entries in your test tracker to have to read and/or write RSpec examples. (It seems strange to have Cucumber step definitions in a test tracker, too; having features in a test tracker seems more reasonable, aside from the question of how to run them.)
I am doing load test on my server and using JMeter. Do I have any difference choice??
How can I do integration test and How can I do it? Is there any tool?
I know the concept but I dont know how to apply on my project.
My company required me to do a report on load test. Is there any standard on testing? Such as need to use 50 people access and plot the graph of response time?
Sorry I am new to System analyst.
Junit is a framework to support test cases it doesn't provide the tests themselves.
Load testing tends to be specific to the application so you can use JUnit to support that
but you will have to write the tests yourself.
you could look at jMeter or LoadUI