Skip to content

Files

Latest commit

3faf98a · Apr 30, 2025

History

History

java

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Apr 22, 2025
Apr 22, 2025
Apr 30, 2025

Main Repository

Disclaimer

Selenium is a browser automation tool. This particular repository only covers Selenium setup using the Java programming language.

To continue further development with this tool, read Selenium's official documentation for Java.

Unfortunately, Selenium itself doesn't support username:password authentication for HTTP/HTTPs proxies; therefore, you'll need to have your IP whitelisted.

You can do that by following the guidelines listed here.

Prerequisites

Optional:

You'll need at least one of the above drivers to continue with the next steps.

Installation

This code was built with Eclipse, which will be used to build and launch the application.

If you feel like using something else or executing the script with the javac command, you may need to install JAVA JRE.

Once you have all of the prerequisites ready, create your project folder:

mkdir your_project
image

When the project directory is set up, you can now download our example script for Selenium.

Make sure that you download the script according to which WebDriver you want to use:

  1. Open the Terminal/Command Prompt window.
  2. Navigate to the main directory of your project folder using cd your_project
  3. Download one of the examples below.
  4. You should now see your project folder populated with the example.java file.

Firefox

curl https://raw.githubusercontent.com/Decodo/Selenium/master/java/firefox/example.java > example.java

Chrome

curl https://raw.githubusercontent.com/Decodo/Selenium/master/java/chrome/example.java > example.java

Configuration

To configure the proxy, simply change the following strings in the code:

String ProxyServer = "gate.decodo.com"; # Location you want to target
int ProxyPort = 7000; # Port for session
image

Testing

If everything is done correctly, the selected WebDriver will appear with a new IP from the proxy service after running the code:

image

You'll also get a printed output of the IP in the Console:

Need help?

Email - sales@decodo.com
Live chat 24/7