Category: SugarCRM

  • Blog
  • Category: SugarCRM

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 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() Click on Child item : Invoicedriver.findElement(By.linkText(“Invoice”)).click(); 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. 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. 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);  } 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.

Migrate the SugarCRM to AWS(Amazon Web Service) server (Part II)

Migrate the SugarCRM to AWS(Amazon Web Service) server (Part II) In Part I of Migrate the SugarCRM to AWS server, we have seen how to create an instance of the production server and a database server instance. Continuing the process, now we will see Apache configuration and migrate the SugarCRM database from the old database server to the new database server, which we have created in Part I. So let’s continue the process. Logging Into AWS EC2 instance using WinSCP/Putty We have to gain access to files and folders on the server. So here we are using WinSCP and Putty editor. Generating .ppk file 1. Install WinSCP 2. Install Putty 3. Run WinSCP and Click on New Session. 4. Run WinSCP->Tools->PuttyGen 5. Load .pem file created in Part I. Note: We had created a .pem file in Part I at the end of launching the production server instance. The same file we are using and converting .pem to .ppk file. 6. Set Key Passphrase 7. Confirm Key Passphrase 8. Save private key as .ppk file Logging in Using .ppk file Run WinSCP and select New Session. Select New Site Note: The hostname is the IP address of production server instance, which we created in Part I.  Enter Hostname(host IP) and Username (Ubuntu or see AWS AMI documentation) Click Advanced->Authentication and select private key (.ppk file generated in above steps.) OK->Login Basic setup using Putty Start Putty from WinSCP. Press Ctrl+p to start Putty. Enter key phrase. Fire the following commands on Putty. sudo apt-get update //to update ubuntu to latest sudo apt-get upgrade //to upgrade ubuntu to latest sudo apt-get install tasksel sudo tasksel //install LAMP sudo apt-get install php5.6-curl Upgrade to PHP 5.6 Fire the following commands as per the sequence. When we installed LAMP it provides PHP 5 but if anyone wants to use the latest version of PHP, say PHP5.6, so we add PHP 5.6. sudo apt-get install python-software-properties sudo add-apt-repository ppa:ondrej/php sudo apt-get update sudo apt-get install -y php5.6 // Install PHP 5.6 php -v sudo a2dismod php5 //Disable PHP 5 sudo a2enmod php5.6 //Enable PHP 5.6 sudo apt-get install php5.6-mbstring php5.6-mysql sudo service apache2 restart Copying files from Old Server To AWS We have to compress project folder on the old server using zip command. Go to the old server console and enter the root path of the project (eg. /var/www/html/blogs/techaroha_wordpress/project) and execute the following command. cd /var/www/html/blogs/techaroha_wordpress/project                    //root directory sudo zip -r project.zip project              //make zip file of project folder Now go to the putty console of the new server instance. Here go to the root directory, execute the following commands. cd /var/www/html               //root directory sudo wget http://old_server_ip_address/project.zip         //to download the project.zip from the old server sudo apt install zip               //install zip software on ubuntu sudo unzip project.zip          //unzip project.zip folder Copying Database from Old MySQL server to new MySQL server Dumping Mysql DB on the old server: sudo mysqldump -h MY_SQLHOST_IP -u root -p DBNAME>DBNAME.sql Restoring Mysql DB on the new server: mysql -h MYSQL_HOST -u root -p      //login to MySQL CREATE DATABASE DBNAME;          //create database sudo mysql -h MYSQL_HOST_IP -u root -p DBNAME<DBNAME.sql     //restoring database Note: MYSQL_HOST in above command is the database server instance address which was created in Part I. Configuring Apache Use the following command to create a file. vim /etc/apache2/sites-available/project.conf Add the following configuration in the above file. <VirtualHost *:80> ServerAdmin webmaster@crm.techaroha.com //email id of the admin of respective SugarCRM ServerName crm.techaroha.com //crm web address ServerAlias crm.techaroha.com //crm web address DocumentRoot &nbsp;/var/www/html/blogs/techaroha_wordpress/techaroha/Application/crm //path to crm project folder ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> Restart the Apache server Sudo service apache2 restart Server set up is done with above steps. The last thing to do is domain pointing. Check the IP address of AWS server instance, which was created in Part I of this process. Enter that IP address in domain pointing IP address. If you need more help contact us here.

Migrate the SugarCRM to AWS(Amazon Web Service) server (Part I)

Migrate the SugarCRM to AWS(Amazon Web Service) server (Part I) To Migrate SugarCRM to AWS server first we have to create an instance of the production/test server and a database server instance on AWS server. So we will see the same step by step. Create Basic AWS EC2 On-Demand instances : Login to Amazon console. Go to All Service -> Compute -> ECS2   Click Launch Instance.   Choose AMI (Amazon Machine Image): Here we choose the operating system of the server instance. I choose the Ubuntu Server. Anyone can choose other option as per the needs.   Choose Instance Type: Select the instance type as per requirement. There is the range of types of the instance which varies in the cost as well as in terms of the performance. Here we are selecting t2 micro. You can change the instance type in future.    See Charges using AWS Calculator. Configure Instance: Here we don’t have to do any changes. Simply move to the next step to add storage. If any changes are needed, do it carefully.   Add Storage: Specify the size of storage you need, it will be allocated the respective server instance. Select the volume type > General Purpose (SSD).   Add Tags: Here no need to do anything. Simply move to next step.   Configure Security Group Add Rule for SSH, Mysql, https, HTTP, SMTP, SMTP, etc. Here if you are not sure about the rules just add All Traffic option from the drop down. Later you can alter the security groups as per the needs.   Review & Launch Create Server then Generate and save .pem file. (Keep Backup of .pem file it will be required for logging in to server using WinSCP which we will see in Part II).   Go to EC2 -> Instance Here you can see that new instance is being initialized.   Add Elastic IP: Go to EC2 Dashboard -> Elastic IPs -> Allocate New Address We don’t have to do anything click on Allocate button and it will automatically assign an elastic IP.   Associate Address: After this, we have to associate the address with elastic IP. Select the instance and the click on the Associate address in Actions. Select Instance and Private IP then click Associate. Goto ES2 Dashboard -> Instance Check the status of the new instance. If it is “running“. Basic AWS EC2 instance is ready to use.   Create RDS (Relational Database Server) Instance  Go to Services -> Database -> RDS   Launch a DB Instance   Select Engine As we are using the MySQL Database so select the database engine. Select database engine as per the needs. Select MySQL -> MySQL Community Edition   Do you plan to use this database for production purpose or testing? Select Production or Dev/Test according to requirement. Then Press Next.   Specify DB Details Select DB Instance : db.t2.micro Storage Type: General Purpose (SSD) Allocated Storage: 15 GB (As per the requirement) DB Instance Identifier (MySQL server instance name) Master Username (DB Username eg. root) Master Password (DB password) Confirm Password (DB password) (Note down this password, it will be used in later MySQL configuration.)   Configure Advanced Settings Database Name: (DB name)   Launch DB Instance.  Basic RDS instance is ready to use. Go to RDS -> Instance and you can see that new database instance is being created. After the instance is activated, it is ready to use. Above red marked is the database host address which you will need later, to restore the database.  This is the first part of Migrate SugarCRM to AWS. Further, we have to install LAMP on the production server which includes Linux, Apache, MySQL, PHP. We also have to configure Apache. As well as we have to dump the database of SugarCRM on the new database server. We will see it in Part II. If any queries, please contact us here.

SugarCRM Load Testing using Jmeter

What is SugarCRM  and Why SugarCRM Load Testing is must? SugarCRM is the world’s largest open source CRM (customer relationship management) software. These custom business applications can be used in a multitude of ways, such as to power sales teams, run customer support organizations, and manage customer information databases.With the passage of time, the data in SugarCRM increases significantly and load on hosting server start increasing resulting into decreased performance making SugarCRM Load Testing a must to do task.   Why we Use Jmeter for SugarCRM Load Testing? Performance Testing is crucial to determine that the web application under test will satisfy high load requirements. It can be used to analyze overall server performance under heavy load.Jmeter is the best tool to complete sugarcrm load testing.   JMeter offers the following benefit in Performance testing: JMeter can be used to test the performance of both static resources such as JavaScript and HTML, as well as dynamic resources, such as JSP, Servlets, and AJAX. JMeter can discover maximum number of concurrent users that your website can handle JMeter provides a variety of graphical analyses of performance reports. JMeter Performance Testing includes: Load Testing: Modeling the expected usage by simulating multiple user access the Web services concurrently. Stress Testing: Every web server has a maximum load capacity. When the load goes beyond the limit, the web server start responding slowly and produce errors. The purpose of the stress testing is to find the maximum load the web server can handle. How to do Load Testing Of SugarCRM ? By using the Recording Controller we can easily record the Test script and use it for the load testing. Step 1: Need below software Apache JMeter – Download and run the .bat/.sh file from the bin folder. (.bat for window & .sh for Linux) Java  – Download and proper installation of Java. Mozilla Firefox – Download and proper installation of Mozilla. Step 2: Run the .bat file from the bin folder. Step 3: Build a test plan Add the Thread Group to Test Plan – Right-click on Test Plan > Add > Threads (Users)> Add > Thread Group You can also rename your Test Plan , Thread users and Thread Group Step 4: Add HTTP Request Defaults Right-Click on Thread Group –> Add–> Config Elements –> HTTP Request Defaults We are added the HTTP Request Defaults causes we will send the multiple requests to the same web server HTTP Request Defaults contain the two important parts- Server Name or IP Port Number   Server Name or IP: Enter the url or IP address of the site on which you want to perform the load testing.( Here I am using Server Name : crm.ihealthassist.in) Port Number: Enter the default port number 8888. Step 5: Add the HTTP Cookie Manager Right Click on Thread Group –> Add–> Config Elements –> HTTP Cookie Manager After selecting HTTP Cookie Manager make changes in Cookie Policy by selecting Compatibility option. Step 6: Add the Recording Controller Right-click on Thread Group > Add > Logic controller > Recording Controller Step 7: Add HTTP Test Script Recorder  Right Click on Workbench–> Add–> Non-Test Elements –> HTTP Test Script Recorder. Target Controller:  Add the place where you want to record the script. Here we choose –use recording controller. Step 8: Setting of the browser proxy Open Firefox Browser. Click on Tools shown at the top menu. Click on Options shown below Click on Advance shown on the window after clicking Options. Click on Network tab shown on the window after clicking Advance. Click on Settings Button. Click on Manual proxy configuration Enter localhost and Port 8888. Click ok button. Step 9: Now Record the Script When you click on the start button on the HTTP(S) Test Script Recorder then the below screen is appeared Click on the ok button.    Now enter the URL in the browser and navigate the screen according to you. Here we use “ http://crm.ihealthassist.in/index.php?module=Users&action=Login“ for load testing. After completion, the navigation stops the recording from the HTTP Test Script Recorder. Step 10: Add the Listener As we can use many listeners in same test plan but here we are using View Results Tree Step 11: Now save the Test Plan Click on File-> Save \ Name the test plan and save test plan in any location where you want to store your Test plan Step 12: Now Run the Test Plan By simply clicking on button which is shown below, we can easily run our Test Pan Step 12: After completed the process check the result-   Still Finding it Difficult Watch Our Video for more clarification To further understand SugarCRM Load Testing or to outsourceSugarCRM load testing you can always contact us here.