TestNG compilation errors

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

TestNG compilation errors

Sudeept Mohan

OS:
Windows 10
Selenium Version:
3.11
Browser:
Firefox

Following code produces compilation errors, can you help eliminate those and get the code to run? (I am new to TestNG)

package TestNG;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;

public class DemoTestNG {
public WebDriver driver = new FirefoxDriver();
String appUrl = "https://accounts.google.com";

@test
public void gmailLogin() {

  // launch the firefox browser and open the application url
   driver.get("https://gmail.com"); 

}

// declare and initialize the variable to store the expected title of the webpage.
String expectedTitle = " Sign in - Google Accounts ";

//fetch the title of the web page and save it into a string variable
String actualTitle = driver.getTitle();
Assert.assertEquals(expectedTitle,actualTitle);

//enter a valid username in the email textbox
WebElement username = driver.findElement(By.id("Email"));
username.clear();
username.sendKeys("TestSelenium");

//enter a valid password in the password textbox
WebElement password = driver.findElement(By.id("Passwd"));
password.clear();
password.sendKeys("password123");

//click on the Sign in button
WebElement SignInButton = driver.findElement(By.id("signIn"));
SignInButton.click();

//close the web b

rowser
driver.close();
}
}

@barancev

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/6b842402-2b69-4216-9483-3a07bd4029af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.