using OpenQA.Selenium; using OpenQA.Selenium.Chrome; using OpenQA.Selenium.Support.UI; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
public static void Main(string[] args) {
IWebDriver driver = new ChromeDriver(@"C:\selenium\latestDriver"); driver.Url = @"http://seleniumtraining.com/contact-us"; driver.Manage().Window.Maximize(); IWebElement dropdown = driver.FindElement(By.Name("country_id"));
WebDriverWait wait = new WebDriverWait(driver,TimeSpan.FromSeconds(10)); wait.Until(ExpectedConditions.ElementToBeClickable); SelectElement s = new SelectElement(dropdown); Console.ReadKey();}
Severity |
Code |
Description |
Project |
File |
Line |
Suppression State |
Error |
CS0433 |
The type 'WebDriverWait' exists in both 'WebDriver, Version=3.141.0.0, Culture=neutral, PublicKeyToken=null' and 'WebDriver.Support, Version=2.47.0.0, Culture=neutral, PublicKeyToken=null' |
ConsoleApplication1 |
C:\Users\nurm\Documents\Visual Studio 2015\ClassSelenium\Assign2\ConsoleApplication1\ConsoleApplication1\dropDown.cs |
40 |
Active |
still can't get explicit wait to work . I've added the following now:
using OpenQA.Selenium; using OpenQA.Selenium.Chrome; using OpenQA.Selenium.Support.UI; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10)); wait.until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementIsVisible(By.Name("country_id")));//wait extra time only for this element SelectElement s = new SelectElement(dropdown);
Instructor
gunjan Replied on 20/12/2018Please check the version of Webdriver dll and Webdriver.Support dll. They both should be of the same version.
it worked, thanks Gunjan for your help