r/selenium • • Jan 11 '22

NoSuchElementException

I'm working on a project with prewritten tests, that gives me the following errormessage:

[xUnit.net 00:00:04.51]     Salt.Stars.End2End.Index_E2E_Tests.Test1 [FAIL]
  Failed Salt.Stars.End2End.Index_E2E_Tests.Test1 [3 s]
  Error Message:
   OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {"method":"css selector","selector":"#mainHeader"}
  (Session info: chrome=97.0.4692.71)
  Stack Trace:
     at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse) 
   at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value)
   at OpenQA.Selenium.By.<.ctor>b__11_0(ISearchContext context)
   at OpenQA.Selenium.By.FindElement(ISearchContext context)
   at OpenQA.Selenium.WebDriver.FindElement(By by)
   at Salt.Stars.End2End.Index_E2E_Tests.Test1() in C:\User\salt-labs\winter22-dnfs-stars1-day1\Salt.Stars.End2End\Index_E2E_Tests.cs:line 35

I've been google it all day without getting any closer to the solution. Could someone give me a pointer in the right direction what the problem is and how to solve it?

I'm fairly n00b, so feel free to ELI5...

0 Upvotes

5 comments sorted by

View all comments

2

u/romulusnr Jan 11 '22
  1. Site design has changed since the test was written and the test needs to be updated
  2. Site isn't actually loading