<ul class="options">
<li data-raw-value="smt-b1bbdd96-f135-48ae-8744-e920942dd7a3" class="selected" data-sys-status="running">3. LIELA LEGAL SISTĒMA ( EN - LV )</li>
I want to select the specific item with the attribute value in the data-war-value attribute. So far have just made the way to the section but stopped at the selection.
driver.Navigate().GoToUrl(baseUrl + TextTranslate);
new SelectElement(driver.FindElement(By.ClassName("options"))).SelectByText(sysID);
When I run the test with this kind of code I get this error :
Test Outcome: Failed Test Duration: 0:00:08,7050235 Result StackTrace: at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(String mechanism, String value) at OpenQA.Selenium.Remote.RemoteWebDriver.FindElementByClassName(String className) at OpenQA.Selenium.By.<>c__DisplayClass12.b__10(ISearchContext context) at OpenQA.Selenium.By.FindElement(ISearchContext context) at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(By by) at FirstUnitTest.LetsMT_Tests.TranslateText() in C:\Users\edgars.karkis.TILDE\Documents\Visual Studio 2015\Projects\FirstUnitTest\FirstUnitTest\LetsMT_Tests.cs:line 59 Result Message: Test method FirstUnitTest.LetsMT_Tests.TranslateText threw exception: OpenQA.Selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"class name","selector":"options"} (Session info: chrome=46.0.2490.71)
(Driver info: chromedriver=2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067),platform=Windows NT 10.0 x86_64)
I have tried to select/ click the item, but the error repeats, that the element could not me found.
driver.Navigate().GoToUrl(baseUrl + TextTranslate);
driver.FindElement(By.ClassName("translateSystemContainer")).Click();
new SelectElement(driver.FindElement(By.ClassName("options"))).SelectByText(sysID);