Wednesday, January 27, 2016

Install TestNG in Eclipse



-Run Eclipse.exe
-Help menu > Install New Software…

Type “http://beust.com/eclipse” in “Work with” checkbox and click “Add” button

Select  “TestNG” and click “Next”  and follow instruction to install



This will be start to install.
Restart Eclipse after the installation is done.
Now, when need you can add Testng class:

On New window, select TestNG class > Next


Install Maven in Eclipse



-Run Eclipse.exe
-In Eclipse:
Help menu > Eclipse Marketplace…


Seach for Maven

Select Maven and click Install button.
Maven start install, you wait until the Maven complete, let close Eclipse and run Eclipse again to start create Maven project.

Sunday, January 17, 2016

Download and run eclipse

1. Before downloading eclipse, you have to know what Operating system in your computer (64 bit/32 bit). If you don't know what it is just click on "computer" --> right click and choose "Properties", on the popup window you can see the system type as the photo below

2. Launch a browser and navigation to http://www.eclipse.org/downloads/
You can choose a version for your purpose, I choose the first one. And base on the system type of the window you click on "32 bit" or "64 bit" to download

3. On the download page, you can choose any server to download by click on "download" button at the server you like

4. Click on "ok" button on dialog window to start download
5. Extract File from the zip file
6. Click on eclipse.exe to run

Choose the path of Workspace  and then click "ok" button
The eclipse window is shown as below


Eclipse Shortcuts

Beside common shortcuts (Ctrl+C, Ctrl+V, Ctrl+F and so on), below is list of shortcuts that help you save a lot of time when you work on Eclipse


Content Assist
 Ctrl + Space
Quick Fix
 Ctrl + 1
Parameter Hints
 Ctrl + Shift + Space
Line comment
 Ctrl + /
Remove line comment
 Ctrl + \
Block comment  Ctrl+ shift + /
Remove block comment  Ctrl + shift + \
Ident
 Ctrl+I
Format
 Ctrl + Shift + F
Toggle Line Breakpoint
 Ctrl+Shift+B
View code of a method  Ctrl + click
Debug step into  F5
Debug step over  F6

Saturday, January 16, 2016

How to Identify Web Elements Using Firebug

For QA, when you write automation test script you have to know id, name or xpath of web elements.
Below is how I use Firebug to identify.
For example, on website http://cungshopping.com, at "Đăng nhập" form I need to know id/name/xpath of "Mật khẩu" textbox (the green one)

Steps I do as below:
1. Launch Firefox browser and navigation to http://cungshopping.com, click "Đăng nhập" link to navigate to the form that has element you want to know id/name/xpath
2. On menu bar: Tools > Web Developer > Fire bug > Open Firebug
or press F12 to open Firebug window

 The Firebug window open at the bottom as below

3. On Firebug window, click on icon "Click an element in the page to inspect" (the green icon as below)

 4. Then move over on the "Mật khẩu" textbox until the textbox is highlighted in blue color, you will see in the Firebug window the HTML for this element is highlighted too.
So you know the textbox has id="password", name="password". If you want copy any information, you just click on that and "Ctrl +C" to copy.


To copy xpath, on Firebug window, right click on the element --> copy XPath

Steps to install Firebug

Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page...
For QA, this is a helpful tool to indicate ID, Name or xpath of components on the webpage.
Steps to install:
1. Launch Firefox and navigate to https://addons.mozilla.org/en-US/firefox/addon/firebug/
2. Click on button "Add to Firefox"

3. Click on "install" button from popup dialog

4. When the installation finish, you will see a dialog appear

5. Tool > Web Developer > Firebug >  Open Firebug of press F12 to open Firebug

6. Firebug window is shown as below:





Wednesday, January 13, 2016

How to install Selenium IDE Firefox plugin


Selenium IDE is an integrated development environment for Selenium scripts. It is implemented as a Firefox extension, and allows you to record, edit, and debug tests. Selenium IDE includes the entire Selenium Core, allowing you to easily and quickly record and play back tests in the actual environment that they will run in.
Steps to install Selenium IDE:
1. Launch Firefox and navigate to http://www.seleniumhq.org/download/
2. At "Selenium IDE" click on the link "from addons.mozilla.org"

3.Click on button "Add to Firefox"
 4. Click on button "Install" on popup window
5. Choose "Restart Now" on popup window
6. After Firefox restart, you can open Selenium IDE
Tools --> Selenium IDE
or
Tools --> Web Developer --> Selenium IDE
or use Shortcut keys: Ctrl +Alt +S

Selenium IDE is shown as below