Hello,
I am using below piece of code to instantiate RemoteWebDriver. But I
am getting an exception.
Please look into the code and exception below and help me out to sort
this issue.
Code:
********************************************************************************************
public void startSeleniumServer() throws MalformedURLException{
Proxy proxy = new Proxy();
proxy.setProxyAutoconfigUrl("
http://localhost:4444/wd/hub");
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability(CapabilityType.PROXY, proxy);
capabilities.setPlatform(Platform.ANY);
capabilities.setBrowserName("Firefox");
driver = new RemoteWebDriver(capabilities); // (Exception seen at
this line)
selenium = new WebDriverBackedSelenium(driver, "http://
www.google.com");
}
********************************************************************************************
Exception Seen
**********************************************************************************************
Exception in thread "main" org.openqa.selenium.WebDriverException:
java.net.MalformedURLException
Build info: version: '2.20.0', revision: '16008', time: '2012-02-27
19:03:59'
System info:
os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1',
java.version: '1.6.0_26'
Driver info: driver.version: RemoteWebDriver
at
org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:
101)
at
org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:
102)
at
org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:
98)
at
com.AddUserWebDriverNative.startSeleniumServer(AddUserWebDriverNative.java:
404)
at com.AddUserWebDriverNative.main(AddUserWebDriverNative.java:357)
Caused by: java.net.MalformedURLException
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at
org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:
98)
... 4 more
**********************************************************************************************
Please shed some light on this one. Any help would be highly
appreciated.
Thanks in advance....!
Regards,
Vijay