Showing posts from October, 2014

Parameterize properties file in Java

If you are using a properties file and passing key value pairs, there are instances when you would want to parameterize the values passed. In my case the dynamic xpaths need to be parameteized for more flexibility

Solution: MessageFormat

Steps to achieve this :

Your properties file should have the key value as :HomePage.DynamicObject.Button=//*[@text=''{0}'' and @width>0] In the above statement {0} is the parameter In your class file that calls the propertyProperties obprop = new Properties();String Locator= MessageFormat.format(obprop.getProperty(Object_Identifier), params);where Object_Identifier is HomePage.DynamicObject.Buttonand params is the parameter you want to pass
Note:  Within a String, a pair of single quotes can be used to quote any arbitrary characters except single quotes. For example, pattern string "'{0}'" represents string "{0}", not a FormatElement. ...
Any unmatched quote is treated as closed at the end of the given patt…

Cheatsheet Git

Here is an awesome cheatsheet for the git repo:

P.S: Download the file for clarity

Remove duplicate lines from a file


You have two files that you have merged but now there are duplicate lines you want to omit.


There are many ways to do this but the easiest is to use this utility:

Eclipse Referenced Libraries disappear

Automating using Java Eclipse? 

Problem:  In Java projects in Eclipse sometimes the folder "Referenced Libraries" disappears from the "Project Explorer" view. All third party jars are shown directly in the root of the project folder

Solution 1:  Bring up the "Package Explorer" view (instead of the "Project Explorer" view).

Solution 2:  Click on the little "down arrow" icon in the top-right corner of the Package Explorer view. In the context menu that appears, one of the items on the menu is "Show 'Referenced Libraries' Node." Click on that menu item.

Eclipse Cucumber Plugin - Syntax highlighting not working feature file

If you have just installed the eclipse plugin for cucumber and the feature file steps are not colored then here is the simple solution.

Obviously you have already checked the following:

Plugin Installed correctlyExtension of this file is correct.
What went wrong is that you have accidentally opened the file with 'Text Editor'. All you need to do is change the default to "Editor" 

Device Enablement in SeeTest

The new feature of device enablement has made iOS mobile automation easy. Now we do not need a provisioning profile !!
Here are the steps tried first hand:
When you add a new device and select the checkbox for instrumented device, you now see a message:

Choose the option for device enablement and click ok, you will see an automated mail sent to you 

 Once you have received the email on confirmation another email will be sent to the support as a request:

Within a few hours you will receive a link to download the .def file!

Happy iOS automation!!!

Key Events in Android Device Automation

If you are looking to automate your android device there are instances when the automation tool/scripts need to run the adb shell commands to achieve the actions:

If you are using seeTest one of them is:"adb shell input keyevent 26");

For more commands look at:

Happy Android automation!