Skip to main content

Different Jars in Selenium


selenium-server-standalone-2.28.0 (Selenium Server (formerly the Selenium RC Server) : Use this if you want to use the Selenium RC or Remote WebDriver or use Grid 2 without needing any additional dependencies .

Note : For normal selenium webdriver automation including this jar is sufficient.



selenium-java-2.28.0 (Selenium Client Driver) : The Java bindings for Selenium 2, including the WebDriver API and the Selenium RC clients. Download this if you plan on just using the client-side pieces of Selenium.

Note : Makes sure you include all jars in lib folder . If you include only the selenium-java-2.28.0 jar then you will get below 

Error is as below :

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/base/Function
    at test.testclass.main(testclass.java:16)
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Function
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)

Comments

Popular posts from this blog

API Testing With Selenium WebDriver

REST API Testing Framework We will be creating a simple Rest Testing Framework in Java and JUnit that could be used for any testing scenarios. Rest Testing Framework Overview The framework should be able to execute the basic REST operations (GET, POST, PUT, PATCH, DELETE) and perform the validations on the code, message, headers and body of the response. The completed code can be accessed from my  GitHub account   from where you can collect and make modifications based on your requirements. Design We will be having three classes for the framework (in package com.axatrikx.controller ) RestExecutor  : Performs the HTTP operations using Apache Http Client RestResponse  : A javabean class to hold our response values (code, message, headers, body) RestValidator  : Validates the response with the expected values The package  com.axatrikx.test  holds the test scripts. Note: I will be using ‘ json-server ‘ to fake the REST API. Its a real handy tool to r

ExtentReports in Selenium Webdriver

ExtentReports in Selenium Webdriver What is ExtentReport? ExtentReports  is a HTML reporting library for Selenium WebDriver for Java which is extremely easy to use and creates beautiful execution reports. It shows test and step summary, test steps and status in a toggle view for quick analysis Download Download the jar below: Download ExtentReports 1.4 (1623)    Snapshot of Extent report After Executing the Script   Program Steps:  We are going to write three different testcases. Pass Warning Fail TestCase with Pass Result Navigate to http://www.guvi.in Click on Sign-in Enter the credientials Check the URL is correct or not after login   TestCase with Warning Result Verify with the Wrong URL (static String Afterloginfail="http://www.guvi.in/ ")    TestCase with fail Result Click on Menu Select Tech Challenges Verify With wrong URL. Source Code: import  java.io.File; import  java.io.IOException; import   java.sql

How to Compare Two Images in Selenium

How to Compare Two Images in Selenium Some time in testing we have to do image comparision as verification point. So, in this blog I expalin how to compare two images in selenium. I have created one function for compare two images. you can use directly into your framework. first of all you have to import below packages into your code. import java.awt.image.BufferedImage; import java.io.File; import javax.imageio.ImageIO; Now, you can use below function for comparison of two images. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 public boolean mCompareImages ( BufferedImage img1 , BufferedImage img2 ) { boolean bCompareImage = true ; try { if ( img1 . getWidth () == img2 . getWidth () && img1 . getHeight () == img2 . getHeight ()) { for ( int i = 0 ; i < img1 . getWidth (); i ++) { for ( int j = 0 ; j < img1 . getHeight (); j ++) { if ( img1 . get