Currently Browsing

Author Archive

Amazon web services – Device Farm

Device Farm is an app testing service that enables you to test your Android, iOS, and Fire OS apps on real, physical phones and tablets that are hosted by Amazon Web Services (AWS). Currently Device Farm allows you to run your own tests or built-in compatibility tests parallelly on the selected devices. The list below contains the test types on various platforms (from amazon.com):

Basic tutorial to setup a new project and test run

Once you are signed in, go to Amazon Console and click on Device Farm. Click on the Create New Project button and enter desired name for your project. Click on a newly created project and you will be automatically redirected to “Create new run” page. Upload your application what you want to test and click on the “Next step” to choose your test run type.

Change iOS Settings on virtual device with Appium

In our previous post we introduced the steps to set up your Appium environment for iOS 9 devices. In this post we will write about how can you open the Settings app and do some changes in it. We will use Java as programming language, Eclipse for IDE and JUnit as runner.

Ok, so first step is to get the Java client of Selenium from www.seleniumhq.org/download/. Extract the downloaded *.zip file, create a new Java Project in Eclipse and add all extracted *.jar files to Build Path. Now, we can start to implement our first test case for iOS device where we will open the Settings app and disable the Location Service on iPhone. As we mentioned above, we will use JUnit as runner, but you can also choose TestNG or just create a standard Java program with the main() function.

Let’s create a before() method with annotation @Before where we will set up all of the necessary things for the desired test case.

Setting up Appium on Mac OS X for iOS virtual devices to test your application

In this post we will introduce the basic setup of Appium to work with iOS devices. We will go through with detailed steps, so you can skip some of those if you are familiar with.

For start you need to install Xcode. Go to the App Store, type Xcode, hit the download button and grab a coffee, it will take some time. Next step is to install Xcode command line tools. Open your default terminal application (Terminal, iTerm, etc.) and enter xcode-select –install. Click on Install button on the presented popup.
Xcode-Select modal
Agree the fine print, wait for the components to be installed and click on Done. Don’t forget to accept the license and agreements of Xcode. Simply start Xcode, accept the licenses and wait for the components to be installed. Now we are able to start our iPhone/iPad simulator so if you want to try it out, switch to your Xcode and choose Xcode/Open Developer Tool/Simulator. The downside is that you will have just iOS 9 installed, and you can’t change it to the older version. Next chapter is to install Appium and required packages.

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);

		driver.get("http://www.google.com/ncr");
		//Enter my search
		driver.findElement(By.cssSelector("#lst-ib")).sendKeys("what is my browser");
		//Click on search button
		driver.findElement(By.cssSelector("#tsbb")).click();
		//Click on the first found result
		driver.findElement(By.xpath("//h3[@class='r']/a[text()='What browser am I using? Is my browser up to date? Web browser ...']")).click();
		//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.");
		
		driver.quit();
	}	

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

BlazeMeter – Work with Selenium Webdriver

It was a long time we wrote about the BlazeMeter and during this time it comes more reliable, easy to use and there are also some new, great tools (Here you can find our latest post about BlazeMeter: Previous post about loadtesting with BlazeMeter).
Maybe the most important feature is that now you can use Selenium Webdriver to describe your test scenario. There are two ways of creating Selenium Webdriver test on BlazeMeter. You can write your own Selenium Webdriver script or you can record it. Unfortunately recording function was not published yet, so we will explain it in one future post (the link will be placed here).

Simple and advanced usage of LoadableComponent

We all know that the navigation between pages is sometimes painful, and we need to write a lot lines of code to get to the right place. Using LoadableComponent is a better way to manage your navigation, especially if you need to go through welcome pages, login pages etc. in every single case of test. As simple as possible you just need to extend your Page Object classes with “LoadableComponent< T >” like this:

public class WelcomePage extends LoadableComponent<WelcomePage>

You need to override two methods:

@Override
	protected void isLoaded() throws Error{}

@Override
	protected void load() {}

Graphwalker Path generators and Stop conditions

In this post we will try to give some ideas how to use the Graphwalker Path generators combined with Stop conditions. We recommend you to read our latest post about the Graphwalker API , however here is the snippet of code from last post:

ModelHandler modelHandler = new ModelHandler();
File loginModelFile = new File("'your location for the graphml file'/LoginModel.graphml");
Test testModel = new Test(loginModelFile, true, new A_StarPathGenerator(new EdgeCoverage(1.0)), false);
modelHandler.add("Test", testModel);
modelHandler.execute("Test");
Assert.assertTrue(modelHandler.isAllModelsDone());
String actualResult = modelHandler.getStatistics();
System.out.println(actualResult);
testModel.getDriver().quit();

Graphwalker – how to make *.graphml file to use with Graphwalker API

As we mentioned in “how to start guide” you can generate Java Class from *.graphml file which you created in yEd. First let’s go through the process of making one basic *.graphml file.
Let’s say that we want to make one login smoke test for a random website. The model can be look like the following: