I am a beginner in selenium.Trying to run the below code in selenium 3.0.1 and firefox 51.0.1(64 bit)
I Am not able to locate the "My Account" link and also receiving a
// TODO Auto-generated method stub
//Objects and variable declaration
//if you didn't update the Path system variable to add the full directory path to the executable as above mentioned then doing this directly through code
System.setProperty("webdriver.gecko.driver", "C:/Users/syama/Desktop/Selenium/geckodriver-v0.13.0-win64/geckodriver.exe");
//Now you can Initialize marionette driver to launch firefox
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
//@SuppressWarnings("deprecation")
WebDriver driver = new MarionetteDriver(capabilities);
//WebDriver driver = new FirefoxDriver();
//Launch the firefox browser
driver.get(appUrl);
//maximize the browser
driver.manage().window().maximize();
//functionality
driver.findElement(By.xpath("//*[@class='btn btn-primary btn-lg btn-block']//*[text()='
http://www.phptravels.net']")).click();
System.out.println("Clicked on the homepage-front end button in the home page");
//wait
driver.manage().timeouts();
//select value from drop down
Select dropList = new Select(driver.findElement(By.xpath("//a[contains(.,'My Account')]']")));
dropList.selectByVisibleText(" Sign Up");
Mar 01, 2017 3:20:52 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
1488399652449 mozprofile::profile INFO Using profile path C:\Users\syama\AppData\Local\Temp\rust_mozprofile.pJeIYHUa7B3i
1488399652480 geckodriver::marionette INFO Starting browser C:\Program Files\Mozilla Firefox\firefox.exe
1488399652542 geckodriver::marionette INFO Connecting to Marionette on localhost:61873
1488399655546 Marionette INFO Listening on port 61873
Mar 01, 2017 3:21:01 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
Clicked on the homepage-front end button in the home page
Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'DESKTOP-A7VC6HV', ip: '192.168.1.90',
os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_111'
Driver info: driver.version: RemoteWebDriver
Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, marionette=true, appBuildId=20170125094131, version=, platform=XP, proxy={}, command_id=1, specificationLevel=0, acceptSslCerts=false, processId=728, browserVersion=51.0.1, platformVersion=10.0, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=firefox, takesScreenshot=true, takesElementScreenshot=true, platformName=windows_nt}]
Session ID: a40cb531-8cd4-4fa2-adee-03a550df6130
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:622)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:368)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:473)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:360)
at Signup.main(Signup.java:44)
Caused by: java.lang.IllegalArgumentException: expected one element but was: <org.openqa.selenium.remote.ErrorCodes$KnownError@c4437c4, org.openqa.selenium.remote.ErrorCodes$KnownError@6193b845>
at com.google.common.collect.Iterators.getOnlyElement(Iterators.java:322)
at com.google.common.collect.Iterables.getOnlyElement(Iterables.java:284)
at org.openqa.selenium.remote.ErrorCodes.toStatus(ErrorCodes.java:138)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:92)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:42)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:163)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
... 5 more