I am trying to set up selenium webdriver to work together with Browserstack with Java for automated testing. I installed the Selenium for java and I copied and pasted the code from browserstack's site https://www.browserstack.com/automate/java#configure-capabilities to set up an example automation test.
I ran javac -classpath selenium-server-standalone-2.48.2.jar JavaSample.java
from my terminal (JavaSample.java is the file with the selenium configuration code with the sample test) and I get the following error:
JavaSample.java:1: error: package org.openqa.selenium does not exist
import org.openqa.selenium.By;
^
JavaSample.java:2: error: package org.openqa.selenium does not exist
import org.openqa.selenium.Platform;
^
JavaSample.java:3: error: package org.openqa.selenium does not exist
import org.openqa.selenium.WebDriver;
^
JavaSample.java:4: error: package org.openqa.selenium does not exist
import org.openqa.selenium.WebElement;
^
JavaSample.java:5: error: package org.openqa.selenium.remote does not exist
import org.openqa.selenium.remote.DesiredCapabilities;
^
JavaSample.java:6: error: package org.openqa.selenium.remote does not exist
import org.openqa.selenium.remote.RemoteWebDriver;
^
JavaSample.java:18: error: cannot find symbol
DesiredCapabilities caps = new DesiredCapabilities();
^
symbol: class DesiredCapabilities
location: class JavaSample
JavaSample.java:18: error: cannot find symbol
DesiredCapabilities caps = new DesiredCapabilities();
^
symbol: class DesiredCapabilities
location: class JavaSample
JavaSample.java:25: error: cannot find symbol
WebDriver driver = new RemoteWebDriver(new URL(URL), caps);
^
symbol: class WebDriver
location: class JavaSample
JavaSample.java:25: error: cannot find symbol
WebDriver driver = new RemoteWebDriver(new URL(URL), caps);
^
symbol: class RemoteWebDriver
location: class JavaSample
JavaSample.java:27: error: cannot find symbol
WebElement element = driver.findElement(By.name("q"));
^
symbol: class WebElement
location: class JavaSample
JavaSample.java:27: error: cannot find symbol
WebElement element = driver.findElement(By.name("q"));
^
symbol: variable By
location: class JavaSample
I'm not sure how to go about this being as I just followed the instructions on Browserstack and I have very little background in Java.