Emulate mobile and tablet devices with ChromeDriver

Desktop version of Google Chrome allows to users to open webpages in mobile view. This means that you can emulate browsing on devices like Google Nexus 5, Apple iPhone 6 etc. You can find this feature in developer tools by clicking on the mobile icon.

Mobile emulation button

Mobile emulation button

Now ChromeDriver allows to use device emulation in automated tests also. This feature speeds up web development, allows developers to quickly test how a website will render on a mobile device, without requiring a real device or a virtual machine. You can find more information about it on the following link https://developer.chrome.com/devtools/docs/device-mode. The setup is very easy and it’s working really well. Below you can find a little test case which will introduce to you how to use ChromeDriver for emulate a mobile device and tablet. The test case simply enters “what is my browser” into the google search page, clicks on the first result and checks the device type what will be present on the website.

@DataProvider(name = "deviceName")
	public Object[][] deviceNames(){
		return new Object[][] {
				{"Google Nexus 5", "LG Nexus 5"},
				{"Apple iPhone 6", "Apple iPhone"},
				{"Google Nexus 10", "Samsung Nexus 10"}

	@Test(dataProvider = "deviceName")
	public void mobileEmulation(String deviceName, String deviceNameWhatIsMyBrowser){
		Map<String, String> mobileEmulation = new HashMap<String, String>();
		mobileEmulation.put("deviceName", deviceName);

		Map<String, Object> chromeOptions = new HashMap<String, Object>();
		chromeOptions.put("mobileEmulation", mobileEmulation);
		DesiredCapabilities capabilities = DesiredCapabilities.chrome();
		capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
		WebDriver driver = new ChromeDriver(capabilities);

		//Enter my search
		driver.findElement(By.cssSelector("#lst-ib")).sendKeys("what is my browser");
		//Click on search button
		//Click on the first found result
		//Get the device name from the website
		String deviceNameFromWebsite = driver.findElement(By.cssSelector(".string-extra-info")).getText();
		//Check the device name from the website
		Assert.assertEquals(deviceNameFromWebsite, deviceNameWhatIsMyBrowser, "The device name is not the expected one.");

Ranorex – is this tool the tester heaven?

What is Ranorex? Is this a medicine? :)

Ranorex is an automated testing tool which provides testing of Microsoft desktop apps, webpages and mobile applications. It supports wide range of technologies like .NET, WFA, WPF, Java, HTML5, Flash, iOS, Android, Windows apps (hybrid and native) and so on. You can perform cross-browser, data-driven, automated functional, regression, automated GUI and keyword-driver testing. The Ranorex software pack can be classified into a few big parts. Ranorex Studio is the main section. Ranorex Studio contains the main tools like Ranorex Recorder, Ranorex Repository and RanoreXPath. In this post we will introduce them generally in different sections.

Ranorex Studio

Ranorex Studio is the heart of the Ranorex ecosystem. If you are familiar with Microsoft’s Visual Studio you will know immediately how to use it. It has the same layout like Visual Studio 2008/2010.

Main view of the Ranorex studio

Main view of the Ranorex studio

Testrail – first impressions

Everybody can confirm that the software development and testing are very complex processes. Having a good organizing tool (or using more of them) can help a lot to make the process faster and more fluid.
This time I will write about TestRail – the test management tool.

Why Testrail?

We have tried many test management tools – installed a lot of them, played with settings, configurations and at the conclusion was that those apps was uncomfortable/complicated for everyday use. We tried to find some free test management tools, but after few try we decided to try a professional ones.

Some thoughts about the infamous StaleElementReferenceException

With the widespread of JavaScript we more and more met with one of our favourite exception which is the StaleElementReferenceException.
It can be tricky because it does not have to appear on the test development machine. This issue can hide in the test code and appear in unexpected situations.

The exception happens when the dom changes and the system can’t be sure if the Webelement is still on the page.
Dom changes can be caused by page refresh, javascript effects, ajax responses and so on.

Genymotion review

Genymotion is an Android tablet and phone emulator from the company Genymobile. It is available for Mac OS, Windows (x64/x86) and Linux platforms.

The description on the product page describing it as “Fast, simple and powerful” certainly fits it well. It boasts considerable speed, leaving its competitors in the dust. It boasts quite a number of pre-configured devices including Samsung Galaxy, Google Nexus, and Sony Xperia series of phones. You can also make a custom phone or tablet to suit your needs. The paid version offers additional powerful functions.

Test management tools and Zephyr

What is a test management tool?

Test management tools have several features, like managing the tests, scheduling the tests, managing the test activities, text execution tools etc. You can find many related articles here

I have been looking for an optimal test management tool lately. First, I have searched for free tools, googled about these tools. Tried some of the demos. They are all very different (Comparison from StackOverFlow). Some of them were giving me really hard time during use, they were too complicated. On the end I got the feeling that everywhere is missing something. If the interface was simple, it was too limited or the whole system was too slow. How can you find the optimal, or I can say the best fit for you? Try them.

Top 5 SEO Trends for 2015

Each year the SEO industry unrecognizable changes from the previous one, and keeping up with the latest SEO trends is important to keeping your marketing edge. Google has already made a drastic change this year to their algorithm to favor mobile friendly websites.

So what is coming next?

Nobody knows for sure, but we can make an educated guess based on trends and data analysis to decide what to focus on in 2015.

  1. Mobile

    With the changes made by Google, being mobile-friendly that used to be a luxury is now a must. Starting this year the mobile for the first time overtook the desktop in the number of searches made. Mobile users consume content differently that desktop users. They are looking for information to accomplish specific tasks while “on the go”, they’re also more likely to use voice search, as well as access content at different times or in different locations than desktop users. Mobile search algorithms call for different best practices than the desktop ones, so to get a competitive advantage brands will have to quickly and effectively deliver high-quality mobile experiences for consumers.

Java NumberFormat in action

Parsing or formatting various decimal or currency formats often make the job more difficult. If the expected number format is not the same as it is given then you as a programmer have to adapt to the situation and this is not always easy. There is an already implemented way in Java to handle this.


Perforce – Can’t Clobber Writable File Error

There is an interesting issue i have met the other day.
When i tried to get the latest version of a file from a perforce repository the following error message appeared:

Can’t clobber writable file

Mobile friendly Algorithm

This algorithm will be the next on the list of Google’s updates. Will it impact too much on the Google SERPs in the future? Judge it yourself. Maybe it is enough to say, that more than 50% of the internet traffic is used by mobile devices.
Check here is your website mobile friendly.

Why is important to have a mobile friendly website?