Getting this error Exception in thread "main" java.lang.AbstractMethodError:

324 views
Skip to first unread message

Vijay Kulkarni

unread,
Jul 24, 2024, 11:44:02 PM7/24/24
to Selenium Users
package parameterization;

import java.util.List;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;

import io.github.bonigarcia.wdm.WebDriverManager;

public class goibibo {



public static void main(String[] args) throws InterruptedException {

WebDriverManager.chromedriver().setup();
WebDriver driver = new ChromeDriver();

driver.get("https://www.goibibo.com");
driver.manage().window().maximize();
Thread.sleep(3000);
driver.findElement(By.xpath("//span[@class='logSprite icClose']")).click();
driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS);
driver.findElement(By.xpath("//span[text()='From']")).click();
Thread.sleep(3000);
WebElement from = driver.findElement(By.xpath("//input[@type='text']"));
from.sendKeys("Bangaluru");
Thread.sleep(3000);
from.sendKeys(Keys.ENTER);
//driver.findElement(By.xpath("//span[text()='To']")).click();
WebElement to = driver.findElement(By.xpath("//input[@type='text']"));
to.sendKeys("Hyderabad");
Thread.sleep(3000);
to.sendKeys(Keys.ENTER);

driver.findElement(By.xpath("//span[text()='Departure']")).click();
driver.findElement(By.xpath("//p[text()='23']")).click();

driver.findElement(By.xpath("//span[text()='SEARCH FLIGHTS']")).click();


List<WebElement> flights = driver.findElements(By.xpath("//div[@class='dF alignItemsCenter']/span[@class='font14']"));

for(WebElement flight : flights) {

System.out.println(flight.getText());
}





}}




Unable to launch the chrome and getting below error:
 Please help me out

Exception in thread "main" java.lang.AbstractMethodError: Receiver class org.openqa.selenium.chrome.ChromeDriverService$Builder does not define or inherit an implementation of the resolved method 'abstract void loadSystemProperties()' of abstract class org.openqa.selenium.remote.service.DriverService$Builder.

at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:509)

at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88)

at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:124)

at parameterization.goibibo.main(goibibo.java:21)

Krishnan Mahadevan

unread,
Jul 24, 2024, 11:47:25 PM7/24/24
to seleniu...@googlegroups.com
Please ensure that you do the following:

  • You upgrade and use the latest released version of Selenium
  • Get rid of WebDriverManager references from your code and also remove the dependency on web driver manager from your build tool (pom xml file or gradle build file). You dont need them anymore. Selenium is capable of managing the task of figuring out what driver binary to download, where to put it in, how to ensure that it refers to it etc.,

This should fix the problem.



Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/

--
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 selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/a899b73d-2a50-4bfa-85a8-f70c050d88b2n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages