Sometimes simple mistakes will take lot of time in debugging . I can bet on it :P
Today while runing a sample script I got errors like below :
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
Here is the script with syntax error:
- import org.openqa.selenium.WebDriver;
- import org.openqa.selenium.firefox.FirefoxDriver;
- import org.openqa.selenium.firefox.FirefoxProfile;
- import org.testng.annotations.BeforeTest;
- import org.testng.annotations.Test;
- public class AutoComplete {
- WebDriver driver;
- @BeforeTest
- public void start(){
- WebDriver driver = new FirefoxDriver();
- }
- @Test
- public void AutoComplete()
- {
- driver.get("http://mythoughts.co.in/");
- driver.manage().window().maximize();
- }
- }
Here is the script which ran successfully.
- import org.openqa.selenium.WebDriver;
- import org.openqa.selenium.firefox.FirefoxDriver;
- import org.openqa.selenium.firefox.FirefoxProfile;
- import org.testng.annotations.BeforeTest;
- import org.testng.annotations.Test;
- public class AutoComplete {
- WebDriver driver;
- @BeforeTest
- public void start(){
- driver = new FirefoxDriver();
- }
- @Test
- public void AutoComplete()
- {
- driver.get("http://mythoughts.co.in/");
- driver.manage().window().maximize();
- }
- }
No comments:
Post a Comment