Hi all,
I had some test scripts running well with Selenium WebDriver 2.53.1 and Firefox 44.0.b2. However, because our web application no longer supports that Firefox version, we have to upgrade to use Selenium WebDriver 3.3.0, Gecko Driver 0.15 and Firefox 53.0, then most the tests got failed with the exception below:
System.InvalidOperationException was unhandled by user code
HResult=-2146233079
Message=Expected [object Undefined] undefined to be a string (IndexOutOfBounds)
Source=WebDriver
StackTrace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebElement.SendKeys(String text)Tried with the simple test below got the same exception when it tried to send keys to searchBox:
[Test]
public void TEST()
{
System.Environment.SetEnvironmentVariable("webdriver.gecko.driver", @"C:\EPi\Automation\Development\EPiServer.Automation.Commerce\bin\geckodriver.exe");
var driver = new FirefoxDriver();
driver.GoTo("
https://www.google.com.vn");
var searchBox = driver.FindElementByCssSelector("#lst-ib");
searchBox.SendKeys("test");
}
Anyone can help? Note that all tests ran ok with Selenium WebDriver 3.3.0 and ChromeDriver 2.29.
Thanks,
Tung