Selenium With .Net

Recently I had a chance to work with Selenium framwork. It is pretty easy to intrgrate automated testing into .net with Selenium. Also for project like web site scrapping and automated posting, can be easily developped with few lines of code. Following code lines will automate a web site login with use of selenium framework.

ISelenium selenium = new DefaultSelenium(seleniumServer, port, browser, website);
selenium.Start();
selenium.Open(ConfigLoader.Configurations.LoginPageUrl);
selenium.WaitForPageToLoad((ConfigLoader.Configurations.WaitingTime * 1000).ToString());
selenium.Type("ctl00_PageContent_UserName", ConfigLoader.Configurations.UserName);
selenium.Type("ctl00_PageContent_Password", ConfigLoader.Configurations.Password);
selenium.Click("ctl00_PageContent_OKButton__Button");
selenium.WaitForPageToLoad((ConfigLoader.Configurations.WaitingTime * 1000).ToString());

Comments

Popular posts from this blog

Embedding PowerBI with ASP.NET Core 2 and Angular(2,4,5)

Handling Exit Event of Console Application in C#

CSS text-overflow ellipsis in the beginning of the the text - Left Ellipsis using CSS in a Flex box