Writing simple code with Coypu for Selenium C# (contd)
In the last post we discussed how to write a super simple code with Coypu for Selenium C#, an advanced wrapper for Selenium automation testing tool.
We discussed how to reference coypu in Visual studio project, setting sessionConfiguration class, BrowserSession class and finally working with some controls like Textbox and button.
In this post, we will be writing code further more for some other controls like
Drop down list box
Check box
Option button
Here is the complete video of the above discussion
Here is the complete code from the above video
[TestMethod]
public void Test_NormalFormFill()
{
var sessionConfiguration = new SessionConfiguration()
{
Browser = Browser.Firefox,
AppHost = "executeautomation.com",
};
var browser = new BrowserSession(sessionConfiguration);
browser.Visit("/demosite/Login.html");
browser.FillIn("UserName").With("admin");
browser.FillIn("Password").With("password");
browser.ClickButton("Login");
//Select title
browser.Select("Ms.").From("TitleId");
//Type Initial
browser.FillIn("Initial").With("KK");
//First Name
browser.FillIn("FirstName").With("Karthik");
//Middle Name
browser.FillIn("MiddleName").With("Mi");
//Gender
browser.Choose("female");
//Languge Known
browser.Check("Hindi");
//Save button
browser.ClickButton("Save");
}
Thanks for reading the post and watching the video!!!
Please leave your comments and let me know if there is anything I should update in this post.
Thanks,
Karthik KK