Tuesday, March 31, 2015

I decided to create a graphical user interface for our framework because it may ease our script execution job and also enhance the functionality of the test framework by having the ability to run with any input test case file without the need of editing the XML everytime. A graphical interface in our case evolved with the use of selecting the input TC file. Later I added the feature to show the results of test execution as well as duration taken for the test operation. A test framework if exported to a runnable JAR file, it is easier for any user to execute this.
In this post I will give you a brief idea how to install Window Builder Pro plugin in Eclipse. After the installation of WindowBuilder Pro, you can develop UI by drag and drop elements required.

Download WindowBuilder Pro plugin:
You may download from the below link

Click here



Select the link as shown in above screenshot.

How to install WindowBuilder plugin in Eclipse:

First open Eclipse, click Help->Install new Software



Click Add, select the Archive from the saved location





Select all options and finish



If you are done with the installation, we shall start the development of user interface.

Create a new Java class, Expand Window builder, then expand Swing Designer and select Jframe, Click Next, Finish.







Now the Jframe class is created, it will have two portions, Source and Design.

Click Design to add UI components. Just for sample, drag a JTextfield and Jbutton from Palette chooser to the frame on right.



Select Jbutton, Right click and add an Action eventhandler- Actionperformed






Click on Action peformed. Now switch to source part. Add below code inside the action performed:

textField.setText(“Button pressed”);


Now save(Ctrl+S) and run as Java application, you will see the UI opening up. Click on the button, observe











Hope these steps will help you to design one yourself.....

2 comments:

  1. Hi anuj, great post. Can you please let me know how to call selenium test cases through window builder.

    ReplyDelete
    Replies
    1. In Windowbuilder create a button and add an action listener to the button. Inside the action listener you can call the function to run test cases.

      Delete

>

Selenium useful links

Powered by Blogger.

Featured Post

Benefits of having a user Interface for a Selenium Automation Suite/Regression Suite

Once you are able to work independently on Selenium scripting, another important task is how to ease your automation test execution. There a...

Video

Popular Posts

Our Facebook Page