Posts

Showing posts from 2012

How to take screenshot with Selenium Web driver using C#

Selenium web driver provides “Screenshot” class to take the screenshots. Screenshots are really helpful to trace the error after execution of selenium script. It can be saved at the specified location. Please find below code snippet for it. using OpenQA.Selenium.Firefox; using OpenQA.Selenium; using System.Drawing; using System.Drawing.Imaging; Public void Takescreenshot(IWebdriver _driver) { Screenshot ss;             ss=((ITakesScreenshot)_driver).GetScreenshot();             ss.SaveAsFile("Filename.png",ImageFormat.Png); }

Mobile Testing automation with Selenium Webdriver using firefox browser as emulator

Mobile application testing sounds interesting J but when comes to automate the testing process for mobile application it is bit different to other applications, mobile applications generally need to be tested on different manufactures devices which raises the question – How to automate test cases which can be executed on different type of devices. The answer is quite simple. Firefox supports the plugin -modify headers to emulate the behavior of any device. By using modify headers it can be simulated the behavior of any device .User can set the user agent to see the behavior of any device. I have used the Selenium Webdriver to automate the test cases and utilize the modify headers plugin to simulate the device behavior on Firefox by passing headers like useragent and mobile number as per the application requirement. Here is sample code snippet to implement it. The code is written in C# , you can implement in any language which supports selenium. Below is the method which pro...