WebDriver wait command is failing for Safari on Mac OS - macos

I have script to login to a site and then waiting for home button to get loaded. I have put fluentwait to wait for element to be visible. But WebDriver is not waiting and failing immediately as the home button is not loaded.
I have tried with fluentwait and webdriverwait but none of them are working.
Here is code I am trying.
By usernameInput = By.name("User”);
By passwordInput = By.name("Password”);
By loginButton = By.xpath("//input[#value='Sign In']”);
String URL = “https://demotest.mytest.com/"
WebDriver driver = new SafariDriver();
driver.get(URL);
driver.manage().window().maximize();
setText(usernameInput,”User1");
setText(passwordInput,”User1");
clickOnElement(loginButton);
Wait<WebDriver> wait = new FluentWait<WebDriver>(driver);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[#title='Home']")));
Throws below error -
org.openqa.selenium.WebDriverException:
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48'
System info: host: 'cnparmar-mac', ip: '10.168.104.60', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.6', java.version: '1.8.0_211'
Driver info: org.openqa.selenium.safari.SafariDriver
Capabilities {acceptInsecureCerts: false, browserName: Safari, browserVersion: 12.1.1, javascriptEnabled: true, platform: MAC, platformName: MAC, safari:automaticInspection: false, safari:automaticProfiling: false, safari:diagnose: false, setWindowRect: true, strictFileInteractability: false, webkit:WebRTC: {DisableICECandidateFiltering: false, DisableInsecureMediaCapture: false}}
Session ID: 1257BF8B-335E-4E80-8B08-CB15A77AD648
*** Element info: {Using=xpath, value=//div[#title='Home']}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructo rAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCo nstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException( W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpRes ponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpRes ponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExec utor.java:158)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(Drive rCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.jav a:552)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver .java:323)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWe bDriver.java:428)
at org.openqa.selenium.By$ByXPath.findElement(By.java:353)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver .java:315)
at org.openqa.selenium.support.ui.ExpectedConditions$7.apply(ExpectedCond itions.java:205)
at org.openqa.selenium.support.ui.ExpectedConditions$7.apply(ExpectedCond itions.java:201)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:249)
at sample.Sample.loginAs(Sample.java:64)
at sample.Sample.test1(Sample.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j ava:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess orImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocati onHelper.java:124)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:583)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:719)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:989)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorke r.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:648)
at org.testng.TestRunner.run(TestRunner.java:505)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
at org.testng.SuiteRunner.run(SuiteRunner.java:364)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
at org.testng.TestNG.runSuites(TestNG.java:1049)
at org.testng.TestNG.run(TestNG.java:1017)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
Ideally it should wait for Home button to get visible. but it is failing. This works on Chrome,Firefox, IE, Edge on Windows but only failing on Safari on MAC.

It looks like you are mixing up WebDriverWait and FluentWait classes.
Try using the following instead:
WebDriverWait wait = new WebDriverWait(driver, 15, 100);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[#title='Home']")));

Related

org.openqa.selenium.InvalidSelectorException: Unsupported CSS selector error when using #AndroidFindBy(uiAutomator =

I am trying to automate a scenario in an android application using appium, java. I need to scroll down to an element on the screen to enter a text value. I'm initializing the elements using page factory as shown below.
#AndroidFindBy(uiAutomator = "new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().resourceId(\"com.call4site.handymanservices:id/email\"))")
private WebElement txt_email;
I'm getting a strange error in console as below.
org.openqa.selenium.InvalidSelectorException:
Unsupported CSS selector '*[name='txt_email']'. Reason: 'Error: 'name' is not a valid attribute. Supported attributes are 'checkable, checked, clickable, enabled, focusable, focused, long-clickable, scrollable, selected, index, instance, description, resource-id, text, class-name, package-name''
For documentation on this error, please visit: https://selenium.dev/exceptions/#invalid_selector_exception
Build info: version: '4.6.0', revision: '79f1c02ae20'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '11'
Driver info: io.appium.java_client.android.AndroidDriver
Command: [da3c259c-cf9d-4457-967a-060eadf5f643, findElement {using=css selector, value=*[name='txt_email']}]
Capabilities {appium:app: C:\Users\laksh\Downloads\ha..., appium:appPackage: com.call4site.handymanservices, appium:automationName: uiautomator2, appium:databaseEnabled: false, appium:
desired: {app: C:\Users\laksh\Downloads\ha..., automationName: uiautomator2, deviceName: Android Emulator, platformName: android, platformVersion: 11.0, udid: emulator-5554}, appium:de
viceApiLevel: 30, appium:deviceManufacturer: unknown, appium:deviceModel: Android SDK built for x86, appium:deviceName: emulator-5554, appium:deviceScreenDensity: 560, appium:deviceScr
eenSize: 1440x2560, appium:deviceUDID: emulator-5554, appium:javascriptEnabled: true, appium:locationContextEnabled: false, appium:networkConnectionEnabled: true, appium:pixelRatio: 3.
5, appium:platformVersion: 11, appium:statBarHeight: 84, appium:takesScreenshot: true, appium:udid: emulator-5554, appium:viewportRect: {height: 2308, left: 0, top: 84, width: 1440}, appium:warnings: {}, appium:webStorageEnabled: false, platformName: ANDROID}
Session ID: da3c259c-cf9d-4457-967a-060eadf5f643
at tests.signUpTests.signUpAsNewUser(signUpTests.java:32)
But if I use the following code to initialize the element, then I'm able to scroll down and enter text to it. Has anyone faced this issue?
WebElement txt_email = driver.findElement(AppiumBy.androidUIAutomator("new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().resourceId(\"com.call4site.handymanservices:id/email\"))"));

My WebDriver automatically closes after test, without any methods (tearDown).I am using Spring Boot + Selenium

When I start test It is Okay, but when The test is finished, WebDriver just closes. I am not using tearDown method.Tests are finished succesful, but when I wanted to create #PreDestroy, I got a mistake:
2022-08-18 17:56:17.822 WARN 476 --- [ main]
.s.c.a.CommonAnnotationBeanPostProcessor : Destroy method on bean with name 'homePage' threw
an exception: org.openqa.selenium.NoSuchSessionException: Session ID is null. Using WebDriver
after calling quit()?
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: 'DESKTOP-93EP0G1', ip: '192.168.0.103', os.name: 'Windows 10', os.arch:
'amd64', os.version: '10.0', java.version: '18.0.1.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, getTitle {}]
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 103.0.5060.114,
chrome: {chromedriverVersion: 103.0.5060.134 (8ec6fce403b..., userDataDir:
C:\Users\alexe\AppData\Loca...}, goog:chromeOptions: {debuggerAddress: localhost:52653},
javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform:
WINDOWS, platformName: WINDOWS, proxy: Proxy(), se:cdp: ws://localhost:52653/devtoo...,
se:cdpVersion: 103.0.5060.114, setWindowRect: true, strictFileInteractability: false, t
imeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and
notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true,
webauthn:virtualAuthenticators: true
My config:
#Configuration
public class WebDriverConfig {
#Bean
#ConditionalOnMissingBean
#ConditionalOnProperty(name = "browser", havingValue = "chrome")
#Primary
public WebDriver chromeDriver() {
WebDriverManager.chromedriver().setup();
WebDriver driver = new ChromeDriver();
return driver;
}

Run my Selenium Scripts to test the Web page which is connected via Remote Desktop Connection?

I want to test the Web Pages which is connected through RDC and that web pages can't access from my machine browser, it can be accessed only through RDC.
I wrote my scripts to open the chrome browser on my local machine,
System.setProperty("webdriver.chrome.driver", "C:\selenium-java-
3.1.0\chromedriver_win32\chromedriver.exe");
driver = new ChromeDriver();
How can i write the selenium scripts to connect the browser which is from RDC.
Please someone help me to do this.
This is what it showing me in commandLine
18:29:15.105 INFO - Executing: [new session: Capabilities [{marionette=true, browserName=firefox, version=, platform=WINDOWS}]])
18:29:15.111 INFO - Creating a new session for Capabilities
[{marionette=true, browserName=firefox, version=, platform=WINDOWS}]
18:29:15.119 WARN - Exception thrown
java.util.concurrent.ExecutionException:
org.openqa.selenium.WebDriverException:
java.lang.reflect.InvocationTargetException Build info: version:
'3.4.0', revision: 'unknown', time: 'unknown' System info: host:
'DESKTOP-U53JQ9J', ip: '10.2.50.41', os.name: 'Windows 10', os.arch:
'amd64', os.version: '10.0', java.version: '1.8.0_111' Driver info:
driver.version: unknown
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:183)
at org.openqa.selenium.remote.server.DefaultSession.(DefaultSession.java:119)
at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:95)
Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException Build info: version:
'3.4.0', revision: 'unknown', time: 'unknown' System info: host:
'DESKTOP-U53JQ9J', ip: '10.2.50.41', os.name: 'Windows 10', os.arch:
'amd64', os.version: '10.0', java.version: '1.8.0_111' Driver info:
driver.version: unknown
at org.openqa.selenium.remote.server.FirefoxDriverProvider.callConstructor(FirefoxDriverProvider.java:89)
at org.openqa.selenium.remote.server.FirefoxDriverProvider.newInstance(FirefoxDriverProvider.java:63)
... 1 more Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Caused by: java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property;
for more information, see https://github.com/mozilla/geckodriver. The
latest version can be downloaded from
https://github.com/mozilla/geckodriver/releases
at com.google.common.base.Preconditions.checkState(Preconditions.java:738)
18:29:15.374 WARN - Exception: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more
information, see https://github.com/mozilla/geckodriver. The latest
version can be downloaded from
https://github.com/mozilla/geckodriver/releases 18:29:15.416 INFO -
Executing: [new session: Capabilities [{marionette=true,
browserName=firefox, version=, platform=WINDOWS}]]) 18:29:15.420 INFO
- Creating a new session for Capabilities [{marionette=true, browserName=firefox, version=, platform=WINDOWS}] 18:29:15.430 WARN -
Exception thrown java.util.concurrent.ExecutionException:
org.openqa.selenium.WebDriverException:
java.lang.reflect.InvocationTargetException Build info: version:
'3.4.0', revision: 'unknown', time: 'unknown' System info: host:
'DESKTOP-U53JQ9J', ip: '10.2.50.41', os.name: 'Windows 10', os.arch:
'amd64', os.version: '10.0', java.version: '1.8.0_111' Driver info:
driver.version: unknown
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException Build info: version:
'3.4.0', revision: 'unknown', time: 'unknown' System info: host:
'DESKTOP-U53JQ9J', ip: '10.2.50.41', os.name: 'Windows 10', os.arch:
'amd64', os.version: '10.0', java.version: '1.8.0_111' Driver info:
driver.version: unknown
at org.openqa.selenium.remote.server.FirefoxDriverProvider.callConstructor(FirefoxDriverProvider.java:89)
at org.openqa.selenium.remote.server.FirefoxDriverProvider.newInstance(FirefoxDriverProvider.java:63)
18:29:15.639 WARN - Exception: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more
information, see https://github.com/mozilla/geckodriver. The latest
version can be downloaded from
https://github.com/mozilla/geckodriver/releases 18:29:15.676 WARN -
Exception thrown java.lang.NullPointerException
at java.util.HashMap.putMapEntries(Unknown Source)
at java.util.HashMap.putAll(Unknown Source)
18:29:15.749 WARN - Exception: null java.lang.IllegalStateException:
The path to the driver executable must be set by the
webdriver.gecko.driver system property; for more information, see
https://github.com/mozilla/geckodriver. The latest version can be
downloaded from https://github.com/mozilla/geckodriver/releases
This is my code in eclipse
public void setup() throws Throwable {
// System.setProperty("webdriver.gecko.driver","C:\selenium-java-3.1.0\geckodriver-v0.14.0-win64\geckodriver.exe");
File file = new
File("C:\selenium-java-3.1.0\geckodriver-v0.14.0-win64\geckodriver.exe");
System.setProperty("webdriver.gecko.driver",
file.getAbsolutePath());
DesiredCapabilities cap=DesiredCapabilities.firefox(); cap.setPlatform(Platform.WINDOWS); cap.setBrowserName("firefox");
URL url=new URL("http://192.168.2.98:4444/wd/hub"); WebDriver
driver=new RemoteWebDriver(url, cap);
driver.get("http://learn-automation.com/");
It sounds like you want to execute the tests on a remote machine. you can make this possible via Selenium Grid Server.
With Selenium Grid Server you can set up a node on you remote pc and let that node open a browser.
This node is connected to a hub, the hub will receive the commands and sent them to the node.
Is this what you are looking for?
An example configuration for a hub:
java -jar selenium-server-standalone-<version>.jar -role hub -hubConfig hubConfig.json
Contents of hubConfig.json
{
"_comment" : "Configuration for Hub - hubConfig.json",
"host": ip,
"maxSessions": 5,
"port": 4444,
"cleanupCycle": 5000,
"timeout": 300000,
"newSessionWaitTimeout": -1,
"servlets": [],
"prioritizer": null,
"capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
"throwOnCapabilityNotPresent": true,
"nodePolling": 180000,
"platform": "WINDOWS"
}
An example configuration for a node:
java -jar selenium-server-standalone-<version>.jar -role node -nodeConfig nodeConfig.json
Contents of nodeConfig.json
{
"capabilities":
[
{
"browserName": "opera",
"platform": "WINDOWS",
"maxInstances": 5,
"seleniumProtocol": "WebDriver",
"webdriver.opera.driver": "C:/Selenium/drivers/operadriver.exe",
"binary":"C:/Program Files/Opera/44.0.2510.1159/opera.exe"
},
{
"browserName": "chrome",
"platform": "WINDOWS",
"maxInstances": 5,
"seleniumProtocol": "WebDriver",
"webdriver.chrome.driver": "C:/Selenium/drivers/chromedriver.exe",
"binary":"C:/Program Files/Google/Chrome/Application/chrome.exe"
},
{
"browserName": "firefox",
"platform": "WINDOWS",
"maxInstances": 5,
"seleniumProtocol": "WebDriver",
"webdriver.gecko.driver": "C:/Selenium/drivers/geckodriver.exe",
"binary":"C:/Program Files/Mozilla Firefox/firefox.exe"
}
],
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 5,
"port": 5555,
"register": true,
"registerCycle": 5000,
"hub": "http://localhost:4444",
"nodeStatusCheckTimeout": 5000,
"nodePolling": 5000,
"role": "node",
"unregisterIfStillDownAfter": 60000,
"downPollingLimit": 2,
"debug": false,
"servlets" : [],
"withoutServlets": [],
"custom": {}
}
Drivers downloads
Place all the drivers in your path variable
Chrome driver
FireFox driver
Microsoft Edge driver
Opera driver
Browsers downloads
Chrome
FireFox
Microsoft Edge
Opera
Selenium cannot connect to the remote server through RDP.
You'll need to set up VPN connection between services or something like ngrok

Keyboard enable exception on mac

Exception in thread "main" org.openqa.selenium.WebDriverException:
Could not locate keyboard. (WARNING: The server did not provide any
stacktrace information) Command duration or timeout: 23.96 seconds
Build info: version: '2.53.0', revision: '35ae25b', time:
'2016-03-15 16:57:40' System info: host: 'QAs-iMac.local', ip:
'192.168.0.128', os.name: 'Mac OS X', os.arch: 'x86_64', os.version:
'10.11.4', java.version: '1.8.0_91' Driver info:
org.openqa.selenium.remote.RemoteWebDriver Capabilities
[{app=/Users/qa/Desktop/QA Team /pankaj/mac/Boku-1.ipa,
appPackage=com.boku, networkConnectionEnabled=false,
appWaitActivity=ui.activities.TutorialActivity,
databaseEnabled=false, deviceName=iPhone 6, fullReset=true,
platform=MAC, appActivity=ui.activities.SplashActivity,
showIOSLog=true, appium-version=1.5.1,
desired={app=/Users/qa/Desktop/QA Team /pankaj/mac/Boku-1.ipa,
appPackage=com.boku, appActivity=ui.activities.SplashActivity,
showIOSLog=true, appium-version=1.5.1, platformVersion=9.3.1,
appWaitActivity=ui.activities.TutorialActivity, platformName=iOS,
udid=a87a03d1680a6cfd142829db9b01da43019b278f, deviceName=iPhone 6,
fullReset=true}, platformVersion=9.3.1, webStorageEnabled=false,
locationContextEnabled=false, browserName=, takesScreenshot=true,
javascriptEnabled=true, platformName=iOS,
udid=a87a03d1680a6cfd142829db9b01da43019b278f}] Session ID:
89125084-e649-40f1-ba95-a738ba417521 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
org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:327)
at
org.openqa.selenium.remote.RemoteWebElement.sendKeys(RemoteWebElement.java:122)
at Boku.Bokumain.main(Bokumain.java:188)
I am facing this issue for sendkeys().
Try to hide keboard by this way :
capabilities.setCapability("unicodekeyboard", true);
capabilities.setCapability("resetkeyboard", true);

phpunit/seleniumRC/selenium2testcase elements off page unclickable in firefox

So my company is asking me to expand my automated tests for more support of other browsers, namely firefox and safari.
My original suite was designed in Chrome and for the most part, it works pretty flawlessly, and exposes bugs immediately -- a very helpful tool indeed.
I have about 80 testcases that require page navigation and clicks on dynamic urls. This works fine for me up until testcase 7 (and above) which the element I need to click is off the page. How do I know this is the root problem? Because if I put a sleep before the click command and manually scroll the page during firefox execution, the click actually occurs, and I get navigated to the correct page...
Does anyone have a solution for this? I could have swore SeleniumTestCase2 was suppose to remove this issue? I'll post my code below but honestly it works in chrome driver, but not in firefox.
Firefox v43.0 and Selenium jar 4.48.2
protected function selectModule($module = NULL)
{
$this->module = $module;
$this->module = strtolower($this->module);
$this->byID($this->module)->click();
$this->assertEquals($this->url(SOMECONSTANTEXPECTEDURL), $this->byXpath('/html/head/base')->text());
fwrite(STDERR, print_r(__METHOD__."()->$this->module method completed.".PHP_EOL, TRUE));
return $this;
}
Full Stack trace (as requested):
19:44:56.100 INFO - Executing: [find element: By.id: ggk5y3m1])
19:44:56.106 INFO - Done: [find element: By.id: ggk5y3m1]
19:44:56.124 INFO - Executing: [find element: By.id: ggk5y3m1])
19:44:56.131 INFO - Done: [find element: By.id: ggk5y3m1]
19:44:56.142 INFO - Executing: [click: 6 [[FirefoxDriver: firefox on WINDOWS (a9
587de1-e110-454c-b6cb-581612242081)] -> id: ggk5y3m1]])
19:44:56.306 INFO - Done: [click: 6 [[FirefoxDriver: firefox on WINDOWS (a9587de
1-e110-454c-b6cb-581612242081)] -> id: ggk5y3m1]]
19:44:56.308 INFO - Executing: [find element: By.id: ff_frame442])
19:44:57.334 WARN - Exception thrown
org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":
"id","selector":"ff_frame442"}
Command duration or timeout: 23 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/
no_such_element.html
Build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:59:12'
System info: host: 'testing', ip: '10.1.20.115', os.name: 'Windows 7', os.arch:
'x86', os.version: '6.1', java.version: '1.8.0_66'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true
, databaseEnabled=true, version=43.0, platform=WINDOWS, nativeEvents=false, acce
ptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserNam
e=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=tru
e}]
Session ID: a9587de1-e110-454c-b6cb-581612242081
*** Element info: {Using=id, value=ff_frame442}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.
java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHa
ndler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.ja
va:647)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDrive
r.java:353)
at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebD
river.java:403)
at org.openqa.selenium.By$ById.findElement(By.java:218)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDrive
r.java:345)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver$2.invoke(Even
tFiringWebDriver.java:102)
at com.sun.proxy.$Proxy1.findElement(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver.findElement(E
ventFiringWebDriver.java:187)
at org.openqa.selenium.remote.server.handler.FindElement.call(FindElemen
t.java:48)
at org.openqa.selenium.remote.server.handler.FindElement.call(FindElemen
t.java:1)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession
.java:176)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.openqa.selenium.NoSuchElementException: Unable to locate element:
{"method":"id","selector":"ff_frame442"}
For documentation on this error, please visit: http://seleniumhq.org/exceptions/
no_such_element.html
Build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:59:12'
System info: host: 'testing', ip: '10.1.20.115', os.name: 'Windows 7', os.arch:
'x86', os.version: '6.1', java.version: '1.8.0_66'
Driver info: driver.version: unknown
at <anonymous class>.FirefoxDriver.prototype.findElementInternal_(file:/
//C:/Users/SIMON~1.KYG/AppData/Local/Temp/anonymous2462846570487533916webdriver-
profile/extensions/fxdriver#googlecode.com/components/driver-component.js:10659)
at <anonymous class>.FirefoxDriver.prototype.findElement(file:///C:/User
s/SIMON~1.KYG/AppData/Local/Temp/anonymous2462846570487533916webdriver-profile/e
xtensions/fxdriver#googlecode.com/components/driver-component.js:10668)
at <anonymous class>.DelayedCommand.prototype.executeInternal_/h(file://
/C:/Users/SIMON~1.KYG/AppData/Local/Temp/anonymous2462846570487533916webdriver-p
rofile/extensions/fxdriver#googlecode.com/components/command-processor.js:12534)
at <anonymous class>.DelayedCommand.prototype.executeInternal_(file:///C
:/Users/SIMON~1.KYG/AppData/Local/Temp/anonymous2462846570487533916webdriver-pro
file/extensions/fxdriver#googlecode.com/components/command-processor.js:12539)
at <anonymous class>.DelayedCommand.prototype.execute/<(file:///C:/Users
/SIMON~1.KYG/AppData/Local/Temp/anonymous2462846570487533916webdriver-profile/ex
tensions/fxdriver#googlecode.com/components/command-processor.js:12481)
19:44:57.338 WARN - Exception: Unable to locate element: {"method":"id","selecto
r":"ff_frame442"}
For documentation on this error, please visit: http://seleniumhq.org/exceptions/
no_such_element.html
Build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:59:12'
System info: host: 'testing', ip: '10.1.20.115', os.name: 'Windows 7', os.arch:
'x86', os.version: '6.1', java.version: '1.8.0_66'
Driver info: driver.version: unknown
Thank you #Drets
Code that solved it (a wait for both moving to the damned element and then a wait before clicking it, SMH....)
self::waitforID($this->module);
$this->moveto($this->byID($this->module));
self::waitforID($this->module);
$this->byID($this->module)->click();
//
...
//
protected function waitforID($ID)
{
$this->waitUntil(function () use ($ID)
{
if ($this->byId($ID))
{
return true;
}
sleep(1);
return null;
}, 120000);
}

Resources