Back To Normal

Subscribe To Our E-Mail Newsletter

Friday, October 30, 2015

Appium setup and Installation

Android Frameworks Overview



Android Instrumentation Framework:
  •  Instrumentation methods will helpful to control the components in the android devices.
  • This framework is built on top of the JUNIT and its a standard test framework for any Java application.
  • Mock objects, methods for creating mock systems objects to either stubbing other component dependency or simulating the process.
  • Instrumentation Test Runner the primary plumbing for running the test on android.
  • Pros: Its helps to run the test on isolated ways in a white box manner.
Robotium
  • Open source library extending Junit with plenty of useful methods for Android Ui testing
  • Powerful and robust automatic black box test cases for Android apps.
  • Supports native, hybrid and mobile web testing
  • And its extension the solo frameworks
    • Automatic scaling x,y.
    • Multipath drags
    • Automatic screen shots.
    • Mock location
    • Changing the device language
    • Control wifi connection.
Calabash
  • Behavior driven test framework for native Android, native iOS and mobile web.
  • Tests are described in Cucumber and then converted to Robotium or Frank at run time.
  • Supports currently about 80 natural language commands(controllers)
  • New controllers can be implemented in Ruby or Java.
  • Command Line Inspector for finding right UI element name/ids.
  • Web view support is implemented with Java script injection on to be web view.
UI Automator.

  • Googles test framework for testing the native android apps across device.
  • Works only on Android API level greater than 16.
  • Run Junit Testcases with special privileges.



Appium Installation Guide:
http://vijayaragavang.github.io/appium.github.io/

Presentation: https://speakerdeck.com/vijayaragavang/mobile-automation-framework-for-android

Final



Read More


Wednesday, May 13, 2015

Code searching tools: ag

ag is a code-searching tool, similar to awk and grep and its mainly used to searching large trees of source code. it requires perl to run and portable with any platform. 
     Other tools : https://github.com/petdance/ack2
Read More


Friday, May 8, 2015

Selenium and Webdriver waits


Here, I have listed all waits methods which is used in selenium web driver. It's helpful to eliminate  the random failures from your test suites.

Implicit waits
Selenium execution will wait for a specified time period to load the DOM elements.After that it will check the presence of web elements in the DOM, if not then throw errors. 
 Example: driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS)

Explicit waits:
Selenium execution will wait for a specified time period to load the locator and it will check the condition every 500ms.
Wait  wait = new WebDriverWait(driver, 30);
WebElement element= wait.until(visibilityOfElementLocated(By.id(“locator")));

Web driver waits 
There is a default web driver waits to check the presence, visibility, clickable and invisible and it will check the condition every 500ms.
Wait  wait = new WebDriverWait(driver, 20);
wait.until(ExpectedConditions.invisibilityOfElementLocated(locator));
wait.until(ExpectedConditions.presenceOfElementLocated(locator));
wait.until(ExpectedConditions.elementToBeClickable(locator));
wait.until(ExpectedConditions.visibilityOfElementLocated(locator));

Fluent wait:
If you want to check the presence of the web element in a specific time interval for maximum limit.
  For Example: it waits until the element with id “100" is found. If the element is not found, retry every 5 seconds. But wait only up to a maximum of 60 seconds.
Wait wait = new FluentWait(driver) .withTimeout(60, SECONDS) .pollingEvery(5, SECONDS) .ignoring(NoSuchElementException.class); WebElement foo = wait.until(new Function() { public WebElement apply(WebDriver driver) { return driver.findElement(By.id("id100")); }

Wait for Ajax calls in capybara. This will helpful to wait until all ajax calls completion.
def wait_for_ajax count = Capybara.default_wait_time * 10 actual_count = 0 count.times do break if page.evaluate_script 'window._ajax_sent == window._ajax_completed' actual_count += 1 sleep 0.1 end fail 'wait_for_ajax timed out! Please check for javascript errors in the context of the test!' if actual_count>= count end
Read More


Saturday, March 7, 2015

Challenges in Webdriver Selenium

Web driver is a library which will allow the user to interact with the browser. Tester always thinks, it's a tool will qualify to automate entire component of web applications.
In general,web driver doesn’t have any libraries to automate all components of web applications.
    Common problems in test automation:
  • Windows objects like save,download,import,export dialog boxes.
  • Switching between windows
  • Web driver doesn’t automate Flash, silver light and charts.
  • Handling Popup/Dialog Windows
  • Handling Hidden objects 
  • Triggering event after setting values.
  • Object Repository or Page object model support.

Handling hidden object and triggering event after setting values.       

         If you are not able to click hidden element on page, then write java script to click the element in browser. I have faced similar issue in my project, after setting value in text box , its not triggering event. Due to that, test were randomly getting failed in CI. When test run in foreground then its getting passed or else failed.      
        I have tried to solve this problem in many ways , using tab keys ,enter keys but nothing worked out. Finally rewritten script in java script to focus out the element after setting values. To click any Hidden element  or event trigger , don’t depend on web driver library better write in java script.    

To click Hidden object      
 JavascriptExecutor js = (JavascriptExecutor)driver;  
 js.executeScript("arguments[0].click();", element);

Trigger event.      
  page.execute_script("$('table.list_price').focusout()”)

Windows objects like save,download,import,export dialog boxes  

        If you are developing and running scripts in windows, then use VBscript ,WSH and Autoit to handle dialog boxes in windows platform. For manipulating excel and handling text files, use VBscript handles.

Switching between windows   
Find details in my previous post: http://automationhints.blogspot.in/2012/05/how-to-identify-popup-window-in.html

Web driver doesn’t automate Flash, silver light and charts. 
 https://code.google.com/p/wipflash/ : Flash based applications
  http://teststack.net/White/ : silver light
  UI Automation : For all .net based applications  

Image comparison : http://www.imagemagick.org/

Object Repository or Page object model support.      
 Java based Framework : PageFactory      
 Ruby on rails : siteprism, capypage.

Read More


560 Free Online Courses

Top 200 universities launched 500 free online courses.  Please find the list here .