Posts

Appium execution on real devices USB /WiFi

1       Execution on real devices using USB - Assume all the below Prerequisites are installed and configured :- 1. JDK should be installed 2. Android should be installed and path should be setup in your machine 3. Appium should be installed. 4. Configure Device with Developer Mode option enabled In order to   run Appium test cases on real devices, we need to connect real android device to PC by enabling USB debugging mode.To test on a real device or on on a simulator, we need SDK to be installed on your machine. Appium will take the advantage of the SDK to connect to the real device connected via USB or simulator. First Enable Developer Option, To enable Developer Option in android device, Click on Settings and find out ‘About Phone’ option. Follow below steps – Step 1   : Click on About Phone option Step 2   : Click on Version Information Step 3   : Now you will find an option called ‘Build Number’. Step 4   : Keep clicking Build number option for seven

Download and validate file using webdriver,wget

Image
Downloading Files WebDriver has no capability to access the Download dialog boxes  presented by browsers when you click on a download link or button. However, we can bypass these dialog boxes using a separate program called "wget". What is Wget? Wget is a small and easy-to-use command-line program used to automate downloads . Basically, we will access Wget from our WebDriver script to perform the download process.   Setting up Wget Step 1 In your C Drive, create a new folder and name it as "Wget". Download wget.exe  here  and place it in the Wget folder you created from the step above. Step 2 Bring up the System Properties window by pressing Win + Pause on your keyboard. Click on "Advanced System Settings" Click on the "Environment Variables". Step 3 In the Environment Variables dialog box, in the "System variables" section, scroll down the list until you find "

How To Highlight Locators In WebDriver Test Cases

It's likely that you'll run into odd test behavior that makes you question the locators you're using in a test. But how do you interrogate your locators to make sure they are doing what you expect? By leveraging some simple JavaScript and CSS styling, you can highlight a targeted element on the page so you can visually inspect it to make sure it's the one you want. import org.junit.After ; import org.junit.Before ; import org.junit.Test ; import org.openqa.selenium.WebDriver ; import org.openqa.selenium.By ; import org.openqa.selenium. JavascriptExecutor ; import org.openqa.selenium.WebElement ; import org.openqa.selenium.firefox. FirefoxDriver ; public class HighlightElement { WebDriver driver ; JavascriptExecutor js ; @Before public void setUp () throws Exception { driver = new FirefoxDriver (); js = ( JavascriptExecutor ) driver ; } @After public void tearDown () throws Exce

Hybrid and Native Apps ?

The moment you consider investing in a mobile app, you’re immediately faced with a barrage of terminology. What’s the difference between iOS and Android? What are native, hybrid and web apps? More importantly, which is most appropriate for your and your app? 
 Native Apps Native apps are what typically springs to mind when you think of an app. You download them from the App Store or Google Play, they sit within your device’s applications and you launch them by tapping their icon. Developing Native Apps Each mobile platform offers developers their own development tools, interface elements and standardised SDK. This should enable any professional developer to develop a native app relatively easily. There are a number of advantages to writing apps in this way: •    They offer the  fastest, most reliable and most responsive experience to users . •    They can tap into the wider functionality of the device; including the camera, microphone, compass, accelerometer a

How To Access Basic Auth with Selenium

The Problem Sometimes you'll work with applications that are secured behind  Basic HTTP Authentication  ( Basic Auth). In order to access them you'll need to pass credentials to the site when requesting a page. Otherwise you'll get a system level pop-up prompting you for a username and password -- rendering Selenium helpless. Before Selenium 2 we were able to accomplish this by injecting credentials into a custom header. But now the cool kid way to do it it was something like  BrowserMob Proxy . Some people are solving this with browser specific configurations too. But all of this feels heavy. Instead, let's look at a simple approach that is browser agnostic and quick to setup. A Solution By specifying the username and password  in the URL  when visiting a page with Selenium, we can a side-step the system level dialog box from Basic Auth and avoid the need to set up a proxy server. This approach will work for both HTTP or HTTPS pages. Let's take a look