【发布时间】:2014-08-23 23:35:57
【问题描述】:
当我调用I.Open("http://google.com"); 时,我无法使用“I”变量,因为它是从静态上下文中访问的。在最坏的情况下,我总是可以使用 MSTest 进行硒测试,使用 MSpec 进行所有其他测试。
[Tags("Easy","Web")]
[Subject("Verify we can reach google.com.")]
public class ViewGoogleTest: FluentTest
{
IActionSyntaxProvider result;
Establish context = () =>
{
SeleniumWebDriver.Bootstrap(SeleniumWebDriver.Browser.Chrome);
};
Because of = () =>
{
result = I.Open("http://google.com");
};
It should_display_the_page = () => result.Find("#SomeId");
}
【问题讨论】:
标签: c# selenium selenium-webdriver mspec fluentautomation