Thursday, May 29, 2014

Selenium WebDriver test in C#

I was trying simple C# test by using Selenium. It is very simple to use and noticed that few changes. You should have NUnit, Visual Studio 2013 and Selenium DLLs. You can go through the links, which are available at the end of post.

Bing Search - Selenium Test - C# Code

using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using OpenQA.Selenium; using OpenQA.Selenium.Support; using OpenQA.Selenium.IE; using NUnit.Framework; namespace BingSearch { [TestClass] public class SearchTests { public static IWebDriver WebDriver; [TestInitialize] public void setupAppTest() { try { System.Console.WriteLine("Test setup started..."); InternetExplorerOptions ieOptions = new InternetExplorerOptions(); ieOptions.IntroduceInstabilityByIgnoringProtectedModeSettings = true; ieOptions.IgnoreZoomLevel = true; WebDriver = new InternetExplorerDriver(ieOptions); } catch (Exception ex) { System.Console.WriteLine("Exception Occured in Init @ " + ex.Source); } } [TestMethod] public void testBingSearch() { //Navigate to the site WebDriver.Navigate().GoToUrl("http://www.bing.com"); // Get Search text field info IWebElement query = WebDriver.FindElement(By.Name("q")); // Enter Search String query.SendKeys("Selenium"); // Submit the form query.Submit(); // Sleep for 5 seconds System.Threading.Thread.Sleep(5000); //Get all the links from result page System.Collections.ObjectModel.ReadOnlyCollection links = WebDriver.FindElements(By.TagName("a")); //Print all the links foreach (IWebElement link in links) { System.Console.WriteLine(link.GetAttribute("href")); } //Assert the title text Assert.AreEqual("Selenium - Bing", WebDriver.Title); } [TestCleanup] public void testCleanup() { // Cleanup activites WebDriver.Quit(); WebDriver.Dispose(); System.Console.WriteLine("Test cleanedup & completed successfully.."); } } }


Below links might be useful to make setup to execute the Selenium tests.
How To - Setup C#, NUnit, Selenium
Capturning Screenshots

Wednesday, May 28, 2014

Top 5 Requirements for test automation tool

Recently there is an interesting discussion about top five requirements. Expectations are varied in group and few interesting thoughts...

Priorities for Advanced automation tool

  1. Robust Hybrid (Keyword driven+ Data Driven, etc) framework - None of the tool vendors are giving the libraries for Keyword driven Framework
  2. Language and OS independent - Should support multiple languages or libraries developed from multiple languages. Also tests should able to run in different type of OS. If I look test automation for past 15 years, tools are started to support multiple languages in last 6 years.
  3. Multi-browser and Multi-device support. For Mobile & Table support, tool should be lightweight app. Should use less storage for installation and less memory for execution.
  4. Ability to hook/hack custom object through programming or libraries
  5. Support for Continuous Integration tools - Automatically Should be able to deploy the build and then initiate the test suites and sent the report through email or SMS or any other devices.


To see few more experts answers - Discussion - What are the top five requirements for a test automation tool?

Tuesday, May 27, 2014

Share photos from XBOX play

Kinect Sports, Kinect Adventures, and Kinect JoyRide Games have functionality to upload pictures taken during game play. The pictures load to KinectShare.com. In the games there is a Remember and Share style section, where you can look at the pictures that were taken. From there you can select which items you would like to upload.

The pictures on KinectShare are only accessible from your Microsoft (Hotmail/Live/Outlook) login and are only stored for 14 days. They can be shared to Facebook or other social network site from there. They can also be removed from KinectShare.com (such as, as soon as you get the Achievement....)


Change your privacy settings to allow Kinect Sharing

  1. On your console, sign in using your Xbox LIVE gamertag.
  2. Go to Settings, then select Privacy
  3. Select Change Settings
  4. Select Customize
  5. Select Kinect Sharing.
  6. Select Allowed or Blocked. Allowed: You can upload and share photos and videos using websites and services such as KinectShare.com, Blocked: Photos and videos cannot be uploaded and shared on photo-sharing websites and services.
  7. Press B on your controller
  8. Select Save and Exit.


Steps to Upload photos

  1. Enable Internet connection through Wi-fi in XBOX Console
  2. Get the Pictures from games
  3. Go to the photos menu and choose which photos/statues you want to upload
  4. Uploaded to www.kinectshare.co
  5. Go to kinectshare.com, Login and you can see your photos
  6. You can download the pictures and share it