0
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Support.UI;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace ToolsQA
{
    class FirstTestCase
    {
        static void Main(string[] args)
        {
            IWebDriver driver = new FirefoxDriver();
            driver.Navigate().GoToUrl(" http://toolsqa.wpengine.com/automation-practice-form/");
            IWebElement element = driver.FindElement(By.Id("continents"));
            SelectElement dropdown = new SelectElement(element);
            dropdown.SelectByText("Europe");
       }
    }
}

This is mistake:

Severity Code Description Project File Line Suppression State Error CS1061 'SelectElement' does not contain a definition for 'SelectByText' and no extension method 'SelectByText' accepting a first argument of type 'SelectElement' could be found (are you missing a using directive or an assembly reference?) ToolsQA

How does solve it?

Renatas M.
  • 11,694
  • 1
  • 43
  • 62
  • Delete line `dropdown.SelectByText("Europe");` could be the answer. But if you specify what you actually trying to achieve, we might help you some how. – Renatas M. Jan 20 '17 at 13:15
  • 2
    Did you install the Selenium.Support package using NuGet? – JeffC Jan 20 '17 at 13:58
  • 1
    As @JeffC said you either need to install or try reinstalling the Selenium Support package; I've had this problem before and it was solved by just reinstalling the package. – Dillanm Jan 20 '17 at 16:12

0 Answers0