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.
Let’s Start to Install Selenium WebDriver in Eclipse
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
Now download “Eclipse IDE for Selenium”.
location: http://www.eclipse.org/downloads/
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.
You can download the Selenium Java Client Driver from this location:http://docs.seleniumhq.org/download/
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.
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
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
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.