So, I've got that DIV I wanna get into:
<div id="FromTitle" [something,something]>
And my code for that looks like that:
var searchID = "FromTitle";
//some other code that's finding elements perfectly fine
driver.FindElement(By.Id(searchID));
But VSC spits out exception:
Unhandled exception. OpenQA.Selenium.NoSuchElementExeption: no such element: Unable to locate element: {"method":"css selector","selector":"#FromTitle"}
Why does C#/Selenium looking for CSS and not ID?
I've tried paste value from var into (By.Id("FromTitle"))
and got same exception as the one above. I've looked through CSS file, and obviously there's no #FromTitle
.For every other previous find elements by Id it works just fine. Even if something's not right I get exception "method":"id"
. But not for that one.