The ISearchContext
interface is not the interface that exposes SwitchTo
, IWebDriver
does.
What's the reason for using ISearchContext
specifically? If you change it to be IWebDriver
it will work.
This code, for example:
public static IWebDriver Driver
{
get
{
return webDriver;
}
}
IWebDriver
implements ISearchContext
, and gives much more functionality. I'd highly suggest you use that instead of just ISearchContext
alone, unless you have a particular reason for doing so.