Blog

Free SSL for SugarCRM and other websites

Why SSL is must for SugarCRM ? SugarCRM or any other crm store vital information about Customer, leaking this data to hacker can pose a very serious problem for Companies. To avoid this best way to secure your website is setup a SSL for SugarCRM instance and domain, This article explains how to setup Free SSL for SugarCRM. How to Setup Free SSL for SugarCRM Using following steps it is very easy to get Free SSL for SugarCRM and other websites: 1) Go to Website https://www.sslforfree.com/ SSL for Free uses Let’s Encrypt, It’s a free and open Certificate Authority. 2) Enter your website URL and click Create Free SSL Certificate 3) Click on Manual Verification, Then on Manually Verify Domain 4) Download verification file by clicking on given link 5) Upload verification files to server We can upload to home directory of user using WinSCP then copy to .well-known/acme-challenge directory using Putty (or similar utility) We can do this by following commands: cd /var/www/html/blogs/techaroha_wordpress/techaroha/Application/crm sudo mkdir .well-known sudo mkdir .well-known/acme-challenge cd .well-known/acme-challenge sudo cp /home/ubuntu/8KwHBt7R-Hj_ajYy8KdrVMjO7hmDaEgEcWbwkywvBCQ ./ sudo cp /home/ubuntu/P0yc76hR-l7KAoTf84LzoYVgf1d8XPTgPsSsMnZjzdw ./ 6) You can check verification files are properly uploaded by clicking on given links If it shows error like file not found check that you have uploaded to proper directory and directory is accessible 7) If file verification links works properly click Download SSL Certificate 8) Now Click Download All SSL Certificate Files to download all certificate files in a zip package 9) Now Copy certificates to /etc/ssl/certs in your server You can copy and save certificate files individually directly to server using these command cd /etc/ssl/certs sudo mkdir www.techaroha.com cd www.techaroha.com sudo vim www.techaroha.com.crt (press i and paste certificate content, press esc key, then :wq to save) sudo vim www.techaroha.com.key (press i and paste Private Key content, press esc key, then :wq to save) sudo vim www.techaroha.com.ca-bundle (press i and paste CA Bundle content, press esc key, then :wq to save) To generate CSR from certificate use following command sudo openssl x509 -in yourDomainName.crt -signkey yourDomainName.key -out yourDomainName.csr 10) Configure apache to use ssl Edit your websites apache config file using following commands cd /etc/apache2/sites-avilability sudo vim techaroha.conf ( add these lines and make appropriate changes and save) <VirtualHost *:443>ServerName www.techaroha.comServerAdmin webmaster@techaroha.comServerAlias www.techaroha.comDocumentRoot /var/www/html/blogs/techaroha_wordpress/techaroha/Application/crmErrorLog ${APACHE_LOG_DIR}/error.logCustomLog ${APACHE_LOG_DIR}/access.log combinedSSLEngine onSSLCertificateKeyFile /etc/ssl/certs/www.techaroha.com/www.techaroha.com.keySSLCertificateFile /etc/ssl/certs/www.techaroha.com/www.techaroha.com.crtSSLCertificateChainFile /etc/ssl/certs/www.techaroha.com/www.techaroha.com.ca-bundle</VirtualHost> Enable ssl and restart apache service sudo a2enmod ssl sudo service apache2 restart Now Visit http://52.66.6.159/testblog and check if there is any certificate error. If you want your website to force https you have to make change in .htaccess RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ http://52.66.6.159/testblog/$1 [R,L] (add above lines to existing .htaccess file in your public directory or create a new file) Enable mod rewrite and restart apache service sudo a2enmod rewrite sudo service apache2 restart visit http://52.66.6.159/testblog and test it should redirect to http://52.66.6.159/testblog,If you need any help you can always contact here

Configure Eclipse with Selenium WebDriver for 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/ 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/ 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. 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  Now Right-click on “testProject” and select Properties. On the Properties window, click on “Java Build Path”. Click on the Libraries tab, and then click “Add External JARs..” 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). 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. 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.

SugarCRM Automation Testing

Why is SugarCRM Automation Testing Required? Every growing company needs CRM and they customize it according to the requirement for their business.CRM needs changes with the market and technical/testing team has to keep up themselves with the market. Generally, SugarCRM system is vast and manage many things other than customer relationship. In such scenario tester’s and quality control professional find it difficult to decide what to test and what not. Testing everything from the start will consume too much time increasing the cost of the product , if testers leave something untested it may lead to the quality issue. The only solution to this problem is to automate the testing and implement SugarCRM Automation Testing. How ? In Automation, Selenium is the best tool for Testing sugar CRM  Here, We can access all elements and operate for testing dynamically. Validation is the process to evaluate sugarCRM quality and development phase.So, I have to find all required elements and compare Actual result to Expected Result. For, Quality check I use Chrome Driver, Chrome users are increases frequently, still, we also can use Firefox Driver. System.setProperty(“webdriver.chrome.driver”,”E:\\Driver\\chromedriver.exe”); ChromeOptions options = new ChromeOptions(); While Testing browser should disable other Extensions for automation Tool options.addArguments(“–disable-extensions”,”–test-type”); WebDriver driver = new ChromeDriver(options); Login SugarCRM using selectors id, driver.get(“http://crm.ihealthassist.in”); driver.findElement(By.id(“user_name”)).sendKeys(new String[] {“username”}); driver.findElement(By.id(“user_password”)).sendKeys(new String[]{“password”}); driver.findElement(By.id(“login_button”)).click(); When searching for Element in form, driver expires the session until element has been found, But timeout expires before throwing a NoSuchElementException and increasing the implicit wait timeout. driver.findElement(By.xpath(“//*[@id=’moduleTab_0_Vendor’]”)).click();   driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS) ; driver.findElement(By.id(“create_link”)).click(); driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);   For Validation Assertion compare both expected and Actual Result, Here, I have used “SoftAssert” because it continue with sequence even after an assertion fails in the sequence //Validate Using Assertion SoftAssert softAssert = new SoftAssert(); softAssert.assertEquals(Name_err_msg,”Missing required field: Name”); softAssert.assertEquals(Url_Name_err_msg,”Missing required field: Url Name”); softAssert.assertAll(); Please see the below video to see how SugarCRM Automation Testing works For more details for implementing Automation Testing for SugarCRM please contact here.

SugarCRM Popup Filter on Relate/Relationship field

Applying filter in SugarCRM on the pop-up view results of a relate/relationship field. Why SugarCRM PopUp Filter? While working in SugarCRM, many times we get the unnecessary records in relate field pop up view. Sometimes, we have to filter the records manually as per our need. It’s better to filter those records at the back-end as per system requirement and get the relevant records only. So avoiding hectic job of manual searching. Let’s see how SugarCRM PopuP Filter is being implemented. How ? It’s simple, here is the answer. For example, Add a filter in Account pop up view on From the SugarCRM  Admin Panel, accessing the Studio or Module Builder, we can add the fields in the pop up the search. Suppose we want to add a field Industry in search fields of Accounts module pop up view. Step 1.   Go to the admin panel. Step 2.  Go to the studio. Step 3.  Select the module Accounts. Step 4.  Select “Layouts” option. Step 5.  Select “Pop-up view”. Step 6.  Select “Popup Search”. Step 7.  Drag the field “Industry” from the column Hidden and drop in “Default” column. This is how anyone can add the fields in the pop up the search as per the requirements. Going further now we want to use that field to filter the records in the pop view. Only the records having Industry as “Consulting” should be listed in the pop-up view. To perform this functionality at the back-end,  we have to work on the pop-up view of Accounts module. As per the standard practice, we will do it in “Custom/modules/Accounts/views/” directory. In views folder, you can see the file “view.popup.php”. If it is not there, create a PHP file with the same name. If you create a new file add the code given below: require_once (‘include/MVC/View/views/view.popup.php’); class AccountsViewPopup extends ViewPopup { function CustomViewPopup() { parent::ViewPopup(); } function display() { global $popupMeta, $mod_strings, $custom_filter_gcm; parent::display(); } } Now to apply the filter we add some lines of code in the display function. require_once (‘include/MVC/View/views/view.popup.php’); class AccountsViewPopup extends ViewPopup { function CustomViewPopup() { parent::ViewPopup(); } function display() { global $popupMeta, $mod_strings, $custom_filter_gcm; /* We post the industry value as “Consulting” in an array. */ $_REQUEST[‘industry_advanced’] = array(‘Consulting’); parent::display(); } } If we observe the pop view of Accounts module, we will get records of Industry “Consulting”. And we are done.  It’s that simple. If you have any such requirement and detail implementation help you can always contact us here.