Page Objects video 9 4:30 NUnit Visual Studio 2022
This commit is contained in:
30
SeleniumNunitProject/PageObjects/PageObjects/WebFormPage.cs
Normal file
30
SeleniumNunitProject/PageObjects/PageObjects/WebFormPage.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using OpenQA.Selenium;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PageObjects.PageObjects
|
||||
{
|
||||
public class WebFormPage
|
||||
{
|
||||
// locators
|
||||
IWebElement TextArea => driver.FindElement(By.Name("my-textarea"));
|
||||
|
||||
|
||||
IWebDriver driver;
|
||||
|
||||
public WebFormPage(IWebDriver driver)
|
||||
{
|
||||
this.driver = driver;
|
||||
}
|
||||
|
||||
// methods
|
||||
public WebFormPage WriteTextToTextArea(string text)
|
||||
{
|
||||
TextArea.SendKeys(text);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user