Monday 3 December 2012

Selenium – Setting up Selenium & Eclipse


Now its time to learn how to configure Selenium RC client driver with Eclipse IDE and how to run Selenium RC server instance.  We will try to understand this step by step.
Note: Download JDK ( from the Oracle / Sun website and install prior to installing Eclipse)
Download Eclipse
  1. Go to URL – http://www.eclipse.org/downloads/
  2. Select Eclipse IDE for Java Developers (Click on Windows 32 bit platform)
  3. Click on OK button and save to a local drive (i.e. C: or D:, etc)
  4. Unzip the downloaded zip file and rename that to Eclipse
  5. Create one more folder “Eclipse-Workspace” (i.e. C:Eclipse-Workspace)in the same drive where Eclipse is unzipped and renamed.
  6. Create Eclipse desktop shortcut (go to C:Eclipse folder –> right click Eclipse.exe and then click on “desktop create shortcut”) as demonstrated in the below pictures.
  1. Now we need to create a workspace folder –> C:Eclipse-WorkspaceSeleniumTests
  2. Double click on “Eclipse shortcut on Desktop”
  3. This opens the Eclipse
  4. Close Eclipse welcome screen
  5. Click File menu –> Switch Worspace –> other
  6. Now Select the C:Eclipse-WorkspaceSeleniumTests folder (These steps are demonstrated in the following figure)

We have finished setting up the eclipse.  Now, we need to download Selenium RC server / client driver and configure that to Eclipse
  1. Download Selenium server:  http://seleniumhq.org/download/ 
  2. Download Selenium Client driver for Java (from Selenium Client Drivers section)
  3. Create “Selenium” folder in C: drive and copy the Selenium-server.jar as well as unzip the Selenium Client driver (C:Selenium)
Downloading and unzipping the files into a folder is done.  We need to configure the appropriate Selenium Client driver Jar file to the Eclipse.
  1. Go to Eclipse –> Click  File –> New –> Project (from various options need to select just “project”)
  2. In Select Wizard –> Click Java –> “Java Project” (demonstrated in the below figure)

  3. Give the project name (e.g. SugarCRMTests)
  4. Click Finish – Click Yes
  5. Now we are done with creation of project and need to configure the Selenium Client driver to this Project
  6. Right Click “SugarCRMTests” project
  7.  
  8. Click “Java Build Path”
  9. Click Libraries tab
  10. Click “Add External JARs” button
  11. Select “Selenium Client Drivers” unzipped in C:Selenium folder (Selenium Server JAR file should not be added)
  12. Click OK
  13. Referenced libraries –> contains both the Selenium Client driver jar files as shown in the below picture.

So far we have learnt the following:
  1. Download latest JDK and install
  2. Download Selenium Server as well as Client drivers and unzip into a folder
  3. Download Eclipse and configure
In the next post we will learn how to execute selenium tests using Eclipse

Friday 26 October 2012

Setting up TestNG with Eclipse


Setting up TestNG with Eclipse


This post will explain about installation of TestNG plug-in with Eclipse (Indigo)
There is no need to download any Jar file or exe file for installation.  We need to just utilize the “Install New Software” option available in the Eclipse.
Steps for installation:
1. Click Help –> Install New Software
TestNG-HelpMenu
TestNG-SelectSite
TestNG-Add
2. Type “http://beust.com/eclipse” in the “Work with” edit box and click ‘Add’ button
3. In the ‘Name’ column we can see “TestNG” –> Select this and click ‘Next’ button
TestNG-Install
4.  Click Next and click on the radio button “I accept the terms of the license agreement”
5. Click ‘Next’ button
6. Click ‘Finish’
TestNG-Install wizard
This will install the TestNG plug-in for Eclipse
After the installation, it will ask for restart of Eclipse.  Then restart the Eclipse.
Once the Eclipse is restarted, we can see the TestNG icons & menu items as in the below figures.
TestNG-RunAs
TestNG-NewSelectWizard
TestNG-RunAsTest
It is very much clearly explained how to setup the TestNG with eclipse.  The screenshots make it easy to understand the setting up of TestNG. I hope this will help people who are eager to start using TestNG for their unit testing as well as UI Test Automation with Selenium.

Thursday 9 August 2012

Refill HP 802 Tricolor Cartridge



Refill HP 802 Tricolor Cartridge

This is the tutorial for refilling the HP 802 Tricolor (color/colored) ink cartridge that is available in two variants -- HP 802 Tricolor Small and HP 802 Tricolor Large.

Again, the difference between them is physically the size of the sponge and of course the price. In this colored variant, again the large cartridge will pay you more since there'll be less refills and less work to do.

 Here's an image of the tricolor cartridge: 
 



So the process of refilling is again the same as the black but now you have to use three colors - i.e Cyan (Blue), Magenta (Red) and Yellow.

Get any good branded ink such as InkTec. Personally, I prefer to use ProMax Ink for the colored cartridge since they give out good quality prints with vivid colors.

So here's what you'll be needing for the refill

i) 3 syringes - one for each color. DO NOT use the same syringe for all the three colors
ii) 3 colored inks - Cyan, Magenta and Yellow
iii) Isopropyl Alcohol
iv) Soft Tissue Paper
v) A soft cloth to tolerate the ink spills
vi) 802 Tricolor Cartridge (of course)


Here's the image for the ink bottles





Process:

Fill up the syringes with the three colors respectively - 2ml if you want to fill the small cartridge and 4ml if you want to fill the large one




Here is the image of the cartridge after the top label sticker removed

Please note the number markings. This image has been taken with the circuit (golden strip) facing away from self.




Inject Magenta (Red) ink in either of the hole 1 or 1a


Inject Yellow ink in hole 2



Inject Cyan (Blue) ink in hole 3 or 3a



 




* Please do this slowly and make sure there's no ink leaking out of the printhead at the bottom. If it does, clean it with a tissue paper until the flow of ink stops.


Clean the head with Isopropyl Alcohol using a tissue paper. Let the cartridge stand in the printer for a few hours and then its ready to print.


NOTE: Do not expect to many photo quality (best quality) images from a SMALL 802 refilled cartridge because there's very little ink for each color. If you intend to print images, do get the large version and also pigmented high quality colored inks since the difference between cheap and high quality inks is very noticeable in images.



























































Refill HP 802 Cartridge


Refill HP 802 Cartridge

This is a very detailed piece of information meant for beginners. If you have some experience with refilling inkjets, just skip the introduction.

Please read the precautions before attempting a refill
The HP 802 cartridge series is a relatively new series of cartridges being manufactured by HP.

This cartridge is available in India for use in three printer models HP 1050, HP 2050 and the wireless HP 3050 (any maybe others).

HP Wireless Deskjet All in One 3050 (Print, Scan, Copy)

 About refilling cartridges:

Many people have doubts about refilling their printer's cartridges because of extensive claims being made by manufacturers regarding quality, printer failure, void warranty and a host of other reasons. Please follow the blog to the end to find a reasonable answer to all these reasons while we first get on with the process of refilling for the impatient ones. But just be assured that the process is completely safe.


About HP 802 Cartridges

These new cartridges are available in two variants -- SMALL and LARGE.

HP 802 Small Black Cartridge

Ink Yields*:
HP 802 Small Black [CH561ZZ]: 120 pages
HP 802 Large Black [CH563ZZ]: 360 pages

HP 802 Small Tricolor [CH562ZZ]: 100 pages
HP 802 Large Tricolor [CH564ZZ]: 300 pages


*These yields are measured under standard conditions using an ISO testing suite (a set of pages printed repeatedly until the ink finishes) and these yields are rated at a coverage of only 5% of a page. 

 Want to print images and high density text? You could be running out of ink a lot sooner than expected. 



At the heart of an 802



The way these cartridges work is that they have a sponge inside the cartridge (and that is what takes up space inside the cartridge, there's no complicated circuitry involved). When the printer signals the cartirdge through the contact pins, portions of the head heat up forcing the ink from inside to outside and onto the paper (hence the name "thermal inkjet")

The sponge removed from an HP 802 Small Black cartridge.

This sponge (from a small black) measures approximately 3.5 cm * 1.5 cm * 1.5 cm and is inside the cartridge and this is the thing we'd be operating on while refilling the cartridge.

You'll now understand that increasing yields is only about increasing the size of the sponge and injecting a few more ml of ink -- for which the HP guys are charging us a fortune.

Anyways, the job we're supposed to do is getting a syringe needle into this sponge and injecting 1.5 ml (small black) or 4 ml (large black) of ink into it.


Refill Process

Take out the black cartridge from the printer and peel off the top sticker from the cartridge to expose the refill hole(s). [Don't worry if you damage the sticker label since it is not necessary to put it back after refilling]

802 Cartridge after peeling off the sticker label
The numbering stands when you hold the cartridge with the golden circuit strip facing away from you.


Holes 1,2 and 3 have the sponge immediately below them and it is one of these three holes that we will use to refill the cartridge. Please DO NOT use HOLES 4 or 5 since you'd dumping ink straight into the container and probably will damage the cartridge.


Use a standard refill ink brand and any syringe.

A 250ml bottle of black pigmented branded ink should cost you anywhere between Rs. 250 to Rs. 350. 250ml is sufficient ink for more than 2500 pages.


1) Fill up a syringe with 1 to 1.5 ml of ink.



2) Place the needle in HOLE 3 of the cartridge



3) S-L-O-W-L-Y inject ink into the sponge. Make sure you take 20-25 seconds to inject that 2 ml ink since it needs to get distributed into the sponge. Making it fast would probably make the ink leak out of the head risking damage of circuit. MAKE SURE you place some tissue below the cartridge since some ink is bound to flow out while refilling.

4) Remove the needle and cap the syringe.

5) Clean the head portion of the cartridge with a tissue paper for any overflowing ink. [Don't use too much force, the head is a fragile part]

6) Place the cartridge back in the printer and allow it to stand for 5-6 hours before you attempt printing. The ink needs to reach near the head before you can properly print.


Precautions 

1) Do not touch the metallic ink strip or allow any ink to reach that portion or you'll damage the circuit.

2) After refilling, empty the syringe and insert the needle one by one in hole 4 and 5 and pull to suck out any ink that's overflown into the cartridge from the sponge.

3) Do not insert a cartridge into the printer while the ink is flowing out of the print head [bottom part]. Absorb any excess on a soft tissue paper

4) Do not wipe the head with anything except a soft tissue. You may use Isopropyl Alcohol to clean that portion. Printhead is a very delicate part.




Cost Comparison



 Refilling cartridges is a very cheap option when compared to buying a new cartridge every time.

I've been using this cartridge for more than 8 months now. It's a small black 802 which I've refilled way too many times to remember.

 My printer's total page count shows ~ 2100 pages. Discount the 100 pages that were printed with the starter cartridge, I've been able to squeeze out 2000 pages from a HP 802 small black. AND it's still going on.

Small Black costs Rs. 425/- and prints about a hundred regular pages making the cost of a print Rs. 4.25/-. 

Compare this to a refilled system, assume a page output of 2500 pages per cartridge -- it would cost you 1) A cartridge (Rs. 425/-) and the refill stuff -- syringe, ink bottle, tissue (~ Rs. 300).

Refilled ink would cost you Rs. 725 / 2500 pages, that is approximately 29 paise per page.


Refilled Yields

My personal experience is that a refilled small black would last 40-45 pages so if you're into heavy volume printing or you can't bear refilling too frequently, I suggest you get a HP 802 large black which has a significantly larger sponge. Refilling a large black would require approximately 4-5 ml of ink.



Expected Problems
 If you get no output OR streaks of black after printing from a refilled cartridge, remove the cartridge from the printer. Cover the holes with some clean cloth and blow air into the cartridge. This would force the ink near the head. Wipe off any excess ink that comes out of the head and then try printing.


Wednesday 18 April 2012

Setting PATH and CLASSPATH in Java in Windows7 & XP (How to set PATH variable in Java in Windows7 & XP).

POSTED BY WASHIM RAZA WEDNESDAY, APRIL 18, 2012 1:35 PM


Setting PATH and CLASS variable in Java is not so difficult, You have to follow some steps and you have done...Just follow these steps and you have done!!!


First of all Install Java( either 5,6 or 7). You can download it from its official website.

After installing java go to C: then go to Program files here look for folder named java...





Now open that Java folder here you will find two folders named jdk1.6.0_20(if you are using java6) and jre6. Just click on jdk1.6.0_20





now after opening jdk1.6.0_20 open the "bin" folder and copy the whole path as shown in the following pictures...










Here you have done First step..let proceed towards second step...


Go to "My computer" and right click on it....


double click on MY COMPUTER


Now click on "Properties" If you are using Windows7 then it will look like this...





After this double click on "Advance System Settings" as indicated in above figure it will opened as...




Here click on Environment variable a new window will opened like this...




now on System Variable window click on new after that a window will opened in which give
variable name = PATH and variable value = "the whole path" you copied from bin folder its look like...




now press OK button. Here you set the path of the java, Now you have to set the CLASS for this again go to Environment variables.. Here on "Users Variable" window, Click on new and give the following value..

variable name = CLASS and variable value = "the whole path" you copied from lib folder.

All this are shown in the following pictures....



















Alas!!!! You have finished all your works of setting PATH and CLASS variables of Java....So enjoy Your Java Coding....

Monday 27 February 2012

Two boys wish to cross a river

Two boys wish to cross a river. The only way to get to the other side is by boat, but that boat can only take one boy at a time. The boat cannot return on its own, there are no ropes or similar tricks, yet both boys manage to cross using the boat.

How?