IndexedDB – A Web API for Client-side Storage

What is IndexedDB? IndexedDB is an API for storing significant amounts of structured data in a user’s browser. It helps to do high-performance searches using indexes. The data stored in IndexedDB is persistent and work online and offline. It provides both a synchronous and asynchronous API. In practice, however, all current implementations are asynchronous, and requests will not block the user interface from loading. Like most web storage solutions, IndexedDB follows a same-origin policy. So while you can access stored data within a domain, you cannot access data across different domains. There is some other traditional way to store data in the browser, though broadly used ones are cookies. There are limitations and drawbacks when using cookies that are limited to about 4 KB of data. Cookies are sent along with every HTTP Request, it slows down your application by sending the same data over and over needlessly. Most browsers allow only 20 cookies per site if you try to store more, the oldest cookies are discarded. Because cookies have been used to spy on people’s surfing behavior, security-conscious people and companies turn them off or request to be asked every time whether a cookie should be set. Another broadly used option is Local Storage. local-storage, or more accurately DOM Storage, was designed for smaller amounts of data. It’s essentially string-only key-value storage, with a simplistic synchronous API. We cannot store JavaScript objects directly in local storage. We need to convert the objects into a string to store. So direct querying is not possible in local storage. Unlike cookies and DOM Storage, IndexedDB provides features that enable you to group, iterate, search, and filter JavaScript objects. IndexedDB is a superior solution for offline storage in browsers when we handle a large amount of structured data. But compared to DOM Storage, its API is quite complicated. There are some polyfills and wrappers like local forage and dexie.js to make it simple. local forage is a polyfill that uses IndexedDB in the background, has some fallback mechanism to WebSQL, and then to local storage in browsers when indexedDB is not supported. dexie.js is a wrapper for IndexedDB that allows much faster code development via simple syntax. IndexedDB is a transactional database system, while it is also a javascript object-oriented database where data is stored in the form of javascript objects. Objects are grouped into object stores, and these objects are indexed with a key. You can run basic queries on your database and fetch records by looking up their keys in specific key ranges as we can also store images and files in IndexedDB. Getting Started with IndexedDB API Here we are going to discuss IndexedDB operations with an example that I have uploaded to GitHub. i. Create a Database and Object Store with Indexes In the following example, we are going to create a database and employee object store which holds employee details by their “EmployeeID” attribute. Additionally “name” and “designation” attributes make indexes. “name” attributes are indexed with unique constraints, so it does not allow the same name to repeat (case sensitive). Indexes are used for a lookup table. A connection to the database is opened. If the “inapp” database did not already exist, it is created and an event handler creates the object store and indexes. var request = indexedDB.open(“inapp”); request.onupgradeneeded = function() { // The database did not previously exist, so create object stores and indexes. db = request.result; var store = db.createObjectStore(“employees”, {keyPath: “empid”}); var nameIndex = store.createIndex(“by_name”, “name”, {unique: true}); var designationIndex = store.createIndex(“by_designation”, “designation”); // Populate with initial data. store.put({name: “Mohammed Safeer”, designation: “Software Engineer”, empid: “1”}); store.put({name: “Damodaran”, designation: “System Analyst”, empid: “2”}); store.put({name: “Ratheesh Kumar”, designation: “Software Engineer”, empid: “3”}); }; ii. Add data to Object Store The following example populates the database using a transaction. var tx = db.transaction(“employees”, “readwrite”); var store = tx.objectStore(“employees”); var request = store.put({empid: “4”, name: “John”, designation: “Business Analyst”}); request.onsuccess = function(){ // data added successfully } request.onerror = function() { // The uniqueness constraint of the “by_name” index failed. console.log(request.error); // Could call request.preventDefault() to prevent the transaction from aborting. }; tx.onabort = function() { // Otherwise the transaction will automatically abort due the failed request. console.log(tx.error); }; iii. Update data to Object Store The following example updates the entry with employee id 4 using a transaction. The update is the same as Insert, here we use an existing Key Path value (here empid 4 in this example). var tx = db.transaction(“employees”, “readwrite”); var store = tx.objectStore(“employees”); var request = store.put({empid: “4”, name: “James”, designation: “Marketing Manager”}); iv. Search Object Store with index and cursor The following example looks up all employee in the database by name using an index and a cursor. Note that it is case sensitive. var tx = db.transaction(“employees”, “readonly”); var store = tx.objectStore(“employees”); var index = store.index(“by_name”); var request = index.openCursor(IDBKeyRange.only(“John”)); request.onsuccess = function(e) { var cursor = e.target.result if (cursor) { // Called for each matching record. cursor.continue(); } else { // No more matching records. } }; v. Retrieve whole employees in Object Store The following example lists all the employees in the employee objectstore var tx = db.transaction(“employees”, “readonly”); var store = tx.objectStore(“employees”); // Get everything in the store var keyRange = IDBKeyRange.lowerBound(0); var request = store.openCursor(keyRange); // This fires once per row in the store. So, for simplicity, // collect the data in an array (data), and pass it in the // callback in one go. var data = []; request.onsuccess = function(e) { var result = e.target.result; // If there’s data, add it to array if (result) { data.push(result.value); result.continue(); // Reach the end of the data } else { callback(data); } }; vi. Delete an entry from Object Store with Key Path In the following example, we delete an entry with empid (Key Path) value 4 var tx = db.transaction(“employees”, “readwrite”); var store = tx.objectStore(“employees”); var request = store.delete(“4”); request.onsuccess = function() { // do something }; vii. Clear Object Store The following example

Rapid Application Development using Visual Studio LightSwitch

Visual Studio LightSwitch is a Microsoft development environment and application framework for quickly building data-centric applications. It is the simplest way to create business applications for the desktop and the cloud. It provides a rich three-tier application infrastructure that lets the developer focus on the custom business logic and data design, minimizing the amount of code required. With LightSwitch it is easy to create data-centric business applications that can consume a variety of data sources and create clients that can run on a variety of devices. Using LightSwitch you can: Build HTML5-based apps that run on all modern devices Consume and aggregate multiple data sources like databases, SharePoint and OData Eliminate plumbing code and focus on what makes your application unique Have flexible deployment and cloud hosting options including Azure and Office 365 Trust that the solution is built on best-of-breed technologies and practices Visual Studio LightSwitch includes a lot of pre-built components for the most common business application tasks. LightSwitch applications are flexible enough to support extensions for templates, data sources, shells, themes, business data types, and custom controls. LightSwitch apps can be hosted on Microsoft Azure or on IIS. SharePoint-enabled LightSwitch apps, also known as Cloud Business Apps, are to be hosted on SharePoint for Office 365. LightSwitch is built on Silverlight which makes it easy to deploy the final application either to the desktop or to a webserver to run in a browser. The application loses a bit of functionality when running in the browser since it runs in the Silverlight sandbox and can’t access things like COM automation or get unlimited access to the local file system. Apart from those limitations, there is currently no easier or quicker way to quickly build a browser-based Silverlight application. One can write custom code in Visual Basic .NET or C#. It can also be deployed to the desktop, browser, or cloud to share your application with others more easily without the cumbersome installation processes. Have questions? Contact the technology experts at InApp to learn more.

Creating Games with Unity 3D

Unity is one of the best development platforms for creating multi-platform 3D and 2D games. It is a game development ecosystem that allows you to create amazing games with very little effort. You can deploy it on multiple platforms such as iOS, Android, Xbox 360, PlayStation3, and many others. Typically Unity 3D comes with a demo so you can play around with all the tools. Features that make Unity 3D special: Multiplatform development with efficient performance optimization where you build the content once and deploy it anywhere. A highly customizable solution with scripting in quick compilation time. Flexible editor with rich features allowing users to produce high-end content. A rich Asset store with thousands of ready-to-use free or for-purchase assets that suit your needs. Unity 3D has the Scene Window where you can actually create the game. The Hierarchy Window organizes all the different game objects that are within your scene. The Project Window has all of the assets available to you that you can drag and drop into your hierarchy. The Inspector Window is where you can manage the components and properties of those game objects. All these features combined together make gaming with Unity 3D a seemingly effortless experience. Benefits of Unity 3D gaming engine: The engine is supported by a large community, as a result, you will be able to find help with any type of scenario. The community version in itself has more features than what is required by the developers and designers. Unity 3D can be developed on Windows or a Macintosh and released on multiple platforms. Unity Pro is available for free so you can try it out before investing time and money into it. Unity comes with a C# compiler which lets you do the scripting/programming of your game. The Games & Infotainment team at InApp has developed ‘Pooooy’ and ‘AeroBike’ 3D games using Unity 3D. Again, it is the ease of using the Unity 3D platform that has enabled our engineers to create such interactive games that take our gaming abilities to a high. To learn Unity 5 refer to the tutorial. Have questions? Contact the technology experts at InApp to learn more.

Useful tips in Selenium WebDriver

The integration of WebDriver API has been a major change in Selenium in terms of browser automation. WebDriver has a well-designed object-oriented API that provides a simpler and more concise programming interface. Along with Selenium, WebDrivers can make direct calls to the browsers by directly using the browser’s built-in support for automation. The following figure shows the Selenium Web server as an intermediary that interacts with the script (in Python / PHP) and the browser (Chrome / IE / Safari / Firefox). Here are some useful tips on using Selenium WebDriver 1. Open different browsers in the web driver a. Firefox Driver WebDriver webDriver= new FirefoxDriver(); b. Chrome Driver WebDriver webDriver= new ChromeDriver(); c. Internet Explorer Driver WebDriver webDriver= new InternetExplorerDriver(); d. Safari Driver WebDriver webDriver= new SafariDriver(); 2. Open new Tab webDriver.findElement(By.cssSelector(“body”)).sendKeys(Keys.CONTROL +”t”); 3. Close the newly opened tab webDriver.findElement(By.cssSelector(“body”)).sendKeys(Keys.CONTROL +”w”); 4. Wait for an element to be available on the page a. Method one WebDriverWait wait = new WebDriverWait(driver, 30); WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.xpath(‘xpath-of-element’))); b. Method two List<WebElement> sElements = webDriver.findElements(By.xpath(xPath)); int sCount = 0; while (sCount < sTime) { if (sElements.size() > 0) { break; } else { Thread.sleep(1000); sCount = sCount + 1; sElements = webDriver.findElements(By.xpath(xPath)); } 5. Drag and Drop items Actions builder = new Actions(driver); Action dragAndDrop = builder.clickAndHold(someElement) .moveToElement(otherElement) .release(otherElement) .build(); dragAndDrop.perform(); 6. Execute Java Script statement JavascriptExecutor jsx = (JavascriptExecutor) driver; jsx.executeScript(“sample code”); 7. Enable elements that will be visible or enabled only on mouse over ${iid}= webDriver.findElement(By.id(“id123″)).getAttribute(attributevalue); Execute Javascriptvar innerDiv = document.querySelector(‘DOM- element#${iid}’);innerDiv.style.display=”block”; DOM-element can be div or input or li 8. Upload a file – We can do it in 2 methods a. Method1 – If the upload button is defined as DOM element – ‘input’ use following method WebElement w = getWebDriver().findElement(By.xpath(element-xpath)); w.sendKeys(path-of-file); b. Method2 – If the upload button is not defined as – ‘input’ String filePath = “path-of-file-for-upload”; JavascriptExecutor jsx = (JavascriptExecutor) driver; jsx.executeScript(“document.getElementById(‘fileName’).value=’” + filePath + “‘;”); 9. Switch between frames WebElement iframe = getWebDriver().findElement(By.xpath(“//iframe xpath”)); getWebDriver().switchTo().frame(iframe); 10. Switch back to default content from the frame After performing actions in the iframe that was switched we might switch back to default content to perform further activities getWebDriver().switchTo().defaultContent(); 11. Switch to new window for (String winHandle : webDriver.getWindowHandles()) { webDriver.switchTo().window(winHandle); } 12. Switch tab String oldTab = webDriver.getWindowHandle(); ArrayList<String> newTab = new ArrayList<String>( webDriver.getWindowHandles()); webDriver.switchTo().window(newTab.get(0)); 13. Wait for page load webDriver.manage().timeouts().pageLoadTimeout(100, TimeUnit.SECONDS); 14. Scroll window to bottom, to view elements webDriver = getCurrentWebDriver(); JavascriptExecutor jsx = (JavascriptExecutor) webDriver; jsx.executeScript(“window.scrollTo(0, document.body.scrollHeight);”); 15. Scroll window to specific height -scrollHeight is the value passed to function webDriver = getCurrentWebDriver(); JavascriptExecutor jsx = (JavascriptExecutor) webDriver; jsx.executeScript(“window.scrollTo(0, ” + scrollHeight + “);”); Have questions? Contact the software testing experts at InApp to learn more.

Open Source Tools for Test Management

The test case is a set of test inputs, execution conditions, and expected results developed for a particular objective such as to exercise a particular program path or to verify compliance with a specific requirement. In software testing, we might deal with either actual requirements or self-imposed requirements, no matter how well the formal requirements and specifications are defined. The software tester will develop and execute test cases in the course of testing the software product. Many companies are outsourcing the execution of test procedures, and as a result, we are seeing more and more people for whom test cases are about execution not planning. The following figure depicts a test case cycle. Some of the most popular Open Source test management tools are: 1. Test Environment Toolkit (TETware) The Test Environment Toolkit is a test execution management system that can be used to test products across multiple operating systems. It provides an easy-to-use framework that can be built to support local testing, remote testing, distributed testing, and testing on real-time and embedded systems. 2. Bugzilla Testopia Bugzilla Testopia is a web-based test case management system designed to be a generic tool for tracking test cases on virtually anything in the engineering process and integrating bug reports with test case run results for centralized management of the software engineering process. 3. Mantis MantisBT is a Web-based bug-tracking system to aid product bug tracking. It is written in the PHP scripting language and works with MySQL, MS SQL, and PostgreSQL databases and a web server. MantisBT can be installed on Windows, Linux, Mac OS, OS/2, and others. Almost any web browser should be able to function as a client. Mantis is an easily deployable, web-based bug tracker to aid product bug tracking. It requires PHP, MySQL, and a web server. 4. RTH (Requirements and Testing Hub) RTH is a test-management tool, that has requirements-management and bug-tracking capabilities. It offers a large variety of features designed to manage test cases, releases, test results, issue tracking, and reporting. The tool creates a common repository for all test assets and provides a structured approach to software testing. 5. qaManager qaManager is a platform-independent web-based application for managing software QA projects effectively. qaManager facilitates managing project tracking, resource management, test case management, online library, alerts, and more. It’s powered by OpenXava and has a very simple installation. 6. Litmus (Mozilla) Litmus is an integrated test case management and QA tool maintained by Mozilla. It is designed to improve workflow, visibility, and turnaround time in the Mozilla QA process. Litmus server as a repository for test cases and test results provides a query interface for viewing, reporting, and comparing test results. 7. TestLink TestLink is a web-based test management tool that provides test specifications, test plans and execution, reporting, requirements specification, and collaboration with well-known bug trackers. Both requirements specification and test specification are integrated together which allows users to create test projects and document test cases using this tool. 8. FitNesse FitNesse is an integrated wiki and acceptance testing framework. Wiki facilitates the creation of web pages that are run as tests, so any user can go to that page and see if the tests are passing. It also provides the means to automatically run tests and write acceptance tests. Have questions? Contact the software testing experts at InApp to learn more.

Software Testing Frameworks used at InApp

Software testing at InApp is tailored to meet client-specific needs, manage critical testing processes and ensure consistent high quality through repeatable processes. The software testing methods employed here are as follows: Unified Selenium API Automation Framework Robot Framework QTP Modular Framework In-house automation Frameworks Unified Selenium API Automation Framework In Unified Selenium API Automation Framework all objects that will be used to perform actions will be identified and grouped under different nodes, in an XML file. Updating the locator in the XML file will reflect changes in all the areas the locator is referred to. The advantage of this framework is the ease of maintenance. Design API is modeled after human language – If it looks like a button, we call it a button, regardless of implementation Test code does not use locators verbatim – Locators are aliased through the .xml file usAPI exposes locators by UI element type – E.g., button, link, tab, tree node, etc. usAPI transparently handles timing issues, logging, setup/tearDown All tests will be derived from org.usapi.BaseSeleniumTest. This will expose (among others) an object named ‘app’, which is of the type BaseApplication. All interactions with the GUI utilize this ‘app’ object, at no time should there be any need to invoke selenium methods directly. BaseSeleniumTest configures, starts, and stops the selenium client transparently to the test developer. BaseSeleniumTest provides generic methods for use in tests, such as assertTrue, assertFalse, isElementPresent, etc. Note that these methods are application-agnostic. Methods required for a particular application (e.g. to execute SQL queries) do not belong in this class. Robot Framework Robot Framework is a generic test automation framework for acceptance testing and acceptance test-driven development (ATDD). Robot Framework has a modular architecture that can be extended with bundled and self-made test libraries. Test data is defined in files, a file containing test cases creates a test suite, and placing these files into directories creates a nested structure of test suites. When test execution is started, the framework first parses the test data. It then utilizes keywords provided by the test libraries to interact with the system under test. Libraries can communicate with the system either directly or using other test tools as drivers. Test execution is started from the command line or continuous integration tools like Jenkins, Hudson, and the like. As a result, you get the report and log in HTML format as well as an XML output. These provide an extensive look into what your system does. QTP Modular Framework QTP Modular Framework (also known as Functional Decomposition Framework) is the approach where you first identify the reusable code from your test cases. Then you write this reusable code inside different functions and call these functions wherever required. The advantage of this approach is that the reusable code would always stay in one place and thus it would be easy to maintain the code because you would have to make the changes in a single place only. To reuse this piece of code, all you have to do is call the function wherever required. The only challenging part here is to identify the reusable portions in your test case flow. Once that is done, you have to just create functions and use them wherever required. In addition to these popular frameworks, we customize and use frameworks based on client needs such as combining Unified Selenium API Automation Framework with hash maps to use as temporary buffer space and auto email program. Have questions? Contact the software testing experts at InApp to learn more.

Microsoft Azure – A Global Enterprise-Grade Cloud Platform

Microsoft Azure is a cloud computing platform created by Microsoft that is designed to run applications to be scaled out on the internet. Why Microsoft Azure Cloud? Microsoft Azure takes an application-centric view of cloud computing which means that it manages the entire life cycle of the application. From the initial design, development, and testing of the application to deploying it on the cloud, to monitoring and scaling that application when it is running out on the internet. Microsoft offers real-world experience with built apps and services such as outlook.com, Bing, Xbox Live, and Office 365 on cloud technology. All of these technologies are being used to build Azure. What’s with Microsoft Azure? Microsoft Azure is a broad stack of services that runs in all the data centers globally. Think of the different services as building blocks. These services can be categorized into 3 classes. The first is infrastructure services which are low-level building blocks. They are an abstract set of computer resources in the data center running virtual machines. The second is the data storage service that provides storage and data management capabilities to help your application manage all of its data in a reliable and scalable way. The third component is the developer experience where the infrastructure, storage, and all of the APIs are packaged in the cloud and made available to the developers. Some integration with Visual Studio is delivered in the form of an SDK that can be downloaded for a free trial and run locally. This means you can develop and test your application locally before you deploy it to the cloud. Benefits of Microsoft Azure: Applications can be developed and deployed within minutes which means one can get their apps out there in the market as quickly as possible. The speed and agility that this gives also mean that one can reiterate quickly to improve on their apps. It is open and flexible, provides first and best-class experience and support for Microsoft workloads, and embraces other open technologies. In addition to Java and .NET, it supports PHP, Python, and other languages. Excellent support for open frameworks like Hadoop, and web frameworks like Word Press, Joomla, and Drupal. Also provide 1st party SDKs for developing apps using Android, iOS, or Windows phones. It follows a utility model where you pay for only what you need and only when you use it. With this model, you can stop worrying about where your peak (limit) is, you can stop paying for things upfront and you can save a lot of money. Microsoft Azure Infrastructure services allow you to scale up to multiple instances using virtual machines. Developers can use these virtual machines to develop and test any of the applications. Websites can be built using Azure which acts as a powerful self-service platform. It is highly secure with enterprise availability, support for SSL, and active directory authentication. With Windows Azure mobile services one can easily and quickly build cross-platform mobile apps that scale. Finally, Azure helps one to understand the application and analyze it so that one can build a better version and deploy that to the cloud without entering any downtime. It is more economically viable as you need to pay for only what you use. This means that you have great cost savings and can achieve great efficiencies. To start please refer to Microsoft Azure training courses. Have questions? Contact the cloud computing experts at InApp to learn more.

An Overview of Testing Frameworks

What is a Testing Framework? A testing automation framework is an overall system in which the tests will be designed, created, and implemented. It also includes the physical structures used for test creation and implementation and the logical interactions among those components. Need for Testing Framework If a group of testers is working on the same or different project and each tester is applying their own strategy to automate the application under test, then the possibility of duplication is higher. Also, the time taken to understand the whole strategy will be high. So we need an environment that should be independent of the application and has the capability to scale as per the application under test. For this purpose, we use a testing Framework. The Testing framework is responsible for: Designing a centralized and standardized logging facility, resulting in self-documenting test output Creating a mechanism to drive the application under test Creating a mechanism to execute the tests Creating a mechanism to Report results Advantages of testing frameworks: Improved code re-usage Reduced script maintenance Independent of an application under test Easy Reporting Modular-Based Testing Framework Data-Driven Testing Framework Keyword Driven Testing Framework Hybrid Testing Framework Types of Testing Framework Modular-Based Testing Framework Data-Driven Testing Framework Keyword Driven Testing Framework Hybrid Testing Modular-based Testing Framework The module is a small independent script that performs a specific set of tasks. It creates a layer in front of the component and hides the components from non-technical users as well as applications. The small components are added up to build a large test set. Advantages of Modular-based Testing Framework: The fastest way to generate a script Modular division of scripts leads to easier maintenance Data-Driven Testing Framework In a Data-driven framework, test input and output values are read from data pools, DB sources, CSV files, Excel files, DAO objects, ADO objects, etc. Navigation through the program, reading the data files, and logging test status information are all coded in the test script. Advantages of Data-Driven Testing Framework: Datasheets can be designed while application development is still in progress Reduces data redundancy Data input/output and expected results are stored as easily maintainable text records in the database Changes to the test scripts do not affect the test data Test Cases can be executed with multiple sets of data Keyword Driven or Table Driven Testing Framework The keyword-driven framework requires the development of data tables and keywords that are independent of the test automation tool used to execute them and the test script code that “drives” the application under test and the data. Keyword-driven tests look very similar to manual test cases. In a keyword-driven test, the functionality of the application-under-test is documented in a table as well as in step-by-step instructions for each test. There are 2 basic components in Keyword Driven Framework viz. Keyword, Application Map. Keyword or Action The keyword is an Action that can be performed on a GUI Component. Ex. for GUI Component Textbox, some keywords (action) would be InputText, VerifyValue, VerifyProperty, and so on. Application Map or Control An Application Map provides Named References for GUI Components. Application Maps are nothing but ‘Object Repository’. Hybrid Testing Framework The most commonly implemented framework is the best combination of all the techniques. It combines Keyword-driven, modular, and Data-Driven frameworks. The hybrid Testing Framework allows data-driven scripts to take advantage of the powerful libraries and utilities that usually accompany a keyword-driven architecture. The framework utilities can make the data-driven scripts more compact and less prone to failure. Tests are fully scripted in a Hybrid Testing Framework thus increasing the automation effort. Hybrid Testing Framework also implements extensive error and unexpected Windows handling. It is used for the automation of medium to large applications with long shelf life. Advantages of Hybrid Testing Framework: Fastest and less costly way to develop the automation scripts due to higher code re-usability Utilizing a modular design, and using files or records to both input and verify data, reduces redundancy and duplication of effort in creating automated test scripts Have questions? Contact the software testing experts at InApp to learn more.

Bash Scripting with Example

Bash is a popular command-line interpreter for Linux computers including Mac OS X. Bash can execute a vast majority of Bourne shell scripts, mainly benefitting the administration and programming tasks. Many of the features were copied from sh, csh, and ksh. Bash is also like a programming language so you can write programs using bash usually to automate tasks. You can start writing scripts right away, wrap up multiline operations in one file, implement flow control, and interact with users to get input. Here I would like to explain how bash scripting helps in mailing an attached file using SMTP. a) Mailing particular file in a directory #!/bin/bash emailsend=fromemail@gmail.com emailrec=toemail@gmail.com password=password name=toemail@gmail.com /usr/local/bin/sendEmail -v -f “$emailsend” -s smtp.gmail.com -xu “$name” -xp “$password” -t “$emailrec” -o tls=yes -u Message Bash script -m HIII MAIL FROM BASH EXECUTE -a /home/Jinesh/Desktop/sendMailBash.sh Explaining the script 1)sendEmail – Is an SMTP client that should be installed in Linux 2)emailsend – represents the sender’s email id 3)emailrec – represents the receiver’s email id 4)smtp.gmail.com – mail server Options -u : This option helps in providing a subject to mail -m : helps in providing the text body for email -a : helps in attaching a file in your local drive to email (multiple files can be attached) ########################## Required Packages ############################### # yum install perl perl-CPAN perl-Net-SSLeay perl-IO-Socket-SSL (centos) # “sudo apt-get install libio-socket-ssl-perl” and “libnet-ssleay-perl” (ubuntu) ###########################install sendEmail ############################ # wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz # tar -zxvf sendEmail-v1.56.tar.gz # sudo cp -a sendEmail-v1.XX/sendEmail /usr/local/bin # sudo chmod +x /usr/local/bin/sendEmail # sendEmail b) Mailing multiple files in a directory #!/bin/bash for i in /home/Jinesh/Desktop/*.txt; do files+=$i” ” done emailsend=fromemail@gmail.com emailrec=toemail@gmail.com password=password name=toemail@gmail.com /usr/local/bin/sendEmail -v -f “$emailsend” -s smtp.gmail.com -xu “$name” -xp “$password” -t “$emailrec” -o tls=yes -u Message Bash script -m HIII MAIL FROM BASH EXECUTE -a $files Executing from Java These bash scripts can be executed from java : – String[] cmd = new String[]{“/bin/sh”, “path/to/script.sh”}; Process pr = Runtime.getRuntime().exec(cmd); Schedule execution Bash script execution can be scheduled at a particular time command : – at 1748 < /home/Jinesh/Desktop/sample.sh (will execute sample.sh at 17:78). Here we used “at” command to schedule a bash script execution We can also schedule bash script execution using crontab This will periodically execute the script. crontab -u root -e This will open scheduled tasks in vi editor. We can modify or add task here. Example: 10 11,16 18 sep thu /home/Jinesh/Desktop/senMailBash.sh >> /home/Jinesh/Desktop/backup.log 2>&1 10 – 10th Minute (Top of the hour) 11,16 – 11 AM and 4 PM 18 – date sep – month thu – day of the week This will execute and mail an attachment on 18th September at 11:10, 16:10 and the output will be printed to a file say “backup.log” crontab -u root -l List all scheduled tasks using * * – Every Minute * – Every hour * – Every day * – Every month * – Every day of the week tail -500f /var/log/cron : – view logs Implementation 1) If one needs to get a server log every day/week/month/year to a mail address, where the server is placed in another location we can use this. 2) By implementing this, the user can send an email for a particular query result to any mail address (we can periodically schedule this). Have questions? Contact the technology experts at InApp to learn more.

How to Write a Quality Bug Report?

One of the important deliverables in software testing is Bug reports. Writing a good bug report is an important skill for a software tester. In order to document a well-written bug report, the tester requires a combination of testing and communication skill. The bug report is a medium of communication between the tester and the developer when the tester uncovers a defect. The bug report explains the gap between the expected result and the actual result. A bug report should have the following: The Title Steps To Reproduce Test Data Expected and Actual Results Attachments The Title A good title helps reduce duplicate issues and accurately summarize the issue. Include the specific name of the components involved in your bug in the title. A good summary will not be more than 50-60 characters. You can avoid generic problems in the title. For example: ABC is not working properly The issue with the page When we define a title we should specify what makes it “not working”. Bad – “Application crashed” Good – “Canceling from Change Password dialog caused application crash” Bad: Issues with GUI on the navigation bar. Good: The navigation bar is wrapping to a second line. Steps To Reproduce This is the body of the report. This section tells how to reproduce the bug. We should keep the section concise and easy to read. The number of steps should be short and to the point. It is better to write prerequisites to reduce the number of steps. It’s a good exercise to reproduce the bug by following the steps you’ve just outlined. This will help ensure you’ve included everything the developer will need to reproduce it as well. Test Data If the bug is specific to the particular scenario it is better to give the test data, so that developer can recreate the scenarios. Expected and Actual Results When describing expected results, explain what should happen, not what shouldn’t happen. Instead of writing “The app got crashed”, we can write “The user should take to XYZ screen”. When describing actual results, describe what did happen, not what didn’t happen. Instead of writing “The user wasn’t taken to the page”, we can write “The user remained on the ABC page”. Attachments Attachments add the bug value by offering proof. The attachment can be images, videos, or log files. Images Images are an essential part of the bug report. The bug reports should be effective enough to enable the developers to reproduce the problem. Screenshots should be a medium just for verification. If you attach screenshots to your bug reports, ensure that they are not too heavy in terms of size. Use a format like jpg or gif, but definitely not bmp. Attach the image files directly to the report. Don’t put images in a Word document or a zip file. Highlight the areas of bugs in the image. Video The video should be provided if the steps are complex. Actions in the video should match the steps listed in the bug report. Videos should be trimmed to only show the bug. Log Files Make it a point to attach logs from the logs. This will help the developers to analyze and debug the system easily. If the logs are not too large, say about 20-25 lines, you can paste them into the bug report. But if it is large enough, add it to your bug report as an attachment. Avoid proprietary file types (like .docx). Use .txt instead. Have questions? Contact the software testing experts at InApp to learn more.

InApp India Office

121 Nila, Technopark Campus
Trivandrum, Kerala 695581
+91 (471) 277 -1800
mktg@inapp.com

InApp USA Office

999 Commercial St. Ste 210 Palo Alto, CA 94303
+1 (650) 283-7833
mktg@inapp.com

InApp Japan Office

6-12 Misuzugaoka, Aoba-ku
Yokohama,225-0016
+81-45-978-0788
mktg@inapp.com
Terms Of Use
© 2000-2026 InApp, All Rights Reserved