Error method not implemented - java

I'm trying to get the start coordinates and the size of the element in a android app using uiautomator and selenium. I was stuck at this point. The code says that the WebElement is a interface. So I even tried to typecast it but it was saying that was redundant type cast as the return type was RemoteWebElement and it also had an implementation. This is my code and the following error occurs. Can someone please help me out??
130 WebElement webElement = LIST_ELEMENTS_XPATH.findElement(this.elementOperator.getDriver());
131 Rectangle rectangle = webElement.getRect();
132 int listX = rectangle.getX();
133 int listY = rectangle.getY();
134 int listHeight = rectangle.getHeight();
135 int listWidth = rectangle.getWidth();
And this is the error
org.openqa.selenium.WebDriverException: Method has not yet been implemented (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 18 milliseconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:32:46'
System info: host: '38c9860577c9', ip: '10.55.22.63', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.4', java.version: '1.8.0_131'
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities [{appPackage=com.amazon.dee.app, deviceScreenSize=1080x1920, networkConnectionEnabled=true, recreateChromeDriverSessions=true, noReset=true, warnings={}, databaseEnabled=false, deviceName=WUJ01NML4S, platform=LINUX, deviceUDID=WUJ01NML4S, appActivity=.Launcher, desired={appActivity=.Launcher, appPackage=com.amazon.dee.app, recreateChromeDriverSessions=true, noReset=true, newCommandTimeout=300, platformName=Android, udid=WUJ01NML4S, deviceName=Android Device}, newCommandTimeout=300, platformVersion=6.0, webStorageEnabled=false, locationContextEnabled=false, takesScreenshot=true, javascriptEnabled=true, deviceModel=F3216, platformName=Android, udid=WUJ01NML4S, deviceManufacturer=Sony}]
Session ID: 4c06d952-bc1b-4afd-9a0c-eb47098dbb4e
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:40)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:327)
at io.appium.java_client.DefaultGenericMobileElement.execute(DefaultGenericMobileElement.java:33)
at io.appium.java_client.MobileElement.execute(MobileElement.java:1)
at io.appium.java_client.android.AndroidElement.execute(AndroidElement.java:1)
at org.openqa.selenium.remote.RemoteWebElement.getRect(RemoteWebElement.java:400)
at com.amazon.alexa.comms.testsdk.mobile.alexaapp.pages.comms.conversationthread.ConversationThreadPageAndroid.scrollUp(ConversationThreadPageAndroid.java:131)

Related

How to fix “Permission denied to access property "invoke”"?

Code -
Select Gender = new Select(driver.findElement(By.xpath("//select[#id='gender']")));
Gender.selectByValue("Male");
Error -
`Exception in thread "main" org.openqa.selenium.WebDriverException: **Permission denied to access property "invoke"**
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'COMP2-PC', ip: '192.168.1.9', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_91'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, appBuildId=20161123182536, version=50.0.1, platform=XP, proxy=Proxy(), command_id=1.0, specificationLevel=0.0, acceptSslCerts=false, processId=2380.0, browserVersion=50.0.1, platformVersion=6.1, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=firefox, takesScreenshot=true, takesElementScreenshot=true, javascriptEnabled=true, platformName=windows_nt}] Session ID: c1e4da76-9f21-45aa-a1b8-f21a9e8dd088
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException
(W3CHttpResponseCodec.java:150)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode
(W3CHttpResponseCodec.java:115)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode
(W3CHttpResponseCodec.java:45)
at org.openqa.selenium.remote.HttpCommandExecutor.execute
(HttpCommandExecutor.java:164)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute
(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute
(RemoteWebDriver.java:637)
at org.openqa.selenium.remote.RemoteWebElement.execute
(RemoteWebElement.java:272)
at org.openqa.selenium.remote.RemoteWebElement.getAttribute
(RemoteWebElement.java:124)
at org.openqa.selenium.support.ui.Select.<init>(Select.java:52)
at AppInformationTest.main(AppInformationTest.java:70) `
While trying to automate (Selecting a dropdown value) with selenium webdriver I ran into this problem.
Tools Versions are*:
Java - 1.8.0_91,
Eclipse - Oxygen Release (4.7.0),
Mozilla Firefox-50.01,
Gecko driver-v0.17.0-win64 ....Please help me to sort out!
It is browser specfic issue , try it with Chrome. Follow this link to see more
Reference Link for your issue

Unable to select from dropdown using "Select", getting element is not visible exception

I am trying to select some values from a dropdown and have tries all the options : selectByIndex, selectByVisibleText, selectByValue but I am unable to select value on the page; tried different waits also but still getting get the below error :
Exception in thread "main" org.openqa.selenium.ElementNotVisibleException:
Element is not visible (WARNING: The server did not provide any stacktrace
information)
Command duration or timeout: 42 milliseconds
Build info: version: '3.0.0-beta3', revision: 'c7b525d', os.name: 'Windows
10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{rotatable=false, raisesAccessibilityExceptions=false,
appBuildId=20160726073904, version=, platform=XP, proxy={}, command_id=1,
specificationLevel=0, acceptSslCerts=false, browserVersion=48.0,
platformVersion=10.0, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384},
browserName=Firefox, takesScreenshot=true, takesElementScreenshot=true,
platformName=Windows_NT, device=desktop}]
Session ID: 83d79d14-527d-4a8e-a05e-01671d7b73f3
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:631)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:284)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:84)
at org.openqa.selenium.support.ui.Select.setSelected(Select.java:324)
at org.openqa.selenium.support.ui.Select.selectByValue(Select.java:201)
at accessingForms.FormElements.main(FormElements.java:39)
Below is the snippet of my code, firefox version 48
driver.get("http://newtours.demoaut.com");
WebDriverWait wait = new WebDriverWait(driver, 10);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.name("userName")));
driver.findElement(By.partialLinkText("here")).click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.name("country")));
System.out.println("wait statement executed");
Select CountryDrpDwn = new Select(driver.findElement(By.name("country")));
System.out.println("found the drop down");
Thread.sleep(1000);
CountryDrpDwn.selectByValue("3");
System.out.println("Selected by value mofo");
Thread.sleep(2000);
CountryDrpDwn.selectByVisibleText("ANTARCTICA ");
System.out.println("Antarctica Selected");
Thanks in advance for help

Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: cannot focus element

I have been trying to use Selenium sendkeys() without success using Chrome. I've researched similar questions here that seemed related without success. I can spawn the URL, invoke buttons (click()) but when I attempt to enter a value within a specific text field I get:
"Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: cannot focus element."
Would appreciate any help. Thank you!
Here's a snippet of code:
WebElement titleBox = driver.findElement(By.xpath("//*[#id='root']/div/div[2]/div/div/div[2]/div[1]"));
titleBox.click();
titleBox.sendKeys("Test Survey Title");
Here's the stack trace:
Starting ChromeDriver 2.29.461585 (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b) on port 43615
Only local connections are allowed.
May 26, 2017 3:42:50 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: cannot focus element
(Session info: chrome=58.0.3029.110)
(Driver info: chromedriver=2.29.461585 (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b),platform=Mac OS X 10.12.5 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 43 milliseconds
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'Enriques-MacBook-Pro.local', ip: '10.0.0.208', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.5', java.version: '1.8.0_131'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.29.461585 (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b), userDataDir=/var/folders/55/jxcw642x4593njd3nnysck_80000gn/T/.org.chromium.Chromium.4miVBB}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=58.0.3029.110, platform=MAC, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]
Session ID: c0d55118bf095a12cb6e105b581b149e
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:671)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:272)
at org.openqa.selenium.remote.RemoteWebElement.sendKeys(RemoteWebElement.java:96)
at LaunchChrome.main(LaunchChrome.java:36)
You can try following code using actions class to have focus on your element before you can interact with it:
WebElement titleBox = driver.findElement(By.xpath("//*#id='root']/div/div[2]/div/div/div[2]/div[1]"));
Actions action = new Actions(driver);
action.moveToElement(titleBox).build().perform();
titleBox.click();
titleBox.sendKeys("Test Survey Title");

org.openqa.selenium.StaleElementReferenceException: Element is no longer attached to the DOM

I'm getting "StaleElementReferenceException" when selecting an option from the dropdown and get it as string. I'm very disappointed with the issue for last two days and I didn't get any best suggestion to sort out my issue. I'm very new to selenium, Please help me to sort out this issue.
public static WebElement prepProduct(WebDriver driver) throws InterruptedException
{
WebDriverWait wait = new WebDriverWait(driver,20);
Boolean enable=driver.findElement(By.xpath(".//*[#id='batch-update-prep-owner']")).isEnabled();
if(enable.TRUE)
{
Select whoPrepsMerchant= new Select(driver.findElement(By.xpath(".//*[#id='prep-items']/tr[2]/td[5]/select")));
whoPrepsMerchant.selectByIndex(new Random().nextInt(whoPrepsMerchant.getOptions().size()));
String merchant=whoPrepsMerchant.getFirstSelectedOption().getText();
Thread.sleep(3000);
String whoPrepsvalue=(driver.findElement(By.xpath(".//*[#id='prep-items']/tr[2]/td[7]/span"))).getText();
System.out.println("outer");
if(merchant.equalsIgnoreCase("Amazon"))
{
System.out.println("inner");
if(!whoPrepsvalue.equalsIgnoreCase("--"))
{
System.out.println("innerone");
Thread.sleep(3000);
driver.findElement(By.xpath(".//*[#id='continue-plan']")).click();
}
}
else
{
if(whoPrepsvalue.equalsIgnoreCase("--"))
{
System.out.println("innertwo");
Thread.sleep(3000);
driver.findElement(By.xpath(".//*[#id='continue-plan']")).click();
}
}
}
else
{
Thread.sleep(3000);
driver.findElement(By.xpath(".//*[#id='continue-plan']")).click();
}
return element;
}
Error Log:
org.openqa.selenium.StaleElementReferenceException: Element is no longer attached to the DOM
Command duration or timeout: 15 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.html
Build info: version: '3.0.0-beta4', revision: '3169782', time: '2016-09-29 10:29:23 -0700'
System info: host: '7531HY1', ip: '10.45.183.77', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=45.4.0, platform=WINDOWS, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 2eb3cd2b-e2e0-4efb-8b4c-3eb08f00ed45
*** Element info: {Using=tag name, value=option}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:636)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:284)
at org.openqa.selenium.remote.RemoteWebElement.findElements(RemoteWebElement.java:203)
at org.openqa.selenium.remote.RemoteWebElement.findElementsByTagName(RemoteWebElement.java:280)
at org.openqa.selenium.By$ByTagName.findElements(By.java:327)
at org.openqa.selenium.remote.RemoteWebElement.findElements(RemoteWebElement.java:179)
at org.openqa.selenium.support.ui.Select.getOptions(Select.java:70)
at org.openqa.selenium.support.ui.Select.getFirstSelectedOption(Select.java:94)
at NAGamma.SellerCentralPOM.prepProduct(SellerCentralPOM.java:85)
at NAGamma.Regression.main(Regression.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:100)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:646)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:811)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1137)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:753)
at org.testng.TestRunner.run(TestRunner.java:607)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:368)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:363)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:321)
at org.testng.SuiteRunner.run(SuiteRunner.java:270)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1284)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1209)
at org.testng.TestNG.runSuites(TestNG.java:1124)
at org.testng.TestNG.run(TestNG.java:1096)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)
Caused by: org.openqa.selenium.StaleElementReferenceException: Element is no longer attached to the DOM
For documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.html
Build info: version: '3.0.0-beta4', revision: '3169782', time: '2016-09-29 10:29:23 -0700'
System info: host: '7531HY1', ip: '10.45.183.77', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_111'
Driver info: driver.version: unknown
at <anonymous class>.fxdriver.cache.getElementAt(resource://fxdriver/modules/web-element-cache.js:9531)
at <anonymous class>.Utils.getElementAt(file:///C:/Users/kesavamp/AppData/Local/Temp/anonymous980588199586178216webdriver-profile/extensions/fxdriver#googlecode.com/components/driver-component.js:9916)
at <anonymous class>.FirefoxDriver.prototype.findElementsInternal_(file:///C:/Users/kesavamp/AppData/Local/Temp/anonymous980588199586178216webdriver-profile/extensions/fxdriver#googlecode.com/components/driver-component.js:11205)
at <anonymous class>.FirefoxDriver.prototype.findChildElements(file:///C:/Users/kesavamp/AppData/Local/Temp/anonymous980588199586178216webdriver-profile/extensions/fxdriver#googlecode.com/components/driver-component.js:11226)
at <anonymous class>.DelayedCommand.prototype.executeInternal_/h(file:///C:/Users/kesavamp/AppData/Local/Temp/anonymous980588199586178216webdriver-profile/extensions/fxdriver#googlecode.com/components/command-processor.js:12698)
at <anonymous class>.DelayedCommand.prototype.executeInternal_(file:///C:/Users/kesavamp/AppData/Local/Temp/anonymous980588199586178216webdriver-profile/extensions/fxdriver#googlecode.com/components/command-processor.js:12703)
at <anonymous class>.DelayedCommand.prototype.execute/<(file:///C:/Users/kesavamp/AppData/Local/Temp/anonymous980588199586178216webdriver-profile/extensions/fxdriver#googlecode.com/components/command-processor.js:12645)
Try this
Declare at the global level
WebDriverWait wait = new WebDriverWait(driver, 5);
Before selecting option from Drop-down
// while the following loop runs, the DOM changes -
// page is refreshed, or element is removed and re-added
wait.until(presenceOfElementLocated(By.id("container-element")));
// now we're good - let's click the element
For selecting option from Drop-down.
driver.findElement(By.id("foo")).click();
You can use:
wait.until(ExpectedConditions.refreshed(ExpectedConditions.visibilityOf(Element)));
Please verify and let me know if this is working fine for you...

PhantomJS selenium NoSuchElementException

I have created a web crawler with Selenium (using selenium-server-standalone-2.47.1.jar) and phantomJs (phantomjs -v returns 1.9.0 on Ubuntu 14.04). The code was working fine with both with FirefoxDriver and PhantomJSDriver on Windows 10, but only works with FirefoxDriver under Ubuntu 14.04.
Sample code below:
public static void main(String[] args) {
DesiredCapabilities DesireCaps = new DesiredCapabilities();
DesireCaps.setCapability("phantomjs.binary.path", "/usr/lib/phantomjs/phantomjs");
WebDriver driver=new PhantomJSDriver(DesireCaps);
String Url = "https://xxx";
driver.get(Url);
WebElement rootWebElement = driver.findElement(By.id("main"));
List<WebElement> parentElements = rootWebElement.findElements(By.tagName("li"));
//243 , 240 (previous)
for (int i = 106; i < parentElements.size(); i++) {
WebElement href =parentElements.get(i).findElement(By.tagName("z"));
if(href!=null){
Scanner scanner = new Scanner(href.getAttribute("href"));
try {
scanner.parseXML(href.getAttribute("href"));
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
If you open the provided URL's source.... you can easily see that the tag with id="main" exists...
Stack Trace:
PhantomJS is launching GhostDriver...
[INFO - 2015-08-13T14:15:57.720Z] GhostDriver - Main - running on port 8677
[INFO - 2015-08-13T14:15:58.361Z] Session [d17a3cc0-41c5-11e5-bedb-6fa39763a2c0] - CONSTRUCTOR - Desired Capabilities: {"phantomjs.binary.path":"/usr/lib/phantomjs/phantomjs"}
[INFO - 2015-08-13T14:15:58.370Z] Session [d17a3cc0-41c5-11e5-bedb-6fa39763a2c0] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.0","driverName":"ghostdriver","driverVersion":"1.0.3","platform":"linux-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
[INFO - 2015-08-13T14:15:58.371Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: d17a3cc0-41c5-11e5-bedb-6fa39763a2c0
Exception in thread "main" org.openqa.selenium.NoSuchElementException: Error Message => 'Unable to find element with id 'main''
caused by Request => {"headers":{"Accept-Encoding":"gzip,deflate","Connection":"Keep-Alive","Content-Length":"29","Content-Type":"application/json; charset=utf-8","Host":"localhost:8677","User-Agent":"Apache-HttpClient/4.4.1 (Java/1.7.0_79)"},"httpVersion":"1.1","method":"POST","post":"{\"using\":\"id\",\"value\":\"main\"}","url":"/element","urlParsed":{"anchor":"","query":"","file":"element","directory":"/","path":"/element","relative":"/element","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/element","queryKey":{},"chunks":["element"]},"urlOriginal":"/session/d17a3cc0-41c5-11e5-bedb-6fa39763a2c0/element"}
Command duration or timeout: 281 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'Vmbox', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'i386', os.version: '3.19.0-25-generic', java.version: '1.7.0_79'
*** Element info: {Using=id, value=main}
Session ID: d17a3cc0-41c5-11e5-bedb-6fa39763a2c0
Driver info: org.openqa.selenium.phantomjs.PhantomJSDriver
Capabilities [{platform=LINUX, acceptSslCerts=false, javascriptEnabled=true, browserName=phantomjs, rotatable=false, driverVersion=1.0.3, locationContextEnabled=false, version=1.9.0, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=false, browserConnectionEnabled=false, proxy={proxyType=direct}, nativeEvents=true, webStorageEnabled=false, driverName=ghostdriver, applicationCacheEnabled=false, takesScreenshot=true}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:348)
at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:389)
at org.openqa.selenium.By$ById.findElement(By.java:215)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:340)
at LinkScanner.main(LinkScanner.java:27)
Caused by: org.openqa.selenium.remote.ScreenshotException: Screen shot has been taken
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'Vmbox', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'i386', os.version: '3.19.0-25-generic', java.version: '1.7.0_79'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:138)
... 6 more
Caused by: org.openqa.selenium.NoSuchElementException: Error Message => 'Unable to find element with id 'main''
caused by Request => {"headers":{"Accept-Encoding":"gzip,deflate","Connection":"Keep-Alive","Content-Length":"29","Content-Type":"application/json; charset=utf-8","Host":"localhost:8677","User-Agent":"Apache-HttpClient/4.4.1 (Java/1.7.0_79)"},"httpVersion":"1.1","method":"POST","post":"{\"using\":\"id\",\"value\":\"main\"}","url":"/element","urlParsed":{"anchor":"","query":"","file":"element","directory":"/","path":"/element","relative":"/element","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/element","queryKey":{},"chunks":["element"]},"urlOriginal":"/session/d17a3cc0-41c5-11e5-bedb-6fa39763a2c0/element"}
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'Vmbox', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'i386', os.version: '3.19.0-25-generic', java.version: '1.7.0_79'
Driver info: driver.version: unknown
Post my comment as answer :)
You need to install PhantomJS 1.9.8 from https://bitbucket.org/ariya/phantomjs/downloads

Categories