Tuesday, 16 September 2014

Click Here to Download OpenWebsiteInBrowserUsingSeleniumWebDriver.zip

Note : If any runtime error occurred by running our downloaded project meaning of that your browser version and Selenium API DLL version is not matching. To resolve this issue you need to download latest Selenium C# API DLLs from this link and paste downloaded DLLs into 'Bin' folder of downloaded project. Or you can remove references of existing DLLs references and add new DLLs references. You can learn this thing from this link.

You can easily open any URL in browser automatically with selenium C# WebDriver. This is first and basic step of any WebSite testing and make to do automate WebSite running.

For this we are using 'Navigate' method and 'URL' property of WebDriver Browser class object.

Here you are learning open WebSite or URL with selenium C# WebDriver.

First, you need to create object of any browser in which you need to open WebSite or URL. You can create object of FireFox, Internet Explorer, Chrome, etc.

After creating object, you need call 'Navigate' method and then set WebSite URL which you need to open into 'URL' property.

Here is example for this.
In this example we are opening 'http://www.google.com' WebSite in FireFox web browser using selenium C# WebDriver.

In this example first we create object of FireFox driver after that, we need to call 'Navigate' method and then we need to set URL property with 'http://www.google.com'. So this code open the 'www.google.com' WebSite in FireFox web browser.

For sample page. Now we take one page and place one button name it like 'Open Website' and on click of button you need to write below code.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Selenium;
using OpenQA;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnOpenWebsite_Click(object sender, EventArgs e)
    {
        OpenQA.Selenium.Firefox.FirefoxDriver objFF = new OpenQA.Selenium.Firefox.FirefoxDriver();
        objFF.Navigate();
        objFF.Url = "http://www.google.com";
        
    }
}

Now, you can see in below images to open WebSite.

[Image : Click on 'Open WebSite' Button] : 

Selenium C# : How to Open Website or URL with selenium c# webdirver in ASP.Net website.
(To view original size image , click on image)

[Image : FireFox is open with 'http://www.google.com' website] : 

Selenium C# : How to Open Website or URL with selenium c# webdirver in ASP.Net website.
(To view original size image , click on image)



This same code is used to open WebSite in other web browser like Internet Explorer, Chrome, etc. Only you need to create object of that WebDriver.

Here are the links for How to open Internet Explorer and Chrome web browser.


Full Video : 



Friday, 12 September 2014

Wednesday, 10 September 2014

Click Here to OpenChromeBrowserUsingSeleniumWebDriverTool.zip

Note : If any runtime error occurred by running our downloaded project meaning of that your browser version and Selenium API DLL version is not matching. To resolve this issue you need to download latest Selenium C# API DLLs from this link and paste downloaded DLLs into 'Bin' folder of downloaded project. Or you can remove references of existing DLLs references and add new DLLs references. You can learn this thing from this link.

We can also open Chrome Browser programmatically using selenium C# 'WebDriver' API with ASP.Net C#.

In previous article we learned How to Open Internet Explorer and Firefox Browser using selenium 'WebDriver'.

For opening or launching Chrome is different from Open 'FF'. In that we need one extra EXE file named 'chromedriver.exe' file.

If you Do not have 'chromedriver.exe' file file at that time Code gives us an error like :
An exception of type 'OpenQA.Selenium.DriverServiceNotFoundException' occurred in WebDriver.dll but was not handled in user code.

Additional information: The chromedriver.exe file does not exist in the current directory or in a directory on the PATH environment variable. The driver can be downloaded at http://chromedriver.storage.googleapis.com/index.html.

Here are steps to learn How to Open Chrome Browser.

Friday, 5 September 2014

Click Here to Download OpenInternetExplorerWithSeleniumWebDriverTool.zip

Note : If any runtime error occurred by running our downloaded project meaning of that your browser version and Selenium API DLL version is not matching. To resolve this issue you need to download latest Selenium C# API DLLs from this link and paste downloaded DLLs into 'Bin' folder of downloaded project. Or you can remove references of existing DLLs references and add new DLLs references. You can learn this thing from this link.


We can also open Internet Explorer Browser programmatically using selenium 'WebDriver' API with ASP.Net C#.

In previous article we learned How to Open Firefox Browser using selenium 'WebDriver'.

For opening or launching Internet Explorer (IE) is different from Open FireFox. In that we need one extra EXE file named 'IEDriverServer.exe' file and also set 'IE' Options object to give Startup URL.

If you Do not have 'IEDriverServer.exe' file file at that time Code gives us an error like :
The IEDriverServer.exe file does not exist in the current directory or in a directory on the PATH environment variable.

But basically it is very simple.

Here are steps to learn How to Open IE Browser :

Tuesday, 2 September 2014

We can open FireFox Browser programmatically using selenium webdriver API with ASP.Net C#. Here you can Learn how to open Firefox browser using selenium webdriver with ASP.Net C#

STEP 1 : First you need to create empty 'Website' or in existing 'Website' or project you need to add selenium 'WebDriver' API DLL references.
You can visit this link to create new 'Website' and add selenium 'WebDriver'API DLL references.

Selenium Tool : Download selenium Webdriver for ASP.NET C#.
Selenium Tool : Configure selenium tool for asp.net C# website or project in Visual Studio.

Thursday, 28 August 2014

Element Locator Add-on is available in FireFox Browser as Add-on or extension. You can install it in FireFox browser.

Element Locator Add-on is very useful to find or locate appropriate web element or control like, text box, button, image, input box, etc. in browser. It will return location string of that particular control. This string is helpful in selenium automation process.

When you right click on particular control or element in Firefox browser, it will populate context menu with very useful XPATH for 'WebDriver' which is very useful in 'findElement' method of selenium 'WebDirver' API.

Here are steps to download and install 'WebDriver' element locator.

Tuesday, 26 August 2014

It is very easy to configure selenium tool for asp.net website or project.

We can configure selenium tool and it's DLL into Visual Studio by creating new 'website' or 'project' or in Existing 'website' or 'project'.

In previous article you can see the article of how to download selenium webdriver tool.

Here are some steps to configure selenium webdriver tool :

STEP 1 : Open Visual Studio like VS2010, VS2012 or VS2013
STEP 2 : Go to File menu and click on 'New Web Stite' Menu, Now it will open dialog box in that dialog box select 'Empty Web Site' template and give your website name in below text box. After that click on 'OK'. Now your website is created.