0

We've been running through some basic selenium tests in our .net app to make sure all the pages you can get to from our menu will load. I am currently having an issue where some but not all of the links that are in submenus will pass in firefox but not in chrome.

I've tried this a couple of different ways.
a)

TomBrowser.Driver.FindElement(By.LinkText("Manage Inventory")).Click();
TomBrowser.Driver.FindElement(By.PartialLinkText("Inventory Report")).Click();
TomBrowser.Wait(x => x.Title.ToString().Equals("Current Inventory Report", StringComparison.InvariantCultureIgnoreCase));

b)

TomBrowser.Driver.FindElement(By.LinkText("Reports")).Click();  
TomBrowser.Driver.FindElement(By.Id("side-menu")).FindElement(By.ClassName("active")).FindElement(By.PartialLinkText("Dispense Report")).Click();
TomBrowser.Wait(x => x.Title.ToString().Equals("Dispense Report", StringComparison.InvariantCultureIgnoreCase));

Both of these tests work in firefox but not in chrome, however there are also tests that work in both firefox and chrome that follow this same format.
The error messages received are:

OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {"method":"partial link text","selector":"Inventory Report"} (Session info: chrome=63.0.3239.84) (Driver info: chromedriver=2.33.506120

and

OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {"method":"partial link text","selector":"Dispense Report"} (Session info: chrome=63.0.3239.84) (Driver info: chromedriver=2.33.506120

Edit: my question is why is this working in firefox but not chrome and why does it only fail in chrome for some tests but not others, not asking about how to find elements.

B Reid
  • 1
  • 1
  • 3
  • Possible duplicate of [Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to locate element: //\*\[@id='login-email'\]](https://stackoverflow.com/questions/46202283/exception-in-thread-main-org-openqa-selenium-nosuchelementexception-unable-to) – undetected Selenium Dec 12 '17 at 18:50
  • @DebanjanB they are totally different questions, I'm trying to figure out why this would work in firefox, but not in chrome and why only some of the chrome tests can't find the elements. – B Reid Dec 12 '17 at 20:07

0 Answers0