jeudi 4 juin 2020

Trying to run a UI test where my form gets filled out, but it won't

I am using Selenium for the first time, and I am trying to run a UI test where a form will be filled out. So far the test can get me to that form, but once on that page, I am not able to fill out the first name in that form (look at last line). Below is how I have written it so far and I have also attached the html elements from dev tools. Can someone explain what I am doing wrong? I am trying to find the element by Name and I have also used ClassName, but my examples don't work.

var driver2 = new ChromeDriver(@"C:\Users\Myname \Desktop\NUnitTestProject1\NUnitTestProject1\bin\Debug\netcoreapp2.1");
      driver2.Navigate().GoToUrl("https://portal.crushdata.com/");
      driver2.FindElement(By.Name("Email")).SendKeys("email@email.com");
      driver2.FindElement(By.Name("Password")).SendKeys("pswrd" + Keys.Enter);
      driver2.FindElement(By.ClassName("icon-circle")).Click();
      driver2.FindElement(By.ClassName("btn-orange")).Click();
      driver2.FindElement(By.Name("FirstName")).SendKeys("My Name");

 tes

Aucun commentaire:

Enregistrer un commentaire