Configure Eclipse with Selenium WebDriver for SugarCRM Automation Testing

Configure Eclipse with Selenium WebDriver for SugarCRM Automation Testing
Configure Eclipse with Selenium WebDriver for SugarCRM Automation Testing
Configure Eclipse with Selenium WebDriver for SugarCRM Automation Testing
Configure Eclipse with Selenium WebDriver for SugarCRM Automation Testing
Configure Eclipse with Selenium WebDriver for SugarCRM Automation Testing

Configuration Eclipse and selenium Blog on SugarCRM Automation Testing

Why Selenium used for SugarCRM Automation Testing?

Sugar CRM is Customer Relationship Management software it widely use by client as per their requirements So, customer works on different scenarios, automation  helps to reduce testing time so, tester can cover no. of scenarios

Selenium Webdriver is Open Source Software testing tool which is compatible with different browsers.

To create your test cases selenium support many languages but, Most popular is JAVA to prepare automation test Cases with Selenium WebDriver.

How to configure Eclipse with Selenium WebDriver?

Let’s Start to Install Selenium WebDriver in Eclipse

Step 1 :  Download and Install New version of Java Development Kit (JDK).

NOTE : JDK has already include Java Runtime Environment (JRE) So, No need to install JRE separately.

Link to Download : http://www.oracle.com/technetwork/java/javase/downloads/index.html

Step 2 : Install Eclipse IDE

Now download “Eclipse IDE for Selenium”.

location: http://www.eclipse.org/downloads/

Download Eclipse For SugarCRM Automation Testing
Download Eclipse

Make sure to choose link for downloading eclipse which corresponds to your Operating System like for Windows 32 Bit and 64 Bit Versions.

You should download a Zip file, inside ZIP file , there is an “eclipse” folder which has all the application file, We can extract the “eclipse” folder anywhere in your PC.

Step 3 : Download Selenium  Java Client Driver

You can download the Selenium Java Client Driver from this location:http://docs.seleniumhq.org/download/

Download Selenium Client and Webdriver
Download Selenium Client and Webdriver

Click on Download link for java release. Download the jar files. You will get client drivers for other languages there, but choose the one for Java as shown above in the screenshot.

After downloading you will get a folder which should contain two jar files related to selenium, a “lib” folder which also contains jar files inside it. Beside this, there is a change log file as well. Refer to the screenshot below.

Create a new folder with name say ‘Selenium’ in C drive and extract the jar files to ‘Selenium’ folder.

Create Folder Struture for Seleniun for SugarCRM Testing
Create Folder Struture for Seleniun for SugarCRM Testing
Step 4: Download Chrome WebDriver

Selenium WebDriver support for many Browsers such as Mozilla, Chrome, Opera ,etc.,

To download any of WebDriver  you should click on Browser link’

Click on Download link -> Click on “Latest Release : ChromeDriver 2.31” ->Click on Chromedriver_win32.zip (for Windows) , Make sure to clink link you want to download it for Windows, Linux or mac version

After downloading Create folder for chrome Driver and extract  “ChromeDriver 2.31.exe” to created folder 

Step 5 : Create a New Project in Eclipse

Navigate to C drive and open eclipse folder where we have extracted all the application files related to eclipse. In eclipse folder you would get a ‘eclipse.exe’ file. Click on the .exe file

This would ask you to select a workspace, you may accept the default location or simply create a new workspace inside C drive and confirm OK.

Create a new project and for creating click on File Menu -> New -> Java Project -> Name the Project as “testproject” and click finish.

Create a new Java Class, for doing this again click on File Menu -> New ->Class then name it as “testclass” and select the checkbox for ‘public static void main(String[] arg)’ and click finish.

your Eclipse IDE should look like the image below

  • Add Selenium .JAR files in  project
  1.  Now Right-click on “testProject” and select Properties.
  2. On the Properties window, click on “Java Build Path”.
  3. Click on the Libraries tab, and then click “Add External JARs..”
  4. Navigate to C:\selenium 3.4 (or any other location where you saved the extracted contents of “selenium 3.4.0.zip” in step 3).
  5. Add all the JAR files inside and outside the “libs” folder. Your Properties window after adding all the jar file should  now look similar to the image below.
  6. Finally, click OK and we have completed importing Selenium libraries into our project.

Step 6 : Write code for Login SugarCRM

import org.openqa.selenium.*;

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.chrome.ChromeOptions;

public class testClass {

public static void main(String[] args) throws Exception

{   System.out.println(“launching chrome browser”);         //Use in Chrome browser     System.setProperty(“webdriver.chrome.driver”,”E:\\Project_Work\\Selenium\\selenium 3.4\\chromewebsriver 2.30win-32\\chromedriver.exe”);

ChromeOptions options = new ChromeOptions();     //Arguments added to ignore other notifications an disable extensions

options.addArguments(“–disable-extensions”,”–test-type”);

WebDriver driver = new ChromeDriver(options);     driver.manage().window().maximize();     //Open Sugarcrm  Development Login Sugar CRM

driver.get(“http://crm.ihealthassist.in”);     driver.findElement(By.id(“user_name”)).sendKeys(new String[] { “admin” });

driver.findElement(By.id(“user_password”)).sendKeys(new String[] { “admin@123” });

Thread.sleep(1000);

driver.findElement(By.id(“login_button”)).click();

Thread.sleep(2000);

System.out.println(“System Logged-in”);

}

}

Please see the below video to see how to configure Selenium on Eclipse for Sugar CRM

For more details for implementing Automation Testing for SugarCRM please contact here.

Leave a Reply

Your email address will not be published. Required fields are marked *