What is the exactly use of Robot framework? - java

I'm fascinated towards robots. You know usually it creates our work easy and for web you don't need to go anywhere on links once our robots is initialized on web server.
Let's come to our main question:
What exactly is the use of Robot Framework .. I'm good with Java but not with Python. Can I use it with Java? For what purpose Robot Framework is used for?
I'm good in HTMLUnit. But it can be used to parse the HTML source code and we could also implement it in Java to make source code. But what about Robot Framework?
I googled for 2 hours but couldn't find the exact answers. Please let me know if you want to know any information from me.

Overview
It's main use is to enable writing acceptance tests with a high level of abstraction for software products.
The framework requires less technical skill than programming language-based frameworks, and so can be used by team members who have very little programming experience. For example, an agile team product owner could express acceptance tests using the framework, without having to know the details of how the product is implemented.
On the other hand, because of its keyword-based design, those with a high degree of technical skill can write keywords in their language of choice to test low level functions, and even do unit and integration testing if so desired.
Uses
Because of its flexibility, robot framework can be used to test desktop applications, web applications, mobile applications, and RESTful and SOAP-based services. Because it provides an abstraction layer on top of the physical implementation of the system under test, it is possible to write tests that work cross-platform (ie: the same test case could be used to test both an android and iOS app, or for testing a web app that runs on chrome, firefox and safari).
Although robot framework is often used to test browser-based applications, it has been used to test databases, mobile devices, calculators, and many other things.
Extensibility
One of the great strengths of the robot framework is that it is highly extensible. Many of the features mentioned above are implemented as libraries. For example, you can plug in a library to use selenium to drive a browser. You can plug in a database library to directly access databases. There are libraries to support testing desktop apps, services, and many more.
Example
To illustrate how abstract a robot test case can be, a BDD-style testcase might look -- literally -- like this:
Given I am on the application login screen
When I enter a valid username and password
And I press the "login button"
Then I should be logged in
And my personal dashboard should be displayed
Note: this isn't the only way to write a test. Robot is very flexible, allowing you to choose between BDD (Behavior Driven Development) style, a traditional procedural style, or in a data-driven style.
The framework provides the infrastructure for converting those statements to actionable items. Ultimately they get boiled down to a function call -- either from an external library, or one provided by the development team. Those functions typically are written in python, but can be written in Java, a .NET language, or other languages through an interface, depending on how you actually run the test.
Reporting
In addition to being able to run tests, robot framework provides reports and logs that can be used to visualize the state of the product. Logs provide details of every single keyword and function call, reports show the status of complete suites and test cases, and can provide summary information based on arbitrary tags.

Related

Mainframe access for test automation through Java code

Is there any way, we can connect mainframe through java code and can see the screen content in console. Also we can send the option as input and go further in mainframe screens. I need this basically for test automation purpose.
I haven't used the Robot framework but I believe it will do what you want. Its not Java but uses Python; should fit the bill based on you question.
https://github.com/Altran-PT-GDC/Robot-Framework-Mainframe-3270-Library
Rational Functional Tester with its "Extension for Terminal-based Applications" will do this quite well. See here for more information:
https://www.ibm.com/support/knowledgecenter/SSJMXE_10.0.1/com.ibm.test.terminal.docs/topics/cxmlrft0001.html
You can use its Java APIs (called the Host Access Class Library, or HACL for short) if you want to do anything particularly fancy, but "out of the box" it's a full test automation suite for terminal-based user interfaces. (Terminal-based UIs are available in a variety of systems, including but not only mainframes. Apple's macOS offers a terminal-based UI, for example. Mainframes provide a variety of UIs, including, but not only, classic terminal-based UIs. RFT's Extension for Terminal-based Applications is able to test practically every terminal-based UI across all systems that offer them.)

how to form a framework in selenium driver for web automation where by just passing some metadata, the entire code must be generated

I need knowledge about how to develop a framework for web automation using selenium webdriver. please give me ideas and steps to create framework.
Now I'm able to locate all the web elements on web application by just writing a one big bunch of TestNG test code by using #Test annotation.
In my web application there are many places where I can reuse the code to do the same operation across all. So help me out to develop a best framework.
It depends on the problems you are facing.
If you want to clearly separate writing scenarios from editing the logic (for instance, you work in a team with testers who aren't software engineers but know Java and algorithmic well enough to construct elaborate scenarios from small building blocks), then it would be wise to introduce a layer of steps classes containing methods like openTheUserMenu(), fillTheFormDetails(String name, String surname, String address) etc.
If you write tests for some dynamically changing or developing project with UI elements changed or refactored often you would definitely need Page Object pattern to encapsulate the UI logic (so that in your steps you would write just mainPage.selectDateOnCalendar(Date date), and all the necessary typing and clicking would be written out in the page's method).
Finally, if you work closely with your client and need to formulate the requirements in natural language first, and then translate them into more formalized language for developers to implement the required functionality, you would need to use BDD and appropriate libraries like JBehave with scenarios written in phrases in high-level almost natural language mapped onto test methods in Java.
In short, this is it. If you want details, there are plenty of materials on the Net as was mentioned already. Just remember - you should invest in elaborate framework only if you really need one to solve the problems you are facing.

How to go about automated acceptance testing of desktop Java app?

I've been thinking about acceptance testing and would like to gain a clearer understanding of how it can be automated (and fitted into a Continuous Delivery pipeline, for example). I have a desktop application written in Java, a messenger application. If I want to automate acceptance tests, how do I go about it? Here is an example manual test: "User A is messaging user B when the server crashes. Switching to a failover server, verify that the chat can be resumed where it left off and all chat functionality still works as expected in the client"
Can JUnit be used for automated acceptance and system testing like this? I've also heard of Selenium but I gathered it was only for web applications?
I understand the concept of unit testing with JUnit, but I'm lost as to how higher level testing of a desktop application's functionality can be automated. Some tests may involve interaction with the GUI, like sending messages to other clients, but others will involve server-side stuff like server crashes and so on. I've been thinking that it's probably possible to do this using JUnit and the application's code, maybe with some scripting involved (Perl, Ruby etc.) to launch the tests?
There are several software solutions that come at a cost for this. Some serious ones are QTP (now UFT), TestComplete, Ranorex, SilkTest. They should all have trial software available. If the Java application was written in Swing/AWT, Jemmy may be worth checking out. As Tony Hopkinson mentioned, AutoIt may fit, and is very fast to use. Selenium is great, but is only for web testing as far as I know. Automating a UI is very important for automated testing and complements acceptance testing because of its interaction with the end-user. Unit tests overlap a lot, and may cover functional integrations depending on how you organize them and have enough of them, but they are two different approaches with two different purposes.
Also, if you were using Swing, found this thread which may help: http://www.coderanch.com/t/96035/Testing/Automated-Swing-Testing

Writing middle tier tests for website built using Struts

I have never done any middle tier testing before and I am brand new to Struts. I was assigned the task to find out if it is possible to do middle tier testing of a Struts website and how to do it if it is. I wonder if anyone has experience writing middle tier tests for a website built using the Java Struts framework. If you do, 1) do you find it difficult to do so/would you recommend to just test the website in the UI level? 2) do you have recommendation of any websites or books I should go to/read to learn how to do so?
In case it helps, the website is using tiles in the UI and hibernate.
First of all, it does not matter what frontend technology you are using, if you want to test your middle tier. It more depends on your system's architecture, e.g. it will be hard to test separately when all your business logic is implemented in Struts Actions.
Please check out Uncle Bob's article "The Test Bus Imperative", where he explains how your applications should be structured to enable middle tier testing.
Furthermore, read Michael Cohn's blog entry about the Testing Pyramid, which should give you a hint of how to structure your automated tests. There you will see to create GUI based tests, but also that those should not be the majority. Additionally, you can get some information about GUI testing here.
So, first locate your actual business logic and than verify how hard it is to test it separately (without clicking around at the GUI). If that is not possible you probably should stick with GUI tests, using e.g. Selenium. Here are some guidelines for doing so without shooting yourself in the foot :)

Pointers to user profile frameworks in Java

I'm looking for pointers to something that I may be overlooking (or maybe something that Jivebot hasn't yet written for me). What I want is a pre-rolled Java framework for managing user accounts that takes care of most of the common tasks associated with such.
For instance, Jfacets is a good approach to automagic view controlling, but you still have to roll the view code. I wonder if there's a framework that has pre-rolled components for inputting/storing common user profile information, sessioning, and possibly things like inter-account communication, connecting to common social APIs, exposing an API, etc. (basically some/all of the common tasks that a user profile-based app would want). It can be quick and dirty, this is a prototype app at the moment.
I do know that user profiles are a very app-specific arena, and that I may just have to build something up, just thought I'd check first.
In the absence of a pre-rolled solution, I like what I see in Woko after an initial glance (http://woko.wiki.sourceforge.net/). The preconfigured stack includes Hibernate, Spring, Compass, JFacets, Stripes, and Maven and an API framework. I may just need to build the prototype up leveraging this as much as possible.
Thanks
So, it looks like user profiles are just too situation specific for any framework. Shame, because there's a lot of basic functionality that could be served by a basic framework.
On the "solution" front, I'm attending the Open Source Bridge conference in Portland, Or. and recently saw topics on Scala (Two word description: Java scripting) and a framework built on that called Lift (three word description: CodeIgniter for Java). In short, these technologies rock my world.
Anyone looking for robust web frameworks should check out Lift. Scala allows people who love programming in Python and Ruby to use Java's JVM without the cost, with a lot of syntactic elegance (Scala is somewhat more intuitive to my Python-centric mind than Clojure). Lift is a MVC-style framework built on Scala which is just plain beautiful- and frighteningly easy to use.
Normal disclaimers, but the upshot is that it will take significantly less time to build an app-specific solution for a scalable Java app using these technologies than trying to find a user profile framework to use.

Categories

Resources