SugarCRM Automation Testing of Filters using Selenium Webdriver

SugarCRM Automation Testing of Filters using Selenium Webdriver
SugarCRM Automation Testing of Filters using Selenium Webdriver
SugarCRM Automation Testing of Filters using Selenium Webdriver
SugarCRM Automation Testing of Filters using Selenium Webdriver
SugarCRM Automation Testing of Filters using Selenium Webdriver

Why SugarCRM Automation Testing of Filters required?

SugarCRM has allot of Vendors for Customer Relationship ,to manage and access Vendors required records sugarCRM provide efficient filtering system. Here, user can select Vendor ID, Member, Contact ID, etc. all filtering done by SugarCRM Automation Testing

How?

For Automation testing on filters need to handle two Actions

  1. Mouse Over action on Menu

    In SugarCRM most of the options are hidden under Menu or sub-Menus

    In order to perform a ‘mouse hover’ action, we need to chain all of the actions that we want to achieve in one go. So move to the element that which has sub elements and click on the child item.

    With the actions object you should first move the menu title, and then move to the sub menu item and click it.

    In order to perform action events, we need to use “org.openqa.selenium.interactions.Actions” class

    Move Menu item  : Invoice & Transactions 

    WebElement element = driver.findElement(By.linkText(“Invoice & Transactions”)); 
    Actions action = new Actions(driver); action.moveToElement(element).build().perform()

  2. Click on Child item : Invoice
    driver.findElement(By.linkText(“Invoice”)).click();

  3. Here ‘build()’ method is used to compile all the list of actions into a single step and ready to be performed.

    We need to use perform() to execute the action.

    Mouse_Over_Invoice_SugarCRM

  4. MULTIPLE WINDOWS ON SUGARCRM TO SEARCH VENDOR

    In SugarCRM filters has to open different window to select particular value to have required report.

    So, Now We have an to deal with multiple windows in Automation Testing has always been a little tricky and require an extra effort.

    The entire process can be fundamentally segregated into following steps:

    Step 1 : Clicking on Link for Vendor ID on SugarCRM 1st window

    A new Window with list of Vendor is opened.

    Filter_Invoice_Vendor_ID_SugarCRM

    Step 2 : Move Focus from SugarCRM 1st window to Vendor Window

    Vendor Window is active now

    Code :
     for (String winHandle : driver.getWindowHandles())     {  driver.switchTo().window(winHandle);  }

    Search_Vendor_ID_SugarCRM

    Step 3 : Perform Actions on Vendor Window

    Complete the entire set of Actions

    Step 4 : Move Focus from Vendor Window to SugarCRM 1st window

    SugarCRM 1st window is active now

Let’s implement above steps in Eclipse with Selenium Webdriver on SugarCRM

//get SugarCRM Window (Parent Window)

String parentWindowHandle = driver.getWindowHandle(); System.out.println(“Parent window’s handle -> ” + parentWindowHandle); //Switch window from Parent window to Search Vendor Window driver.findElement(By.xpath(“//*[@id=’tmf_Invoicebasic_searchSearchForm’]/table/tbody/tr[3]/td[6]/span/button[1]”)).click();

for (String winHandle : driver.getWindowHandles()) {

driver.switchTo().window(winHandle);

// switch focus of WebDriver to the next found window handle if(!parentWindowHandle.equals(winHandle))

break;

}

driver.findElement(By.xpath(“//*[@id=’name_advanced’]”)).sendKeys(“prathama”); driver.findElement(By.id(“search_form_submit”)).click(); driver.findElement(By.xpath(“/html/body/table[4]/tbody/tr[3]/td[1]/a”)).click(); //Switch window back to SugarCRM Window driver.switchTo().window(parentWindowHandle); driver.findElement(By.id(“search_form_submit”)).click();

Please see the below video to see how SugarCRM Automation Testing on Filters  works

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 *