selenium icon indicating copy to clipboard operation
selenium copied to clipboard

[🐛 Bug]: Updated to Selenium version 4.25. I get java.lang.NoSuchMethodError: 'org.openqa.selenium.WebDriver$Timeouts.

Open RashmiG77 opened this issue 1 year ago • 2 comments

What happened?

[🐛 Bug]: Updated to Selenium version 4.25. All the JAR files are updated on the Eclipse Build Path. I had to update many things on pom.xml. Now I get java.lang.NoSuchMethodError: 'org.openqa.selenium.WebDriver$Timeouts. Please help

How can we reproduce the issue?

package SIPEE;

import java.time.Duration;

import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.Select;

import io.github.bonigarcia.wdm.WebDriverManager;

public class Student2Registration {

	public static void main(String[] args) throws InterruptedException {
		// TODO Auto-generated method stub
		WebDriverManager.chromedriver().driverVersion("129.0.6668.70").setup();
		WebDriver driver = new ChromeDriver();
		
		driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(2));
		
		// Open the Dev site Home page (where it has the Register link)
		driver.get("https://marhsawas231vg.ad.dot.gov:8773//");
		driver.getWindowHandle();
		driver.manage().window().maximize();
		JavascriptExecutor js = (JavascriptExecutor) driver;
		js.executeScript("window.scrollTo(0,400)");
		
		//Register
		driver.findElement(By.linkText("REGISTER")).click();
		
		//driver.findElement(By.id("US_CITIZEN")).click();
		Thread.sleep(2000);
	    {
	      WebElement dropdown = driver.findElement(By.id("US_CITIZEN"));
	      Select selectObject = new Select(dropdown);
	      selectObject.selectByVisibleText("Yes");

	      dropdown.findElement(By.xpath("//option[. = 'Yes']")).click();
	    }
	    Thread.sleep(3000);
	    //driver.findElement(By.id("FIRSTNAME")).click();
	    driver.findElement(By.id("FIRSTNAME")).sendKeys("TestStudent40");
	    Thread.sleep(3000);
	    //driver.findElement(By.id("LASTNAME")).click();
	    driver.findElement(By.id("LASTNAME")).sendKeys("TestStudent40");
	    Thread.sleep(3000);
	    js.executeScript("window.scrollTo(0,200)");
	    
		Thread.sleep(2000);
	    driver.findElement(By.id("MIDDLE_NAME_YES_NO")).click();
	    Thread.sleep(3000);
	    {
	      WebElement dropdown = driver.findElement(By.id("MIDDLE_NAME_YES_NO"));
	      Select selectObject = new Select(dropdown);
	      selectObject.selectByVisibleText("No");

	      //dropdown.findElement(By.xpath("//option[. = 'No']")).click();
	    }
	    Thread.sleep(3000);
	    {
		      WebElement dropdown = driver.findElement(By.id("US_CITIZEN"));
		      dropdown.findElement(By.xpath("//option[. = 'Yes']")).click();
		    }
	    js.executeScript("window.scrollTo(0,400)");
	    driver.findElement(By.id("DateOfBirth")).click();
	   // driver.findElement(By.id("DateOfBirth")).sendKeys("0002-02-02");
	    //driver.findElement(By.id("DateOfBirth")).sendKeys("0020-02-02");
	    //driver.findElement(By.id("DateOfBirth")).sendKeys("0200-02-02");
	    driver.findElement(By.id("DateOfBirth")).sendKeys("10-04-2003");
	    Thread.sleep(3000);
	    driver.findElement(By.id("SEX_CATEGORY")).click();
	    {
	      WebElement dropdown = driver.findElement(By.id("SEX_CATEGORY"));
	      dropdown.findElement(By.xpath("//option[. = 'Female']")).click();
	    }
	    Thread.sleep(3000);
	    js.executeScript("window.scrollTo(0,400)");
	    //driver.findElement(By.id("EMAIL")).click();
	    driver.findElement(By.id("EMAIL")).sendKeys("[email protected]");
	    Thread.sleep(3000);
	    //driver.findElement(By.id("PHONE")).click();
	    driver.findElement(By.id("PHONE")).sendKeys("2223334444");
	    Thread.sleep(3000);
	    driver.findElement(By.id("MILITARY_VETERAN")).click();
	    Thread.sleep(2000);
	    {
	      WebElement dropdown = driver.findElement(By.id("MILITARY_VETERAN"));
			Select selectObject = new Select(dropdown);

	      selectObject.selectByVisibleText("No");
	      //dropdown.findElement(By.xpath("//option[. = 'No']")).click();
	    }
	    Thread.sleep(3000);
	    driver.findElement(By.id("ACADEMY_ID")).click();
	    {
	      WebElement dropdown = driver.findElement(By.id("ACADEMY_ID"));
	      dropdown.findElement(By.xpath("//option[. = 'California Maritime Academy']")).click();
	    }
	    Thread.sleep(2000);
	    driver.findElement(By.id("studentnumber")).click();
	    driver.findElement(By.id("studentnumber")).sendKeys("10042003");
	    Thread.sleep(2000);
	   	    
	    //driver.findElement(By.id("AcademyEnrollmentDate")).sendKeys("0002-08-01");
	    //driver.findElement(By.id("AcademyEnrollmentDate")).sendKeys("0020-08-01");
	   // driver.findElement(By.id("AcademyEnrollmentDate")).sendKeys("0202-08-01");
	    driver.findElement(By.id("AcademyEnrollmentDate")).sendKeys("08-01-2020");
	    Thread.sleep(2000);
	    driver.findElement(By.id("GRADUATE_YEAR")).click();
	    driver.findElement(By.id("GRADUATE_YEAR")).sendKeys("2025");
	    Thread.sleep(3000);
	    js.executeScript("window.scrollTo(0,1200)");
	    driver.findElement(By.id("QUESTIONNAIRE_ANSWER")).click();
	    {
	      WebElement dropdown = driver.findElement(By.id("QUESTIONNAIRE_ANSWER"));
	      dropdown.findElement(By.xpath("//option[. = 'From the Academy (Staff or Student)']")).click();
		Thread.sleep(4000);
		js.executeScript("window.scrollTo(0,400)");
		driver.findElement(By.xpath("//*[@id=\"app-root\"]/form/div/div/div/div/div/div/div[2]/div/div[8]/button[1]")).click();
		Thread.sleep(2000);
		
		// Close Browser
	  	driver.quit();
	}
	}

}

Relevant log output

Browser should open and do the tasks above

Operating System

Windows 11

Selenium version

4.25

What are the browser(s) and version(s) where you see this issue?

Chrome 129

What are the browser driver(s) and version(s) where you see this issue?

Chromedriver 129

Are you using Selenium Grid?

No

RashmiG77 avatar Oct 04 '24 19:10 RashmiG77

@RashmiG77, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

github-actions[bot] avatar Oct 04 '24 19:10 github-actions[bot]

@RashmiG77 Could you share the output of mvn dependency:tree?

joerg1985 avatar Oct 07 '24 22:10 joerg1985

I am closing because the OP did not reply.

diemol avatar Dec 23 '24 22:12 diemol

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Mar 05 '25 22:03 github-actions[bot]