Initialization method BookingSystem.Tests.SeleniumChrome.TestInit threw exception. System.InvalidOperationException: session not created: This version of ChromeDriver only supports Chrome version 79 (SessionNotCreated).
TestCleanup method BookingSystem.Tests.SeleniumChrome.TestClean threw exception. System.NullReferenceException: System.NullReferenceException: Object reference not set to an instance of an object..
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/dd224cba-d858-48a1-af9c-92c689e2ffad%40googlegroups.com.
<packages> <package id="MSTest.TestAdapter" version="1.3.2" targetFramework="net472" /> <package id="MSTest.TestFramework" version="1.3.2" targetFramework="net472" /> <package id="Selenium.Support" version="3.141.0" targetFramework="net472" /> <package id="Selenium.WebDriver" version="3.141.0" targetFramework="net472" /> <package id="Selenium.WebDriver.ChromeDriver" version="81.0.4044.6900" targetFramework="net472" /></packages>Enter code here...namespace BookingSystem.Tests{ [TestClass] public class SeleniumChrome { private static TestContext testContext; private RemoteWebDriver driver;
[ClassInitialize] public static void Initialize(TestContext testContext) { SeleniumChrome.testContext = testContext; }
[TestInitialize] public void TestInit() { driver = GetChromeDriver(); driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(300); }
[TestCleanup] public void TestClean() { driver.Quit(); }
[TestMethod] public void FunctionalTestNormal() { var webAppUrl = "http://csinc-dev.eu-west-1.elasticbeanstalk.com/"; try { webAppUrl = testContext.Properties["webAppUrl"].ToString(); } catch (Exception) { webAppUrl = "http://csinc-dev.eu-west-1.elasticbeanstalk.com/"; } //var webAppUrl = testContext.Properties["webAppUrl"].ToString();
var startTimestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds(); var endTimestamp = startTimestamp + 60 * 10;
string expectedValue = "Thank you for your booking";
driver.Navigate().GoToUrl("http://csinc-dev.eu-west-1.elasticbeanstalk.com/"); driver.Manage().Window.Size = new System.Drawing.Size(1936, 1056); driver.FindElement(By.Id("txtRoll")).Click(); driver.FindElement(By.LinkText("Click if organisation without school roll number")).Click(); driver.FindElement(By.Id("txtName")).Click(); driver.FindElement(By.Id("txtName")).SendKeys("Test Organisation"); driver.FindElement(By.Id("txtDate")).Click(); driver.FindElement(By.LinkText("16")).Click(); driver.FindElement(By.CssSelector(".submit")).Click(); driver.FindElement(By.Id("txtTeacherName")).Click(); driver.FindElement(By.Id("txtTeacherName")).SendKeys("Mr Smith"); driver.FindElement(By.Id("txtEmail")).Click(); driver.FindElement(By.Id("txtEmail")).SendKeys("mrs...@test.com"); driver.FindElement(By.Id("txtPhoneNumber")).Click(); driver.FindElement(By.Id("txtPhoneNumber")).SendKeys("014598634"); driver.FindElement(By.Id("txtAddress1")).Click(); driver.FindElement(By.Id("txtAddress1")).SendKeys("29 Emmet Lodge"); driver.FindElement(By.Id("txtAddress2")).SendKeys("Templeogue"); driver.FindElement(By.Id("txtCounty")).Click(); driver.FindElement(By.Id("txtCounty")).SendKeys("Dublin 6"); driver.FindElement(By.Id("txtEircode")).Click(); driver.FindElement(By.Id("txtEircode")).SendKeys("D6WP38"); driver.FindElement(By.Id("txtStartTime")).Click(); driver.FindElement(By.Id("txtStartTime")).SendKeys("10:00"); driver.FindElement(By.Id("txtEndTime")).Click(); driver.FindElement(By.Id("txtEndTime")).SendKeys("13:30"); driver.FindElement(By.Id("txtClassGroups")).Click(); driver.FindElement(By.Id("txtClassGroups")).SendKeys("4th year students"); driver.FindElement(By.Id("txtTopics")).Click(); driver.FindElement(By.Id("txtTopics")).SendKeys("General"); driver.FindElement(By.Id("surveyBox")).Click(); driver.FindElement(By.CssSelector(".btn-primary")).Click(); driver.FindElement(By.CssSelector("h3")).Click();
string actualValue = driver.FindElement(By.Id("h3")).Text;
Assert.AreEqual(expectedValue, actualValue);
}
private RemoteWebDriver GetChromeDriver() { var path = Environment.GetEnvironmentVariable("ChromeWebDriver"); var options = new ChromeOptions(); options.AddArguments("--no-sandbox"); //options.AddArgument("headless");
if (!string.IsNullOrWhiteSpace(path)) { return new ChromeDriver(path, options, TimeSpan.FromSeconds(300)); } else { return new ChromeDriver(options); } } }}
Certainly.Install-Package Selenium.WebDriver.ChromeDriver -Version 81.0.4044.6900-betaThough you should note that this version of Chromedriver is in beta (hence the name).Thanks,Joseph.
On Sun, 12 Apr 2020 at 19:29, Craig W <craigw...@gmail.com> wrote:
I am trying to setup selenium testing on my .net framework 4.7.2 web application. I installed the Selenium.WebDriver - version 3.141.0 and Selenium.WebDriver.ChromeDriver - version 81.0.4044.6900 nuget packages (both the latest stable versions). Although I get the following error when I try to run a Selenium MSTest method:--Initialization method BookingSystem.Tests.SeleniumChrome.TestInit threw exception. System.InvalidOperationException: session not created: This version of ChromeDriver only supports Chrome version 79 (SessionNotCreated).
TestCleanup method BookingSystem.Tests.SeleniumChrome.TestClean threw exception. System.NullReferenceException: System.NullReferenceException: Object reference not set to an instance of an object..
So the newest version of Selenium WebDriver does not support the newest version of Chrome browser? My current Chrome version running on my computer is 81.0.4044.92. How can I fix this? I cannot download Chrome browser version 79 because Chrome doesn't allow installation of older versionsAny help would be appreciated.
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seleniu...@googlegroups.com.