Click Here to OpenChromeBrowserUsingSeleniumWebDriverTool.zip
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 :
Here are steps to learn How to Open Chrome Browser.
STEP 1 : First create new 'WebSite', after creating new 'WebSite' add selenium webdriver dll and also add new page. On this previous article your learn this.
STEP 2 : Now, you need special Executable (EXE) file named "chromedriver.exe". You can download this file from this URL : http://chromedriver.storage.googleapis.com/index.html. You can choose latest version folder on this link. Or you can also get this file from our project by downloading project source code.
STEP 3 : After downloading file, Add new folder in your 'website' or project, named it 'EXEFiles' and copy your downloaded file 'chromedriver.exe' in this folder.
STEP 4 : Open your new page code file. Import selenium 'namespaces' and write following code on 'Open Chrome Browser' button click event.
Code File :
Explanation : In this code you can see that First we set path of 'chromedriver.exe' file, in which folder we save this file. After that, we create object of 'ChromeDriver' class to open Chrome browser, which exist in 'OpenQA.Selenium.Chrome' namespace. You can see that in constructor of 'ChromeDriver' class we supply 'CHROME_DRIVER' Path.
STEP 5 : Run the website. After Default page is appeared in browser, this website may run in any browser. You click on 'Open Chrome Browser' button. It will Open Chrome Successfully.
[Image : Run Website and open Page] :
[Image : Chrome Browser Opened] :
Full Video :
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.
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.
STEP 1 : First create new 'WebSite', after creating new 'WebSite' add selenium webdriver dll and also add new page. On this previous article your learn this.
STEP 2 : Now, you need special Executable (EXE) file named "chromedriver.exe". You can download this file from this URL : http://chromedriver.storage.googleapis.com/index.html. You can choose latest version folder on this link. Or you can also get this file from our project by downloading project source code.
STEP 3 : After downloading file, Add new folder in your 'website' or project, named it 'EXEFiles' and copy your downloaded file 'chromedriver.exe' in this folder.
STEP 4 : Open your new page code file. Import selenium 'namespaces' and write following code on 'Open Chrome 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 btnOpenChrome_Click(object sender, EventArgs e) { string STR_DRIVER_PATH = Server.MapPath("EXEFiles"); OpenQA.Selenium.Chrome.ChromeDriver objCD = new OpenQA.Selenium.Chrome.ChromeDriver(STR_DRIVER_PATH); } }
Explanation : In this code you can see that First we set path of 'chromedriver.exe' file, in which folder we save this file. After that, we create object of 'ChromeDriver' class to open Chrome browser, which exist in 'OpenQA.Selenium.Chrome' namespace. You can see that in constructor of 'ChromeDriver' class we supply 'CHROME_DRIVER' Path.
STEP 5 : Run the website. After Default page is appeared in browser, this website may run in any browser. You click on 'Open Chrome Browser' button. It will Open Chrome Successfully.
[Image : Run Website and open Page] :
![]() |
(To view original size image , click on image) |
[Image : Chrome Browser Opened] :
![]() |
(To view original size image , click on image) |
Full Video :
Hello,
ReplyDeleteIs it possible to run this once published on server?
I tried but wihout any luck. It just spins whn press the button.
Thank you!
I am glad that I saw this post. It is informative blog for us and we need this type of blog thanks for share this blog, Keep posting such instructional blogs and I am looking forward for your future posts. Python Projects for Students Data analytics is the study of dissecting crude data so as to make decisions about that data. Data analytics advances and procedures are generally utilized in business ventures to empower associations to settle on progressively Python Training in Chennai educated business choices. In the present worldwide commercial center, it isn't sufficient to assemble data and do the math; you should realize how to apply that data to genuine situations such that will affect conduct. In the program you will initially gain proficiency with the specialized skills, including R and Python dialects most usually utilized in data analytics programming and usage; Python Training in Chennai at that point center around the commonsense application, in view of genuine business issues in a scope of industry segments, for example, wellbeing, promoting and account. Project Center in Chennai
DeleteThis is really informative article for new learner. Author explained all the things very nicely in this article and everyone can easily understand it. Really appreciated
ReplyDeleteNow buffalo website design service is available from Crystal Tech Solution in a professional way.
Good creation and thanks for sharing
ReplyDelete.Net Online Course
myTectra Placement Portal is a Web based portal brings Potentials Employers and myTectra Candidates on a common platform for placement assistance
ReplyDeletenice blog thanks for sharing this message
ReplyDeleteaws training center in chennai
aws training in chennai
aws training institute in chennai
best angularjs training in chennai
angular js training in sholinganallur
angularjs training in chennai
azure training in chennai
nice message thanks for sharing this information
ReplyDeletedata science training in bangalore
data science classroom training in bangalore
best training institute for data science in bangalore
best data science training institute in bangalore
data science with python training in bangalore
best data science training in bangalore
best tableau training institutes in bangalore
I learned World's Trending Technology from certified experts for free of cost. I Got a job in decent Top MNC Company with handsome 14 LPA salary, I have learned the World's Trending Technology from python training in btm layout experts who know advanced concepts which can help to solve any type of Real-time issues in the field of Python. Really worth trying instant approval blog commenting sites
ReplyDelete
ReplyDeleteyour post is really very interesting to read. I got Very valuable information from your blog.
Best Python Training in BTM Layout
Thanks for sharing your innovative ideas to our vision. I have read your blog and I gathered some new information through your blog. Your blog is really very informative and unique. Keep posting like this. Awaiting for your further update.If you are looking for any Data science related information, please visit our website Data science training institute in bangalore
ReplyDeleteThanks for sharing this blog.
ReplyDeleteBranding Agencies In Coimbatore
Best Website Development Company in Coimbatore
Best Search Engine service provider in Coimbatore