Posts

Showing posts from September, 2014

List of free software testing eBooks

Image
Here is a an interesting list of free software testing eBooks that Sergey has on github https://github.com/ligurio/free-software-testing-books/blob/master/free-software-testing-books.md Happy Reading!

Node Grunt error enoent stat roaming npm

Image
If you are working on protractor or any similar application, the prerequisite is to install node and grunt. Installing node is a child's play but if you are trying to install grunt npm install -g grunt-cli It bombs and says   Error: ENOENT, stat 'C:\Users\Ady\AppData\Roaming\npm' Solution:  Manually creating a folder named 'npm' in the path that it specifies , in this case  C:\Users\Ady\AppData\Roaming\npm Reason: a   bug in latest NodeJS for Windows installable Tip: Run the command prompt as administrator.

PhantomJS Selenium Webdriver Java - setup and Error trying to find element with xpath

Image
If you have a Selenium Webdriver framework that is working at its best! All you now need is  a headless browser like PhantomJS to test your web applications that make the functional tests faster. (According to their website PhantomJS is “a headless WebKit with JavaScript API.” Webkit is the layout engine used by a few browsers, such as Chrome and Safari. So PhantomJS is a browser, but a headless one.) Here are simple steps to add this capability in your selenium scripts: Download PhantomJS and extract the package. or windows its an exe file and for Mac its just a zip package you will need to extract.  Extract the phantomjs-1.9.x-windows.zip folder and locate phantomjs.exe file.  Copy this file to a common location where the framework libs are stored.(In my case I used the same space as ChromeDriver and IEDriver)  Add the following imports to your code: import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.phantomjs.PhantomJSDriver; impor

Schedule a Java ANT program on windows

Image
This is the easiest way to schedule a ANT build.xml script that you want to Run on any machine Make sure you can navigate to the path where you have the build.xml stored and run the ant command from command prompt Once confirmed that you are able to run the script from the command line Create a .bat file with just one word ant in it. This does not do any exception handling Open the control panel -> System and Security -> Power Options  and make sure that the computer never sleeps option is set (you need admin rights) Open the control panel -> System and Security -> Administrative Tools -> Task Scheduler Create a new task and navigate to the path of the .bat file in the Actions Tab under start a program Make sure the "Start In (Optional)" field has the absolute path to the file (without quotes) The final change is assigning the "Full Control" permission explicitly to .bat file for the account running the task. Note: Make sure

Performance testing with Selenium Webdriver - Navigation Timing API

Image
In continuation to my previous post on performance testing with Selenium Webdriver , I found the " Navigation Timing API " the best way as it has loads of parameters that we can slice and dice the way we want to get different performance parameters like: "Total Time:"+(loadEventEnd - navigationStart)/1000 + " seconds"+ " "Server Render Time: "+ (responseEnd - requestStart) + " milliseconds" "User Experience: "+ (domComplete - requestStart) + " milliseconds" "Network:"+ (connectEnd - navigationStart)/1000 + " seconds" "Server:"+ (responseEnd - requestStart)/1000 + " seconds" "Browser:"+ (loadEventEnd - domLoading)/1000 + " seconds" The properties you can play with are: The meaning of these events is described in Microsoft's performance.timing documentation  a nd more formally in the W3C Recommendation

Performance Testing using Selenium Webdriver

Image
Yes we know that Selenium Webdriver is a functional testing tool and is not a recommended option to do performance! But then there are times that you want to just do a quick performance check and find the bottlenecks in your application, here is how: The solutions here are organised based on the complexity and detail you want to achieve: Solution 1:   Measuring performance using a Timer in Selenium WebDriver We can use the the StopWatch class for measuring the time taken for the page to load or any inbuilt date time calendar feature: StopWatch pageLoad = new StopWatch(); pageLoad.start(); //Perform your test pageLoad.stop(); System.out.println("Total Page Load Time: " + pageLoad.getTime() + "milliseconds"); Or Calendar cal = Calendar.getInstance(); Date d1 = cal.getTime(); //Perform your test Calendar cal2 = Calendar.getInstance(); Date d2 = cal2.getTime(); long diff = d2.getTime() - d1.getTime(); long diffSeconds = diff / 1000 % 60; long di

Happy World Tester's Day!

Image
Now this is a day that I love, though I was introduced to this just three years back and if you are still wondering what is it all about: On September, 9 1945 the scientists of the Harvard University while testing the computer Mark II Aiken Relay Calculator had found a moth which got stuck between the contacts of the electromechanical relay.  The work they performed required some description, and the word had been found – «debugging» (literally: disposal of an insect) – and now it is used to describe the process of identifying and eliminating bugs which cause a computer to malfunction. The removed insect was pasted into the computer log with the entry: “First actual case of bug being found”, and was then transferred to the computer museum. Now that you know, Happy Tester’s day !

SeeTest Cheatsheet for Mobile test automation

Image
Here is the first of its kind a cheat sheet for SeeTest mobile test automation: P.S: Click on the image to download a larger copy. You can also email me for an excel version for easier navigation! Happy Mobile testing!

Remotely access a Mac machine from windows machine

Image
There are many tools that allow you to remotely log-in either between two Windows / two MAC machines. There are five tools that I evaluated while choosing which one is the best to remotely access apple Mac OS X from Windows.  TeamViewer LogMeIn RealVNC Vine Server Remote Management The best tool that I thought when it comes to automation is the free version of LogMeIn. The reason being the refresh rate and the connectivity. You can write a small script that can even help you schedule tests on the remote machine! LogMeIn is Free  Web interface or the Firefox plugin.  Easy steps  First you will need to create a free account Login from the Mac computer and click the Add Computer button to download the LogMeIn Installer.  After installation, you can access that computer from any other computer by logging in to LogMeIn.

Modify the IP headers on the iPhone / Bypass or change the ip on any device

Image
Problem: If we need to test an application which is outside the network or with a different IP address how do we do that? we need to be able to use a proxy server that bypasses or replaces some properties that can be then used to modify the way the application is accessed. Solution: Here is an example of how to do that on an iPhone (You can do this for any device) : Go to settings in iPhone and modify the manual IP address. Give it the same IP address as that of the local machine where the proxy server would run and select a valid port : say 8080 To set the IP headers or proxy download the Burp Free edition from here:  http://portswigger.net/burp/download.HTML Go to the Intercept tab and make sure it is off. Go to Options tab and edit the Proxy listeners to local ip of the machine: Scroll down to Match and Replace Pick a Request header not in use and modify that: In our case “Client-Version” to Now check the  HTTP history tab to confirm that the header is replaced wh

How do I get my Nexus 7 to show up in the adb devices list ?

Image
Problem: Nexus 7 that I'm trying to connect to Windows computer for automation over adb No device driver for nexus 7 ? What did not work: I did click on the build number 7 times to get the developer options enabled Tried connecting both as a Media device (MTP) and as a Camera (PTP). ("Connected as a media device" up at the top left corner, de-selecting Media Device (MTP) and then checking Camera (PTP).) downloaded this usb driver: http://dlcdnet.asus.com/pub/ASUS/EeePAD/nexus7/usb_driver_r06_windows.zip Go to the device manager , right click the nexus device and choose properties, choose "hardware" and then choose update your driver , choose manualy and pick the folder you opend the zip file to and press apply. What worked for me: The universal adb driver installer worked for me. Download the universal driver exe Run with the device connected and it will give you an option to install.  http://adbdriver.com/ Install that and you will

Funny way to enable developer options on android

Image
Problem :  Toggle on the "USB Debugging" in the "Developer Options" area of Settings in an android device This is a prerequisite to perform automation. Solution: If you do not see "Developer Options" Go into "About device" in Settings  Tap on the "Build number" entry seven times, which will unlock "Developer Options". So it's that simple tapping  the build number will make you a developer :P