I'm new to coding and I will try to be as specific as possible. I will attach images for the steps I performed.
I'm not sure why this is happening and I have been trying to figure out what wrong with no luck.
Can anyone please help me with this? I have not used IntelliJ before and I'm not sure why it keeps happening.
The problem is that you are typing code outside of a method. Your code is in the area reserved for class variable definitions, etc.
Change your code to the below and it should work.
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class AppTest {
private int i = 0; // class variables/fields go here, not code.
public static void main(String[] args) throws Exception {
String url = "https://www.google.com";
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
driver.get(url);
driver.findElement(By.cssSelector("textarea[name='q']")).sendKeys("Selenium/r/n");
}
}