Thursday

Install eclipse on Mac OS X 10.9 onwards / JRE or JDK must be available in order to run Eclipse.



If you are seeing this error while launching eclipse after an update to your Mac machine:

"A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse."

There are couple of solutions:

  • editing eclipse.ini, adding in
vm /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/bin/java just before the -vmargs
  • editing the Info.plist and adding the full path to the Oracle SDK, checked if syntax was correct by double clicking and succesfully opening it and verified that the path was correct.
  • adding 4 capabilities to the JDK:
                CommandLine
JNI BundledApp WebStart Applets

  • The eclipse.ini entry must have -vm on a separate line from the path
    -vm 
    /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/bin/java

  • All this after installing JDK7 and on my Mac I still see errors!!


    What finally worked:
    Download the jdk-7u60-ea-bin-b15-macosx-x86_64-16_apr_2014.dmg the 64 bit version mostly!
    All set and working!!

    Wednesday

    SeeTest - Launch iOSBridge automatically



    If you are automating your apps on seeeTest + iOS and you see that the iOS Bridge just goes blank and says disconnected. You know that your tests will not run as the prerequisite for any test to run is that you need to have the iOS Bridge running in the background.

    Solution: Manually launch iOS Bridge on your phone. But what if your devices are located on a remote system and cannot be accessed ??

    Solution:  Using the Runtime Application Manager mechanism

    The Application Manager is used primarily to install and instrument applications so that their Native and Web elements/objects can be used to test them .Applications are generally imported from the local disk of the tester's computer.
    1. Click on the 'Application Manager' button in SeeTest located under Applications on the left hand side corner. The icon looks like an import button
    2. The Application manager will then appear on your screen and you need to import the ipa file that is located in <SeeTest InstallationFolder>/bin/native folder. The ipa file is called LaunchAgent.ipa
    3. Once completed it will ask you to install the application
    4. then it would ask you to launch the application
    5. You can now launch the iOS Bridge remotely by either clicking on the icon to launch in SeeTest under applications
    6. In order to Launch an application in the script you can use the 'Launch' command                            Do not use: //client.launch("task:com.experitest.LaunchAgent", true, false);
    7. Use client.openDevice();
    Happy iOS Automation !




    Friday

    Working on iOS Testing and want to add to the classpath on OSX / Mac



    If you want to make a certain set of JAR files (or .class files) available to every Java application on the machine, then your best bet is to add those files to /Library/Java/Extensions.

    Or, if you want to do it for every Java application, but only when your Mac OS X account runs them, then use ~/Library/Java/Extensions instead.


    In OSX, you can also set the classpath from scratch like this:export CLASSPATH=/path/to/some.jar:/path/to/some/other.jar

    Or you can add to the existing classpath like this:export CLASSPATH=$CLASSPATH:/path/to/some.jar:/path/to/some/other.jar



    Happy iOS testing!

    Appium - Mobile test automation on a real device


    If you are looking to perform test automation on a real device (iPhone in my case) and you have had problems with the documentation on the official Appium website , the following post will help you for sure:

    Prerequisites: 

    1. Apple account with valid apple ID 
    2. Download and Install Eclipse on your Mac – A link that might help you with the installation process http://www.cs.dartmouth.edu/~cs5/install/eclipse-osx/
    3. Download and Install Xcode
    4. Download Selenium Jars for java from the Selenium website
    5. Download the java client libraries from http://appium.io/downloads.html
    6. Download and install appiumD
      1. download the latest version from Appium.io.
      2. Mount the disk image.
      3.  Drag Appium.app to your Applications folder
    7. Download and Install brew (The missing package manager for OS X)
      1. It's on the bottom of the Homebrew homepage. http://brew.sh/ (Yeah, it would be helpful if it was listed at the top, instead.)
      2. From a Terminal prompt:  ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
    8. Tip: (Optional) – Install Oh my zsh for a better shell experience https://github.com/robbyrussell/oh-my-zsh
    9. Your apple id has access to a valid iOS Developer portal


    Important points to note:

    1. Appium uses ‘Appium Inspector’ to view the elements similar to what we have as ‘uiautomatorviewer’ tool to view UI components in Android in UI Automator. You can access elements using name , xpath or tagName as visible through appium inspector
    2. Appium Inspector can be launched by clicking on the blue ‘i’ button besides ‘Launch’ button from appium app.
    Setup and Execution:

    The core of what most of the Appium help posts are missing:


    1. Find UDID of the iphone: http://www.innerfence.com/howto/find-iphone-unique-device-identifier-udid
    2. Turn on web inspector on iOS device (**settings > safari > advanced**, only for iOS 6.0 and up) http://appium.io/slate/en/master/?java#toc_80
    3. Note:1.       To be able to run your tests against mobile Safari we use the SafariLauncher App to launch Safari. Once Safari has been launched the Remote Debugger automatically connects using the ios-webkit-debug-proxy.
    4. Setup: Before you can run your tests against Safari on a real device you will need to:   Have the ios-webkit-debug-proxy installed, running and listening on port 27753 
    5. Note: When executing against a real iOS device appium is unable to access the web view directly. Therefore the connection has to be established through the USB lead. To establish this connection we use the ios-webkit-debugger-proxy. http://appium.io/slate/en/master/?java#toc_14
    6. To install the latest tagged version of the ios-webkit-debug-proxy using brew, run the following commands in the terminal:
      1.  ruby -e "$(curl –fsSL https://raw.github.com/mxcl/homebrew/go/install)"
      2. brew update
      3. brew install ios-webkit-debug-proxy
    7. Once installed you can start the proxy with the following command:
      1. Change the udid to be the udid of the attached device and make sure to set the port to 27753 as that is the port the remote-debugger uses:
      2. > ios_webkit_debug_proxy -c 0e4b2f612b65e98c1d07d22ee08678130d345429:27753 –
    8. On Mac                                    i.      Connect your device to your Mac.
    9.                                                              ii.      In the Devices organizer under Devices, select your device.
                                                                  iii.      Click the “Use for Development” or “Add to Member Center” button.
                                                                 iv.      If the device was previously used for development, the “Use for Development” button does not appear. If this happens, click “Add to Member Center” at the bottom of the window instead.
                                                                   v.      In the team dialog that appears, select the checkbox next to your account name, and click Choose.
                                                                 vi.      If a Certificate Not Found dialog appears, click Request.
    10. Create a provisioning profile that can be used to deploy the SafariLauncherApp.
    11. Create a new App Id and select the WildCard App ID option and set it to “*”
      2.       You can only create application IDs in the iOS developer portal. Once you're logged in, choose the "Certificates, Identifiers & Profiles" link:
      3.       On the next screen, choose the "Identifiers" option on the left:
      4.       Now you can click the "+" icon near the top right to create a new App ID:
      5.       The first thing you're asked to do is provide an App ID description:
      6.       Choose an App ID Suffix as “*”
      7.       Complete and submit to get a message – “This App ID is now registered to your account and can be used in your provisioning profiles
    12. Create a new Development Profile and for App Id select the one created in step 1.
      1.       Click on Add new Provisioning Profile
      2.       Choose iOS App Development option
      3.       for App Id select the one created in step 1.
      4.       Select your certificate(s) and device(s) and click next.
      5.       Set the profile name and generate the profile.
      6.       Download the profile and open it with a text editor.
    Make sure you either use XCode and install ios --real-safari –launcher on your device:
    1.                                                                i.      git clone https://github.com/appium/appium.git
                                                                   ii.      install npm using brew – brew install npm
                                                                  iii.      cd appium
                                                                 iv.      ./reset.sh --ios --real-safari –launcher
    2. If unable to install. Open the git project using XCode - build and run the installation
    ExecurtionExecution:
    Execution:
    1. Make sure you have a new terminal and run: ios_webkit_debug_proxy -c 0e4b2f612b65e98c1d07d22ee08678130d345429:27753 –d
    2. Open another terminal and start the appium server:                                                              
                                                                                      i.      cd appium
                                                                                     ii.      node . -U --app ‘safari’


    You are good to start writing your selenium webdriver scripts now




                                   Sample script in Java(JUnit 4)

    package com.test.appium;
    import java.net.URL;
    import java.util.Iterator;
    import java.util.Set;
    import org.junit.After;
    import org.junit.Before;
    import org.openqa.selenium.By;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.remote.DesiredCapabilities;
    import org.openqa.selenium.remote.RemoteWebDriver;
    public class FirstTestCase {
    public WebDriver driver = null;
    @Before
    public void setUp() throws Exception {
    // set up appium
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability("browserName","Safari");
    capabilities.setCapability("deviceName","iPhone");
    capabilities.setCapability("platformName","iOS");
    //capabilities.setCapability("udid","36d2a431a84fd87e95dcf87914a7c3df386b6d4b");
    capabilities.setCapability("version","7.1");
    System.out.println("Before App launched");
    driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
    System.out.println("App launched");
    }
    @After
    public void tearDown() throws Exception {
                  driver.quit();
    }
    @org.junit.Test
    public void testCases() throws InterruptedException {
    driver.get("https://test.com");
    Thread.sleep(5000);
    WebElement login = driver.findElement(By.xpath("//*[@class='login_button']"));
    login.click();
    int itr=2;
    String windowHandle=null;
    Set parentWindowHandle = driver.getWindowHandles(); // save the current window handle.
      Iterator windowIterator = parentWindowHandle.iterator();
      while(windowIterator.hasNext() && itr!=0) {
        windowHandle = windowIterator.next();
        itr=itr-1;
      }
      driver.switchTo().window(windowHandle);
      WebElement username = driver.findElement(By.xpath("//*[@id='username']"));
      username.sendKeys("testing");
    }
    }

    Wednesday

    How to create a new Apple APP ID and select the WildCard App ID option and set it to “*”



    An application ID uniquely identifies your iOS application within Apple's application services - enabling you to use things like in-app purchasing, push notifications, game center and more inside your app.
    You can only create application IDs in the iOS developer portal. So first you would need to log-in with a developers access.
    1. Once you're logged in, choose the "Certificates, Identifiers & Profiles" link
    2. On the next screen, choose the "Identifiers" option on the left
    3. Now you can click the "+" icon near the top right to create a new App ID
    4. The first thing you're asked to do is provide an App ID description (Just provide something descriptive enough for your needs)
    5. You have two options here. Pick the one that says - Wildcard App ID 
      1. Choose an App ID Suffix as “*”
    6. Select App Services if needed
    7. Complete and submit to get a message – “This App ID is now registered to your account and can be used in your provisioning profiles

    Appium: Fail could not start script target application is not frontmost


    I am guessing you are reading this post because you see this error even though you followed every single step religiously from the Appium API reference doc.

    We are or were in the same boat!

    First check

    1.  Have you started the ios-debug-webkit-proxy on port 27753 after connecting to the device ?
    2. Can you see the terminal where you started the  ios-debug-webkit-proxy showing pages that you navigate on your device
    3. If its started, can you connect to http://localhost:27753 on your local browser and browse the device and the pages currently active on the device ? This will ensure that appium is able to reach the device and talk to safari through the remote debugger
    4. Lastly your desktop Safari should also be running with Developer mode enabled. (Web inspector should be enabled)
    If you are still facing the same error after all the checks then we do what we do on windows:
    Close all prompts and restart the Mac and reconnect J

    You will now see that it works like a charm :) Happy Mobile Testing!

    Friday

    Check dependencies code sign error safarilauncher.app OR Could not read CFBundleIdentifier from Info.plist



    If you are working on Appium and you have followed these step to get an error

    Now that you have a profile open a terminal and run the following commands:
    Just cloned SafariLauncher Running Xcode version 5.1
    I entered my provisioning profile and my code signing identity
    Clicked build I got this error  error: could not read CFBundleIdentifier from Info.plist (null)
    Did a clean and rebuild but got the same error
    Did a clean and built from ./build.sh and got the same error

    Solution:
    Go to Xcode open the project
    1. Navigate to the Build Settings
    2. Change the Code Signing Identity with your name and iPhoneDeveloper
    3. Change the provisioning profile to the correct name 


    4.  Check if the Bundle Identifier isn't empty

    Wednesday

    Mobile Test Automation - iOS / Android / Windows + Real Device / Emulators + Instrumentation?


    I must admit that even though I was a test automation fanatic, in the past I had been running away from the mobile automation space. Finally the race is over and the obvious has happened, the mobile devices have won!

    I started playing around with tools that support iOS and android platforms and found that  there are quite a few out there.All with promising abilities but a lot of communication gap.
    Conclusion: Mobile automation is where Web automation was say 7-10 years back but with a more definitive approach. The good thing is that slowly but steadily there are communities building around them, but a few tools stand out as always.

    Note: Before I start off I would like to mention that the information here is based on trying to use these technologies firsthand and might not be 100 percent accurate. It is also based on various blogs, articles and websites that I read while evaluating the mobile testing frameworks and tools.



    My Verdict: 

    From my experience, automated testing for mobile devices has a long way to go.But there are tools like Appium and SeeTest that do what you need covering almost all platforms and having a good user community. It's just a matter of commercial v/s opensource that you would need to debate between the two tools and of-course SeeTest has a lot of promising features that seem to be really good!

    Happy Mobile Automation! You shall regularly see me posting about mobile testing now ;)

    Friday

    Here is what proves that OZ has a lot to offer in the testing space


    Aussie firm aims to build 10,000-strong software army

    Revolution IT banks on crowdsourcing to help win business.
    Australian software testing provider Revolution IT is hoping to turn 10,000 local software professionals into a pool of software testers-for-hire.
    Just as sites like 99designs have popularised a model where freelance graphic designers compete for work at basement prices, Revolution IT is adopting a similar approach.
    The CRN Fast50 entrant plans to invite thousands of local software testers and professionals to sign up for what it says is Australian's first managed onshore crowd testing service.
    By combining these people with a talent pool of 100,000 via overseas crowdsourcing partners, Revolution IT hopes to become the "biggest testing organisation" in the world, in the words of Revolution IT director Hamish Leighton.
    "This puts us on a globe scale, bigger than any other of the outsourcers. The pool of talent we can reach now is phenomenal."
    The sheer number of testers, as well as the price and speed, are key selling points.
    Leighton claims that projects that might take six months and cost up to $70,000 could be reduced to five to ten days at a maximum cost of $10,000.
    Testing can potentially be done across multiple operating systems and many devices without building software testing labs.
    Revolution IT has partnered with four crowdsourcing providers - 99tests, Bugfinders, Testbirds and Passbrains - customers of which, according to a presentation from Revolution IT, include the likes of Microsoft, Google and eBay as users. Locally, Allianz and ANZ are among those that have used crowdtesting.
    "We're seeing people using it for SAP and CRM… ServiceNow rollouts," said Leighton, who added that he has seen the approach used on projects costing more than $10 million.

    Continue to read at ...

    Source: http://www.crn.com.au/News/390433,aussie-firm-aims-to-build-10000-strong-software-army.aspx#ixzz397LAnlnN