//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testLogin() public virtual void testLogin() { driver.get(appUrl + "/#/login"); WebDriverWait wait = new WebDriverWait(driver, 10); WebElement user = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("input[type=\"text\"]"))); user.sendKeys("demo"); WebElement password = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("input[type=\"password\"]"))); password.sendKeys("demo"); WebElement submit = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("button[type=\"submit\"]"))); submit.submit(); }
public static void Main(string[] args) { string url = "http://google.com"; Browser browser = new Browser(); browser.Open(FIREFOX).NavigateTo(url); try { WebElement searchBox = browser.FindElement(By.Name("q")); searchBox.SendKeys("current movies"); searchBox.Submit(); browser.Sleep(3, SECONDS); } finally { browser.Close(); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testLogin() throws java.net.URISyntaxException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: public virtual void testLogin() { driver.get(appUrl + "/#/login"); WebDriverWait wait = new WebDriverWait(driver, 10); WebElement user = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("input[type=\"text\"]"))); user.sendKeys("demo"); WebElement password = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("input[type=\"password\"]"))); password.sendKeys("demo"); WebElement submit = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("button[type=\"submit\"]"))); submit.submit(); wait.until(ExpectedConditions.textToBePresentInElementLocated(By.cssSelector(".deployed .processes .value"), "1")); wait.until(ExpectedConditions.textToBePresentInElementLocated(By.cssSelector(".deployed .processes .stats-label"), "Process Definitions")); wait.until(currentURIIs(new URI(appUrl + "/default/#/dashboard"))); }