Привет, подскажите пожалуйста как побороть эту ошибку?
Трейс не выпадает. Дебаг не запускается.
namespace WebFormsAutomation
{
[TestFixture(Category="BaseClassTests")]
public abstract class BaseClass
{
protected static IWebDriver driver;
public IWebDriver Driver
{
get { return driver; }
set { Driver = driver; }
}
public BaseClass(IWebDriver driver)
{
Driver = driver;
}
[OneTimeSetUp()]
public void TestInitialize()
{
driver = new ChromeDriver();
}
[OneTimeTearDown]
public void TestCleanup()
{
driver.Quit();
}
}
}
----------<b>Common</b>
namespace WebFormsAutomation.PageObject
{
public class Commons : BaseClass
{
public Commons(IWebDriver driver) : base(driver)
{
}
public void OpenUrl(string url) => Driver.Navigate().GoToUrl(url);
public bool FindElement(string element)
{
try
{
Driver.FindElement(By.CssSelector(element));
}
catch (NoSuchElementException)
{
return false;
}
return true;
}
public bool IsDisplayed(string element)
{
try
{
var searchedElement = Driver.FindElement(By.CssSelector(element));
var result = searchedElement.Displayed;
}
catch (ElementNotVisibleException)
{
return false;
}
return true;
}
-------<b>Scenario</b>
namespace WebFormsAutomation.PageObject
{
public class AddRemoveElementScenarios : Commons
{
public AddRemoveElementScenarios(IWebDriver driver) : base(driver)
{
}
public void AddElement(string url)
{
OpenUrl(url);
FindElement(AddButton);
IsDisplayed(AddButton);
}
public readonly string AddButton = "div.example button";
}
}
--------<b>Test</b>
namespace WebFormsAutomation.Tests
{
[TestFixture]
public class AddRemoveElementTest : AddRemoveElementScenarios
{
public AddRemoveElementTest(IWebDriver driver) : base(driver)
{
}
[TestCase]
public void AddElementTest()
{
OpenUrl("http://the-internet.herokuapp.com/add_remove_elements/");
FindElement(AddButton);
IsDisplayed(AddButton);
}
}
}