Friday, 5 September 2014

Selenium C# : How to Open Internet Explorer Browser using selenium webdriver with ASP.Net C#

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 :


STEP 1 : First create new 'WebSite' after creating new 'WebSite' add new page. On this previous article your learn this.

STEP 2 : Now, you need special Executable (EXE) file named "IEDriverServer.exe". You can download this file from this URL :
http://selenium-release.storage.googleapis.com/index.html. You can choose latest version folder on this link. Or you can also get this file from our project zip file, In our project we have both 32 and 64 bit zip file. You can get that file from zip file.

STEP 3 : After downloading file, Add new folder in your website or project named it 'EXEFiles' and copy your downloaded file 'IEDriverServer.exe' in this folder.

STEP 4 :  Open your new page code file like 'Default.aspx.cs' file. Import selenium 'namespaces' and write following code on 'Open Internet Explorer Browser' button click event.

Code File :
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 btnOpenIEBrowser_Click(object sender, EventArgs e)
    {
        string STR_IE_DRIVER = Server.MapPath("EXEFiles"); //Set Path for EXE file

        var objIEOptions = new OpenQA.Selenium.IE.InternetExplorerOptions() // Set Options
        {
            InitialBrowserUrl = "www.google.com",
            IntroduceInstabilityByIgnoringProtectedModeSettings = true
        };

        //Create object for open IE
        OpenQA.Selenium.IE.InternetExplorerDriver objFF = new OpenQA.Selenium.IE.InternetExplorerDriver(STR_IE_DRIVER, objIEOptions);
    }
}

Explanation : In this code you can see that First we set path of 'IEDriverServer.exe' file, in which folder we save this file. After that, we create object of 'InternetExplorerOptions' class and set properties like 'InitialBrowserUrl' and 'IntroduceInstabilityByIgnoringProtectedModeSettings'.

This 'InitialBrowserUrl'  property use for By default when IE open this URL is open in IE. After that, we create object of 'InternetExplorerDriver' class to open IE. You can see that in constructor of 'InternetExplorerDriver' class we supply 'IE_DRIVER' Path and 'IE OPTION' object.

STEP 5 : Run the website. After Default page is appeared in browser, this website may run in any browser. You click on 'Open Internet Explorer Browser' button. It will Open Internet Explorer Successfully.

[Image : Run Website and open Page] :

Selenium C# : How to Open Internet Explorer Browser using selenium webdriver with ASP.Net C#
(To view original size image , click on image)

[Image : Internet Explorer Opened] :

Selenium C# : How to Open Internet Explorer Browser using selenium webdriver with ASP.Net C#
(To view original size image , click on image)


Full Video : 



67 comments:

  1. really well said about How to Open Internet Explorer Browser using selenium webdriver with ASP.Net C# keep share interesting article on selenium

    Selenium Training Institute in Chennai

    ReplyDelete
    Replies
    1. The effectiveness of IEEE Project Domains depends very much on the situation in which they are applied. In order to further improve IEEE Final Year Project Domains practices we need to explicitly describe and utilise our knowledge about software domains of software engineering Final Year Project Domains for CSE technologies. This paper suggests a modelling formalism for supporting systematic reuse of software engineering technologies during planning of software projects and improvement programmes in Final Year Projects for CSE.

      Software management seeks for decision support to identify technologies like JavaScript that meet best the goals and characteristics of a software project or improvement programme. JavaScript Training in Chennai Accessible experiences and repositories that effectively guide that technology selection are still lacking.

      Aim of technology domain analysis is to describe the class of context situations (e.g., kinds of JavaScript software projects) in which a software engineering technology JavaScript Training in Chennai can be applied successfully

      The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

      Delete
  2. Great article!!!!!This is very important information for us.I like all content and information.I have read it.You know more about this please visit again. Best Hadoop Training | Hadoop Online Training

    ReplyDelete
  3. Nice information about test automation tools my sincere thanks for sharing post Please continue to share this post..


    Weblogic Server 12cR2 Training

    ReplyDelete
  4. Thanks you for nice article.
    if you want to know the technologies updates,visit below site.
    Dot Net Tutorial for Beginners with Examples

    ReplyDelete

  5. Very Helpful Post And Explained Very Clearly About All the things.Very Helpful. Coming To Our Self We Provide Food Service Parts Through Out US At Very Affordable Prices And Also We Offer Same Day Shipping In US.We Offer Only Genuine Products.Really Thanks For Posting.

    ReplyDelete
  6. Thankful for the Informative Post The Best article, Bala Guntipalli

    ReplyDelete
  7. This Blog is very helpful and useful,came to know that i should be strong in my basics and this blog helps me to improve it,Chicago Immediate Care Services Provided by Us.Thanks For Posting.I Am refereed by my friend to this blog and i also want to refer my other friends to this blog.Really Thanks for posting such an informative post and thanks for sharing such knowledgeable posts.

    ReplyDelete
  8. This Blog Provides Very Useful and great Information. United States Medical Licensing Examination Thanks for sharing.

    ReplyDelete
  9. I found your blog while searching for the updates, I am happy to be here. Very useful content and also easily understandable providing.. Believe me I did wrote an post about tutorials for beginners with reference of your blog. 
    Devops training in velachry
    Devops training in OMR
    Deops training in annanagar
    Devops training in chennai
    Devops training in marathahalli
    Devops training in rajajinagar
    Devops training in BTM Layout


    ReplyDelete
  10. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.
    Data science training in velachery
    Data science training in kalyan nagar
    Data Science training in OMR
    Data Science training in anna nagar
    Data Science training in chennai
    Data Science training in marathahalli
    Data Science training in BTM layout
    Data Science training in rajaji nagar

    ReplyDelete
  11. Nice tutorial. Thanks for sharing the valuable information. it’s really helpful. Who want to learn this blog most helpful. Keep sharing on updated tutorials…

    java training in annanagar | java training in chennai

    java training in marathahalli | java training in btm layout

    java training in rajaji nagar | java training in jayanagar

    ReplyDelete
  12. This comment has been removed by the author.

    ReplyDelete


  13. Nice post. By reading your blog, i get inspired and this provides some useful information. Thank you for posting this exclusive post for our vision.

    angularjs-Training in annanagar

    angularjs Training in chennai

    angularjs Training in chennai

    angularjs Training in bangalore

    ReplyDelete
  14. myTectra Placement Portal is a Web based portal brings Potentials Employers and myTectra Candidates on a common platform for placement assistance

    ReplyDelete
  15. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.
    python training in OMR
    python training in tambaram
    python training in annanagar

    ReplyDelete
  16. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.

    rpa training in velachery| rpa training in tambaram |rpa training in sholinganallur | rpa training in annanagar| rpa training in kalyannagar

    ReplyDelete
  17. Amazing article. Your blog helped me to improve myself in many ways thanks for sharing this kind of wonderful informative blogs in live. I have bookmarked more article from this website. Such a nice blog you are providing ! Kindly Visit Us @ Best Travels in Madurai | Tours and Travels in Madurai | Madurai Travels

    ReplyDelete
  18. Thanks for Sharing this great article..Its really nice and useful for us… keep sharing..
    DevOps Training In Hyderabad

    ReplyDelete
  19. This comment has been removed by the author.

    ReplyDelete
  20. This comment has been removed by the author.

    ReplyDelete
  21. The article is so appealing. You should read this article before choosing the Big data app development you want to learn.

    ReplyDelete
  22. The article you have shared is very useful. Selenium Testing is also talk of the town in today's digital world. So its very important to know and understand how we can open Internet Explorer Browser programmatically using selenium 'WebDriver' API with ASP.Net C#. All the guidelines and screenshots you have shared is really useful for all the information seeker who wants to know how it works. Thanks for sharing and keep posting like this.

    ReplyDelete
  23. Thanks for this blog are sharing information.

    7 tips to start a career in digital marketing

    “Digital marketing is the marketing of product or service using digital technologies, mainly on the Internet, but also including mobile phones, display advertising, and any other digital medium”. This is the definition that you would get when you search for the term “Digital marketing” in google. Let’s give out a simpler explanation by saying, “the form of marketing, using the internet and technologies like phones, computer etc”.

    we have offered to the advanced syllabus course digital marketing for available join now.

    more details click the link now.

    https://www.webdschool.com/digital-marketing-course-in-chennai.html

    ReplyDelete
  24. Amazing article useful information.

    Web designing trends in 2020

    When we look into the trends, everything which is ruling today’s world was once a start up and slowly begun getting into. But Now they have literally transformed our lives on a tremendous note. To name a few, Facebook, Whats App, Twitter can be a promising proof for such a transformation and have a true impact on the digital world.

    we have offered top the advanced syllabus course web design and development for available join now.

    more details click the link now.

    https://www.webdschool.com/web-development-course-in-chennai.html

    ReplyDelete
  25. We provide you with flexible services and complete hybrid network solutions. It can provide your organisation with exceptional data speeds, advanced external security protection, and high-resilience by leveraging the latest SD-WAN and networking technologies to monitor, manage and strengthening your organisation’s existing network devices.

    https://www.quadsel.in/networking/
    https://twitter.com/quadsel/
    https://www.linkedin.com/company/quadsel-systems-private-limited/
    https://www.facebook.com/quadselsystems/

    #quadsel #network #security #technologies #managedservices #Infrastructure #Networking #OnsiteResources #ServiceDeskSupport #StorageServices #WarrantyAMCServices #datacentersolutions #DataCenterBuild #EWaste #InfraConsolidation #DisasterRecovery #NetworkingServices #ImagingServices #MPS #Consulting #WANOptimisation #enduserservices

    ReplyDelete
  26. good
    https://www.kaashivinfotech.com/best-final-year-project-in-information-technology/

    ReplyDelete
  27. nice

    https://www.kaashivinfotech.com/best-final-year-project-in-information-technology/

    ReplyDelete
  28. I found your blog while searching for the updates, I am happy to be here. Very useful content and also easily understandable providing.. Believe me I did wrote an post about tutorials for beginners with reference of your blog.

    DevOps Training in Chennai

    DevOps Course in Chennai

    ReplyDelete
  29. Thanks, this is generally helpful.
    Still, I followed step-by-step your method in this
    dot net online training
    dot net online course

    ReplyDelete
  30. Thank you for posting informative insights, I think we have got some more information to share with! Do check out Python Training In Chennai and let us know your thoughts. Let’s have great learning!

    ReplyDelete
  31. Sharing the same interest, Infycle feels so happy to share our detailed information about all these courses with you all! Do check them out
    big data training in chennai & get to know everything you want to about software trainings.

    ReplyDelete