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 -

Repeating text within a document

Scenario: You have some text in a Word document that you’d like to repeat later in that document. You don’t want to write it twice (or more), and you’d rather not copy/paste it from the other location as that means that you’ll have to remember to maintain it in both places if there are changes. If another author takes over the document, they may not know that they have to update this text in two or more places if there are changes, either.

Solution: Bookmarks!

You assign a bookmark to the text you want to re-use, then insert a cross-reference to the bookmark text. Whenever you change the original text, you only need to update the fields in the document for the changes to apply to the second (or third) instance of that text.

Here’s how:

  1. Select the block of text you want to repeat later in the document. This text can be a phrase, one or more paragraphs, a bulleted list, a table, etc.
  2. Insert a bookmark for the selected text (Word 2007: Insert tab >Bookmark).
  3. Give the bookmark a meaningful name, click Add, then click OK.
  4. Go to the place in the document where you want to re-use the selected text.
  5. Insert a cross-reference (Word 2007: References tab > Cross-reference).
  6. Select Bookmark as the Reference Type, and Bookmark Text as the Insert option.
  7. Select the bookmark name you added in Step 3, then click Insert.
  8. Whenever you change any text in the original list, just click inside the other list, then press F9 to update it (or Ctrl+A then F9 to update ALL fields in the document).

thanks!

How to Create a Meeting Request from an E-Mail Message in Outlook 2007

Q. How to Create a Meeting Request from an E-Mail Message in Outlook 2007?

This might be the question to many of the old Outlook user who is still using Outlook 2007 version or older, that how to directly convert mail into a meeting request.

Recently due to company change, I moved from 2013 version to 2007, and for some reason I wanted to convert my mail into a meeting request but even after doing some research I didn't find any option on Outlook 2007 GUI but there is a small trick to convert mail into meeting request in Outlook 2007.. 

Quick tip to save time converting e-mail messages to meeting requests: 
  1. In Outlook 2007, Drag an e-mail message to the Date Navigator (the small calendar in the To-Do Bar). 
  2. A Meeting Request opens with the Subject line filled in and the e-mail message in the body. 
  3. Add more details to the meeting, and then click Invite Attendees, & send meeting request!
Please refer screenshots below for the reference - 


I hope this helps. Have a good day!

How to setup Selenium WebDriver with TestNG, JUnit, Maven & ReportNG in Eclipse

I have seen this question posted in many forums "How to setup Selenium WebDriver with TestNG" or just "How to setup Selenium WebDriver in Eclipse", and I have also seen many good articles suggesting step by step information on how to setup Selenium 2.0 (WebDriver) with Eclipse but never seen some directly providing Java project with all the details.

I have tried creating one simple setup which includes Eclipse and with Selenium 2.0 WebDriver Java project. Java project has following plug-ins installed, you can use them as per your requirements in your test automation project.

Zip includes following:
  1. Eclipse IDE for Java and DSL Developers - Downloaded it from eclipse.org, and it has following plugins already added.
    1. Maven 
    2. TestNG 6.1.
  2. Java project with following libs added in Maven pom.xml
    1. Selenium 2.0 (Java WebDriver) 2.44.0
    2. JUnit 3.8.1
    3. ReportNG 1.1.4 
    4. Guice 3.0
If you want to use some other eclipse version and if you want similar setup for that eclipse version then please let me know, I will be very happy to provide / build setup for you.

To Download SeleniumWebDriver_With_Eclipse.zip with all above mentioned plug-ins & Java Project, please click on below image.

How to change JRE version of your Java project in Eclipse

1. Open Eclipse and right click on your Java project, select "Properties"

2. Select "Java Build Path" and go to the "Libraries" tab as shown below.

3. Select the already available JRE library and click on "Edit" button present on right side. You will see one more new windows called "Edit Library" as shown 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 use ReportNG with TestNG for HTML Reporting

ReportNG is Open Source software, free to download and use subject to the terms of the Apache Software Licence, Version 2.0. 

ReportNG is a simple HTML reporting plug-in for the TestNGunit-testing framework. It is intended as a replacement for the default TestNG HTML report. The default report is comprehensive but is not so easy to understand at-a-glance. ReportNG provides a simple, colour-coded view of the test results. 

ReportNG generates 100% valid XHTML 1.0 files. The output can be customised by over-riding the default stylesheet with your own CSS file.

In this article we will learn how to integrate ReportNG with TestNG.

A. Before we start integrating ReportNG you will need three libraries as follows.

  1. reportng-1.1.4.jar
  2. velocity-dep-1.4.jar
  3. guice-3.0.jar
You have two options -
  1. Either download above three libraries and add manually to your class-path (in your eclipse or whatever IDE you will be using for your testing).
  2. Or add dependencies in Maven "pom.xml" file as shown below and build the project. I am not going to explain how maven works... I am assuming that whoever will be using 2nd option would know maven (this is the recommend option).
    <dependency>
        <groupId>org.uncommons</groupId>
        <artifactId>reportng</artifactId>
        <version>1.1.4</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.google.inject</groupId>
        <artifactId>guice</artifactId>
        <version>3.0</version>
    </dependency>

How to disable Auto save forms in Microsoft's Dynamics CRM 2013?

Q. How to disable Auto save forms in Microsoft's Dynamics CRM 2013?

Recently we have upgraded from Microsoft Dynamics CRM from 2011 to 2013 and first think that I have observed (apart from it's GUI redesign) about the form is, auto save functionality got added in 2013 DCRM and I didn't like it because it unnecessary saves the half filled form which intern makes unnecessary API calls to all other systems (if it is integrated with any other 3rd party or any other product module using Soap) which are going to fail as all the details present on the form is not complete.

I think many of you have also faced similar problem and also must have tried disabling it. Disabling Auto save is very simple.

1. Navigate to "Settings" menu from main "Microsoft Dynamics CRM" menu as shown in below screenshot.

2. Now click on "Administrator" sub menu present under "Settings" menu as shown in below screenshot.

Add Google search box to Navigation / Menu or at Page Widget in Blogger

I think everyone who wants to customize their blogs or want to design their blog templates, this tutorial would be helpful. In this tutorial I am going to show you how to add custom search box in Navigation / Menu Bar of your blogger template or at Page Widget as shown in below image.
1. First of all you need Custom Search Code/script similar to google search as shown below which you will get it from AdSense account. If you don't have adsense account, don't worry still you can add Google Custom search box. When you copy Search Box Code from your AdSense account, it will look like below.

As I mentioned before, those who don't have AdSense account can simply remove highlighted line and use it as it is in your blog.
2. Once you have custom search box script/code. Next task is to edit Blog Template. Before you make any changes to your original template, it is recommended to take backup of your template. (To Backup existing Template: Go to your Blog "Settings" > "Other" > Under Blog tools select "Import Blog").

3. Now go to "Settings" > "Template" and Click on "Edit HTML" button.

Microsoft Dynamics CRM 2011 Error: Sandbox Host - Access Denied.

Microsoft Dynamics CRM 2011 Error: Sandbox Host - Access Denied.

Have you guys got this error in Event Viewer of Microsoft Dynamics CRM server anytime while accessing Microsoft Dynamics CRM or while performing operations on DCRM?

I recently got this error when I was trying to perform some operation and could not able to complete that operation. That was because the user I was logged into DCRM didn't have logon permission in the Local Security Policy.

Here are the steps which you have to follow to resolve the issue.

  • In "Local Security Policies" added your DCRM user () under "Log-on as service".
  • From elevated command prompt execute following command: "SETSPN -a MSCRMSandboxService/ \" (the required SPN was not present earlier)
  • Reset CRMAppPool Application pool to restart the DCRM web-services.
  • Changed the "Log On As" for "Microsoft Dynamic CRM Sandbox Processing Service" to “\”  (It should not be "Network Service". I guess by default it is Network Service).
  • Re-start the service
  • Add  in web.config of CRM Web Site.. this is to get more details about the problem if this is still continuing.
I hope this helps. Please like my page on FB and share with your friends. Have a good day!

Thanks

Not able to download/open large size files from sharepoint (Sharepoint download Interrupted)?

I am not sure if you guys have ever experienced or currently experiencing problem downloading large files from SharePoint. Recently I faced same problem and found one simple solution to this problem.

Please follow simple steps on your computer to resolve this issue.
1. Open a Command prompt window as Administrator on a computer where you are trying to download large files from SharePoint.

2. Type and run following command.

netsh int tcp set global autotuninglevel=disable

3. Now try the downloading same large file again. Now you should be able to download/open file successfully.

 If you like my blog, please do comment and Hit a like button on Facebook!!

Happy downloading!! :)

How to run Command prompt always as Administrator in Windows

Q. How to run Command prompt always as Administrator in Windows?

Recently while working on one of the assignment on Windows server, I used to run command prompt always as Administrator. Every time I was following same old steps (i.e. Right click on command prompt short cut, then select "Run as Administrator" option). I didn't like it and then decided to find better option.

I tried couple of options and found one solution. Using it now whenever I run command prompt on my server it always runs as Administrator.

There might be many other options or solution to solve this problem but I found this one very simple and effective.

Steps to run Command Prompt always as Administrator are as follow:

1. Right click on the Command prompt shortcut and select "Properties" from the menu.












2. Go to "Shortcut Tab and click on "Advanced..." button




























Fingerprint Logon for Domain Users

Q. How to enable Fingerprint reader for Domain Users?

Today I enabled Fingerprint Reader for my Lenovo T430s laptop, after enrolling my fingers for the logon when I tried login to my laptop using one of my enrolled finger, It didn't work.. and I got below error message.

Error message dialog box:
Error message clearly says that for Domain Users we have to enable configuration in Biometric Device, and for that please follow below instruction.

1. Go to Control panel of your windows OS, and double click on "Biometric Devices" as shown in below screenshot.
2. Click on "Change biometric settings" link which is on the left side of the windows (shown in below screenshot).

Turn on or off drag-and-drop editing

Q. Why I can not drag cell contents in Excel sheet?

I have come across with similar problem many times in the past and for some reason I can't remember how to solve this problem. This time when I was working on data creation using Excel, the same problem occurs.

I tried searching on the web but didn't find even a single site where there is a reason mentioned clearly about why all of a sudden this happens.

Why this option gets disabled automatically in excel sheet ? Anyone of you know the reason this WHY then please share it...!

Current key (KeyType : CrmWRPCTokenKey) is expired. This can indicate that a key is not being regenerated correctly.

When we try to access any of the available DCRM organization on DCRM 2011, and if you see any of the below errors indicate that a key is not being regenerated correctly.  

Error message in Event Logs: Current key (KeyType : CrmWRPCTokenKey) is expired. This can indicate that a key is not being regenerated correctly.  

Error message while accessing Microsoft Dynamics CRM GUI:











How to Enable Hibernate option in Windows 8

Well, windows 8 boots so fast that we don't need Hibernate option but yes when you want to keep your all files opened while you are working so you can resume your work when you login next time then yes you need Hibernate option. 

I think Hibernate option doesn't come by default with Windows 8, and we will have to enable it manually. This is the same question everyone new Windows 8 user has, I was one of them and so including this steps for everyone who will be and who want to use Windows 8 with Hibernate option enabled.

1. Go to Power Options page as shown below. 

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 >

Remove Babylon Search which appears when we start Firefox


Q. How to remove Babylon Search which appears whenever I start Firefox?

Many of us face this problem, and then whenever we open Firefox/new Tab in firefox this Babylon search page appears. 

Babylon Search:










At the end of this post you will be able to remove and restore your default search engine.

Follow below simple steps.


  • In Firefox URL, type about:config and hit Enter. It will show you one warning message, just click on "I'll be careful, I promise!" button.
  • In the filter at the top, type: keyword.URL. You will see page like below.
  • Double click it and remove whatever's in there and replace it with http://www.google.com/search?q=

How to take entire oracle db schema backup

Q. How to take entire oracle schema backup in UNIX using terminal?

There are very few simple steps to take entire db schema backup.

1. Create one physical directory in your Unix node where you want to take backup.
mkdir /tmp/my_backup_dir
Give read/write/execute permission to this directory.
chmod 777  my_backup_dir
2. Now map this physical directory to one logical directory of oracle. For this step you have to login to the sqlplus terminal with DB admin access.
CREATE OR REPLACE DIRECTORY logical_dir as '/tmp/my_backup_dir'; 

How to send mail in VB .net using System.Net.Mail (SMTP)

In .net we have special namespace called System.Net.Mail. It contains classes used to send electronic mail to a Simple Mail Transfer Protocol (SMTP) server for delivery.

There are three main classes under this namespace.
MailMessage: This class represents the content of a mail message.
SmtpClient: This helps us to transmit emails to the SMTP host (Server) that we specify
Attachment: We all know what is attachment is, this class helps us to create mail attachments.

There are many methods and properties under these three classes.
If you want to know more about it then Click here.

In below post, I will be explaining you a simple and basic methods which we can use to send mails. Of-course later on if you want you can add some more advanced features to it.

1. We have to import below namespace first.

2. Create an object of SmtpClient class

Related Posts Plugin for WordPress, Blogger...
Powered by Blogger