help me with this work step by step
Created on: December 9, 2025
Answered using GPT-5.1 Thinking by Chat01
Created on: December 9, 2025
Answered using GPT-5.1 Thinking by Chat01
help me with this work step by step
Alright, let’s walk through everything in your Selenium PDF step by step until you can run the Shopee script. 💻✨ (Selenium.pdf)
Make sure you have:
1. Download JDK
2. Install JDK
.exe).C:\Program Files\Java\jdk-<version> (shown on page 13). (Selenium.pdf)3. Set environment variables
In Windows search, type “Edit the system environment variables” and open it.
Click Environment Variables….
Under System variables:
JAVA_HOMEC:\Program Files\Java\jdk-<your-version>Find the variable Path, select it → Edit.
Click New, add:
%JAVA_HOME%\bin
→ This is what “Set the Environment Variables” on page 14 is showing. (Selenium.pdf)
Click OK on all dialogs.
12. Verify
java -version1. Download Eclipse
2. Install Eclipse
.zip file (something like selenium-java-4.x.x.zip).C:\Selenium.C:\Selenium.You should now have something like:
textC:\Selenium\selenium-java-4.x.x\ selenium-java-4.x.x.jar selenium-api-... libs\ (more jars)
chromedriver.exe.chromedriver.exe into your C:\Selenium folder.Now you should have:
textC:\Selenium\ chromedriver.exe selenium-java-4.x.x\
SeleniumShopee.src → New → Package.
sample (or any name you like).SeleniumScript.main.SeleniumShopee) → Build Path → Configure Build Path….C:\Selenium\selenium-java-4.x.x\..jar files in that folder and inside its libs subfolder.Now your project knows about Selenium.
Open your SeleniumScript.java file and put this code inside:
javapackage sample; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class SeleniumScript { public static void main(String[] args) { // 1. Tell Java where chromedriver.exe is System.setProperty("webdriver.chrome.driver", "C:\\Selenium\\chromedriver.exe"); // 2. Create a new Chrome browser instance WebDriver driver = new ChromeDriver(); // 3. Open the Shopee login page driver.get("https://shopee.ph/buyer/login"); // (Optional) close browser after a few seconds, or keep it open to check // driver.quit(); } }
System.setProperty matches where your chromedriver.exe is.In Eclipse you’ll see red underlines at first — hover and click “Import …” to add:
import org.openqa.selenium.WebDriver;import org.openqa.selenium.chrome.ChromeDriver;That’s the “Import the WebDriver and ChromeDriver” step on page 26. (Selenium.pdf)
SeleniumScript.java) → Run As → Java Application.Common issues:
java.lang.IllegalStateException: The path to the driver executable must be set
→ The System.setProperty path is wrong. Check that chromedriver.exe is in the folder you specified.
Browser version mismatch
→ If Chrome opens then closes or console mentions version mismatch, download a ChromeDriver that matches your Chrome version.
Missing imports / classes not found
→ Ensure you added all Selenium JARs to the build path and imported WebDriver and ChromeDriver.
If you tell me which step you’re on right now (e.g. “I’m at step 5 and I see an error”), I can walk you through the exact fix next.
what do you mean run the downloaded installer in jdk
Good question — that wording is confusing the first time you see it.
When I say “run the downloaded installer” for JDK, I mean:
On Windows:
jdk-21_windows-x64_bin.exejdk-17_windows-x64_bin.exeThat file is the “installer”.
.exe).Now you should see a Java Setup / JDK Setup window.
C:\Program Files\Java\jdk-xx).That’s what the slide means on Step 3: “Then just execute the installer and Java will be downloaded to your system.” (Selenium.pdf)
After this, Java is installed on your computer.
The next step from your slides is to set the Environment Variables (JAVA_HOME and Path). If you’d like, I can walk you through those clicks one by one next.
i have gone to libraries but it wont let me add external jars unless i click classpath or modulepath
Nice, that means you’re in the right place already 👍
In newer Eclipse versions you do have to select either Classpath or Modulepath first. For what you’re doing, just use Classpath.
ModulepathClasspathClasspath so it’s highlighted.C:\Selenium\selenium-java-4.x.x\.jar files in that folder, and.jar files inside its libs subfolderThat’s it—Eclipse will put all those Selenium JARs on the Classpath, which is exactly what you want.
If you tell me what you see in that Libraries window (or if any button is still greyed out), I’ll help you fix it from there.
i hit an error:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
WebDriver cannot be resolved to a type
ChromeDriver cannot be resolved to a type
at dude/sample.Seleniumscript.main(Seleniumscript.java:14)
That error just means: Eclipse doesn’t know what WebDriver and ChromeDriver are yet.
We fix that in two parts:
SeleniumShopee or dude).C:\Selenium\selenium-java-4.x.x\.jar files in that folder, and.jar files inside its libs subfolder (Ctrl+A inside libs).👉 In the Package Explorer, you should now see a Referenced Libraries section with a bunch of Selenium JARs.
Open your Seleniumscript.java and at the very top, it should look like this:
javapackage dude.sample; // or whatever your package is import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class Seleniumscript { public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "C:\\Selenium\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("https://shopee.ph/buyer/login"); } }
If the import lines aren’t there:
That will automatically add the two import lines.
Seleniumscript.java → Run As → Java Application.If everything above is done, the WebDriver cannot be resolved to a type and ChromeDriver cannot be resolved to a type errors should disappear, and Chrome should open on the Shopee page.
If you still see red underlines, tell me exactly what the first few lines of your file look like (the package + import lines) and I’ll adjust the fix.
it doesn't work so just fix the code
package dude.sample; // or whatever your package is
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Seleniumscript {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver",
"C:\Selenium\chromedriver.exe");
textWebDriver driver = new ChromeDriver(); driver.get("https://shopee.ph/buyer/login"); }
}
Your code is already almost correct – the error isn’t really about the Java code, it’s that Eclipse still can’t “see” the Selenium library. But I’ll give you a clean, fixed version to copy-paste and then a short checklist so it actually compiles.
Here’s the final code you should use:
javapackage dude.sample; // keep this the same as your package in Eclipse import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class Seleniumscript { public static void main(String[] args) { // 1. Path to your chromedriver.exe System.setProperty("webdriver.chrome.driver", "C:\\Selenium\\chromedriver.exe"); // 2. Start Chrome WebDriver driver = new ChromeDriver(); // 3. Go to Shopee login page driver.get("https://shopee.ph/buyer/login"); // (optional) keep browser open, or later call driver.quit(); } }
If you paste exactly that and you still see:
WebDriver cannot be resolved to a type
ChromeDriver cannot be resolved to a type
then the problem is not in the code. That error only happens when Selenium jars are not on the project’s build path.
Do these steps once more carefully:
Add Selenium JARs
.jar files in the main folder and in its libs subfolder.Check that imports are correct
javaimport org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver;
WebDriver / ChromeDriver imports from weird packages, delete them.Clean and run
Seleniumscript.java → Run As → Java ApplicationAfter those steps, the compilation errors should disappear and a Chrome window should open on the Shopee login page.
all it says is run as configurations
No worries, this is a super common Eclipse confusion. 😊
When you only see Run As → Run Configurations…, it usually means Eclipse isn’t picking up your main method from the file you clicked on.
Let’s fix it in two ways: (A) the simple way, and if that still doesn’t work, (B) making a Run Configuration manually.
In Eclipse, look at the Package Explorer (left side).
Open this path:
dude (project name, or whatever yours is)srcdude.sample (the package)Click once on Seleniumscript.java to select it.
Make sure it’s open in the editor and you see this at the top:
javapackage dude.sample; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class Seleniumscript { public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "C:\\Selenium\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("https://shopee.ph/buyer/login"); } }
Press Ctrl + S to save.
Now, RIGHT-CLICK on Seleniumscript.java (the file itself) → hover Run As.
You should see: “1 Java Application”.
Click that and Chrome should open to Shopee (like in your slide on running the program). (Selenium.pdf)
If you still only see Run Configurations…, do this:
On the top menu, click Run → Run Configurations…
On the left side, double-click Java Application
(or click it once and then the New launch configuration icon).
On the right side, fill in:
Seleniumscriptdude)dude.sample.Seleniumscript and press OKClick Apply, then Run.
That will start your program even if the right-click menu is being annoying.
If after doing this Chrome still doesn’t open (or you get a new error in the Console), copy the exact error message and I’ll walk you through that next.