I m facing the below issue searched in Google couldn\'t find the clear answer how to resolve this.
Error :
org.apache.bcel.verifier.exc.Assertion
The error is stemming out of org.apache.bcel.verifier
You have to take care of a certain things as follows :
Instead of using the ChromeDriver
implementation use the WebDriver
interface.
chrome
is a reserved keyword. Use some other user defined name for the method e.g. my_function() {}
Simply defining public void chrome() won't execute your Test
. You have to convert public void chrome() in to either of the following :
Convert into main()
function as follows:
public class Newtours
{
public static void main(String[] args)
{
System.setProperty("webdriver.chrome.driver", "C:\\path\\to\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("http://newtours.demoaut.com/");
}
}
Integrate TestNG
and add @Test
annotations as follows :
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;
public class Newtours
{
@Test
public void my_function()
{
System.setProperty("webdriver.chrome.driver", "C:\\path\\to\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("http://newtours.demoaut.com/");
}
}
System.setProperty("webdriver.chrome.driver", "chromedriver");
driver = new ChromeDriver();
driver.get("http://newtours.demoaut.com/");
Try this code it's working fine. I checked this and it's running fine. You need to give http or https for your url.