Showing posts with label framework. Show all posts
Showing posts with label framework. Show all posts

Selenium WebDriver: Executing / Running UI Tests on a Remote Server


When do you need to run tests on remote servers -

    1. When your server doesn't have web browser and your tests need web browser to run successfully, in this case you will have to move to some other server which has web browser installed or run test remotely on the server where web browser is already installed.
    2. Or you want to run same test on different web browsers, which are installed on different remote servers having different Operating Systems in parallel.

There are different approaches to address above mentioned problems.

Either you can use RemoteWebDriver Server to solve first mentioned problem above (which will help you to run test on remote server) Or in both the cases you can use Selenium GRID.

Please find details below -

1. RemoteWebDriver Server

The RemoteWebDriver is composed of two pieces: a client and a server. The client is your WebDriver test and the server is simply a Java servlet, which can be hosted in any modern JEE app server. The server will always run on the machine with the browser you want to test. There are two ways to user the server: command line or configured in code.

a. Starting the Server from The Command Line
Once you have downloaded selenium-server-standalone-{VERSION}.jar place it on the computer with the browser you want to test. Then from the directory with the jar run the following

You can download 2.47.1 version directly or from here get the latest once (under Selenium Standalone Server section)

java -jar selenium-server-standalone-{VERSION}.jar

b. Once server is UP, you will see below message in your terminal window -

$ java -jar selenium-server-standalone-2.47.1.jar
23:04:53.282 INFO - Launching a standalone Selenium Server
23:04:53.619 INFO - Java: Oracle Corporation 25.60-b23
23:04:53.620 INFO - OS: Windows 7 6.1 amd64
23:04:53.628 INFO - v2.47.1, with Core v2.47.1. Built from revision 411b314
23:04:53.679 INFO - Driver class not found: com.opera.core.systems.OperaDriver
23:04:53.679 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
23:04:54.081 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
23:04:54.081 INFO - Selenium Server is up and running

c. Now try to connect to this server from your test, where you will be using RemoteWebDriver.
Please refer sample code below -

WebDriver is not able to find out WebElement present on Web Application

Recently came across one of the problem and I think it would be helpful to everyone if I share the details.

Problem Statement: WebDriver was not able to find out WebElement

I was using Firefox WebDriver, and in one of my test WebDriver was not able to find out Link / Image / Button for some reason.

HTML page Code look like below: I want to click on "New" link/image.

<div id="toolcontainer">
       <ul id="toollist">
              <li>
                     <a id="btnNewDash" title="New" onclick="javascript:$('#addTab').dialog('open'); return false;" href="#">
                            <span class="toollistimg"></span>
                            <span class="toollisttext"></span>
                        </a>
                 </li>
              <li></li>
          </ul>
   </div>

But when I use below code in my test, it didn't work... I tried following -

How to Hide Any Open Application Window during the Automation?




Q. How to hide Application Window during the automation?

During the development of my one of the projects I wanted to hide Firefox web browser window.

I was using HtmlUnitDriver to automate something but using it we cannot hide any web browser window, i did some research and some across one very good tool called AutoIt , It has all the capability to handle windows.

We can perform all kinds of operations using AutoIt.

Let me tell you how we can implement utility which can help us to Hide and again show any application window. Please follow below steps one by one.

1. You have to first install AutoIt, it is free. download from here

2. Open the Editor and write below code for Hiding any window.

Continue Reading >
Related Posts Plugin for WordPress, Blogger...
Powered by Blogger