Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Easy question(Java in Eclipse)
Easy question [message #1858067] Tue, 14 March 2023 14:47 Go to next message
Pascal Lachat is currently offline Pascal LachatFriend
Messages: 2
Registered: March 2023
Junior Member
Hello

First I 'm sorry for my english because I speak french !

I need to "speak" between Acess 365 and Edge and for that I would like to use Eclpise !

I just try first of all to "speak " between Eclipse and Edge and in a second time try to speak with accees



And I have this error message :
Erreur : impossible d'initialiser la classe principale Code_Java_P
Caus� par : java.lang.NoClassDefFoundError:
org/openqa/selenium/WebDriver¨

As you can see in the files attached, I have selenium library and I also downloas in my computer the microsoft webdriver in C: the version is same as my edge

Thanks

Best regards

Pascal
  • Attachment: Capture.PNG
    (Size: 34.43KB, Downloaded 99 times)
Re: Easy question [message #1858072 is a reply to message #1858067] Tue, 14 March 2023 17:40 Go to previous messageGo to next message
Pascal Lachat is currently offline Pascal LachatFriend
Messages: 2
Registered: March 2023
Junior Member
Here is the code :

package Package_test;


import org.openqa.selenium.WebDriver;
import org.openqa.selenium.edge.EdgeDriver;

public class Main {
public static void main(String[] args) {
// Définir le chemin vers le pilote Microsoft Edge
System.setProperty("webdriver.edge.driver", "C://Webdriver/msedgedriver.exe");

// Ouvrir Microsoft Edge avec WhatsApp Web
WebDriver driver = new EdgeDriver();

// Naviguer vers l'URL de WhatsApp Web
driver.get("https://web.whatsapp.com/");

// Attendre que l'utilisateur se connecte à WhatsApp Web
System.out.println("Connectez-vous à WhatsApp Web et appuyez sur Entrée une fois connecté.");
try {
System.in.read();
} catch (Exception e) {
e.printStackTrace();
}

// Fermer Microsoft Edge
driver.quit();
}
}
Re: Easy question [message #1858696 is a reply to message #1858067] Mon, 17 April 2023 03:41 Go to previous message
Alan Scott is currently offline Alan ScottFriend
Messages: 5
Registered: April 2023
Junior Member
It seems like you are trying to run a Java code that uses Selenium to automate Microsoft Edge browser, but encountering an error related to the missing class 'WebDriver'. This usually happens when the Selenium WebDriver library is not properly configured in the classpath of your Eclipse project.

To resolve this issue, you can follow these steps:

1. Make sure that you have downloaded the latest version of the Selenium WebDriver JAR file for Java from the official Selenium website and added it to your project's classpath in Eclipse. You can do this by right-clicking on your project in Eclipse, selecting 'Build Path' and then 'Configure Build Path'. In the 'Libraries' tab, click on 'Add External JARs' and select the Selenium WebDriver JAR file that you downloaded.

2. Verify that you have also downloaded and installed the Microsoft Edge WebDriver executable file in a location on your computer, and added the location of the WebDriver executable file to your system's PATH environment variable. You can find the download link for the Microsoft Edge WebDriver on the official Microsoft documentation website .

3. Check that your Java code imports the necessary Selenium libraries and creates an instance of the EdgeDriver class to communicate with the Microsoft Edge browser. For example, you could add the following import statements to the top of your Java class: wordle unlimited

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.edge.EdgeDriver;


4. Finally, make sure that you have specified the correct path to the Microsoft Edge WebDriver executable file in your Java code when creating an instance of the EdgeDriver class. For example:

System.setProperty("webdriver.edge.driver", "C:\\path\\to\\msedgedriver.exe");
WebDriver driver = new EdgeDriver();


Once you have verified that all of these steps have been completed, you should be able to run your Java code to automate the Microsoft Edge browser without encountering any errors.

[Updated on: Sat, 27 May 2023 04:14]

Report message to a moderator

Previous Topic:Difference between AdoptJDK and OracleJDK
Next Topic:Java's for each loop
Goto Forum:
  


Current Time: Sat Jan 18 01:53:48 GMT 2025

Powered by FUDForum. Page generated in 0.04622 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top