This repository has been archived by the owner. It is now read-only.

Sendkeys throws InvalidOperationException on Safari #4996

Closed
lukeis opened this Issue Mar 4, 2016 · 37 comments

Comments

Projects
None yet
1 participant
@lukeis
Copy link
Member

lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 4996

I've encountered a problem that seem to be specific to Safari. 
My setup is a Grid2 hub providing Chrome, IE, Firefox, Opera and Safari.

I need to go to http://psys.au.dk/tphd/interne-testsider/portals-managers/ and login.
Further detail provided below. This works flawlessly on any browser by Safari. I'm
running the latest Selenium C# bindings, latest stand-alone server and extension for
Safari. 

I initialize the driver in my setup method: 

Uri gridhub = new Uri("http://localhost:4444/wd/hub");
DesiredCapabilities safari = DesiredCapabilities.Safari();
driver = new RemoteWebDriver(gridhub, safari);

The test code looks like this:

driver.Navigate().GoToUrl("http://psys.au.dk/tphd/interne-testsider/portals-managers/");
driver.FindElement(By.Name("j_username")).SendKeys(username);
driver.FindElement(By.Name("j_password")).SendKeys(password);
driver.FindElement(By.Name("Login")).Click();

It sends the username, but when it tries to send the password it throws InvalidOperationException.
The exact stacktrace is: 

System.InvalidOperationException: The error did not contain a message.
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line
999
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute,
Dictionary`2 parameters) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line
841
   at OpenQA.Selenium.Remote.RemoteWebElement.SendKeys(String text) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebElement.cs:line
300
   at TestProject.SafariTest.NavigateTest() in C:\Projects\Initial Test project\TestProject\SafariTest.cs:line
44

Line 44 is: driver.FindElement(By.Name("j_password")).SendKeys(password);

Reported by Mikkelpkaas on 2013-01-10 14:09:58

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

It also fails when using: driver = new SafariDriver() - although with a different errormessage,
that I'm not quite able to interpret:

OpenQA.Selenium.StaleElementReferenceException: Unable to locate encoded element: html
> body:nth-child(2) > div > div:nth-child(6) > div:nth-child(2) > div > div > div >
form:nth-child(2) > table:nth-child(3) > tbody > tr:nth-child(2) > td > table > tbody
> tr > td > fieldset > table:nth-child(2) > tbody > tr:nth-child(2) > td:nth-child(2)
> input
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line
989
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute,
Dictionary`2 parameters) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line
841
   at OpenQA.Selenium.Remote.RemoteWebElement.SendKeys(String text) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebElement.cs:line
300
   at TestProject.SafariTest.NavigateTest() in C:\Projects\Initial Test project\TestProject\SafariTest.cs:line
45

Reported by Mikkelpkaas on 2013-01-10 14:14:13

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

Hi Mikkel,

I seem to be seeing similar issue to you - staleElementReferenceException trying to
interact with a password field using safariDriver -> I added a comment to the end of
Issue 2915 and am awaiting a response.

Caroline

Reported by cazburg on 2013-01-15 12:30:24

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by barancev on 2013-01-17 20:48:45

  • Labels added: Browser-Safari
@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by jmleyba on 2013-01-18 00:29:27

  • Labels added: Component-WebDriver
  • Labels removed: Status-Untriaged
@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

 Mikkelpkaas,

I'm not able to reproduce this.  I was able to enter text into the username and password
fields without error:

driver.get("http://psys.au.dk/tphd/interne-testsider/portals-managers/");
driver.findElement(By.name("j_username")).sendKeys('username');
driver.findElement(By.name("j_password")).sendKeys('password');
driver.findElement(By.name("Login")).click();

Do you have a reduced test case that reproduces the issue?

Reported by jmleyba on 2013-01-18 23:32:27

  • Status changed: NeedsClarification
@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

Using the newest version of the safari extension downloaded from Github (btw, seem like
the go.bat doesn't compile the extension anymore), I'm still getting the error.
I've made a reduced version here: http://daimi.au.dk/~mikkelpk/Portals-Managers.htm
I'm still seeing the same issue when I attempt to SendKeys to the password field.

Right now my testcase looks like this:
{
            driver.Navigate().GoToUrl("http://daimi.au.dk/~mikkelpk/Portals-Managers.htm");
            IWebElement unfield = driver.FindElement(By.Name("j_username"));
            TestLog.WriteLine("Unfield: " + unfield.GetAttribute("Name"));
            unfield.SendKeys(username);
            IWebElement pwfield = driver.FindElement(By.Name("j_password"));
            TestLog.WriteLine("pwfield: " + pwfield.GetAttribute("Name"));
            pwfield.SendKeys(password);
            driver.FindElement(By.Name("Login")).Click();
            Thread.Sleep(TimeSpan.FromSeconds(3));
        }

It prints out j_username and j_password just fine, but when I attempt to SendKeys I'm
getting the following exception:

OpenQA.Selenium.StaleElementReferenceException: Unable to locate encoded element: html
> body:nth-child(2) > div > div > div:nth-child(2) > div > div > div > form:nth-child(2)
> table:nth-child(3) > tbody > tr:nth-child(2) > td > table > tbody > tr > td > fieldset
> table:nth-child(2) > tbody > tr:nth-child(2) > td:nth-child(2) > input
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line
989
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute,
Dictionary`2 parameters) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line
841
   at OpenQA.Selenium.Remote.RemoteWebElement.SendKeys(String text) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebElement.cs:line
300
   at TestProject.SafariTest.NavigateTest() in C:\Projects\Initial Test project\TestProject\SafariTest.cs:line
48

No other browser I've tested with have had any issues with this code. Let me know if
you need more information.

Reported by Mikkelpkaas on 2013-01-21 11:05:45

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

I've got the same problem and it is reproducing consistently, in Safari only. 

I'm using the same setup as Mikkelpkaas, which is Grid2 that provides several browsers.
Note that I can reproduce it for the URL that Mikkelpkaas provided too.

The StaleElementReferenceError is always thrown when setting the password field to
a value. 
Please see the sample Ruby script attached. Note there are logs attached too.

Details:

selenium-standalone v.2.29.0, built on 25th of Jan, 2013 from revision 9755f89
Safari 5.1.7 (7534.57.2)
selenium-webdriver v.2.29.0
watir-webdriver v.0.6.2

Is there any way I can help with troubleshooting this? 

Thanks,
Iuliu

Reported by iuliu.pascaru on 2013-01-25 16:06:30


- _Attachment: [safari-login.rb](https://storage.googleapis.com/google-code-attachments/selenium/issue-4996/comment-7/safari-login.rb)_ - _Attachment: [script_exception_log.txt](https://storage.googleapis.com/google-code-attachments/selenium/issue-4996/comment-7/script_exception_log.txt)_ - _Attachment: [grid_node_log-demo23.dcmsys.com.txt](https://storage.googleapis.com/google-code-attachments/selenium/issue-4996/comment-7/grid_node_log-demo23.dcmsys.com.txt)_ - _Attachment: [grid_node_log-daimi.au.dk.txt](https://storage.googleapis.com/google-code-attachments/selenium/issue-4996/comment-7/grid_node_log-daimi.au.dk.txt)_
@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

Just out of curiosity, wonder if this could be worked around by manually setting the
value of the field using Javascript or something similar:

String javascriptCode = "arguments[0].value = \"text to type in\"";

and pass the (password) field WebElement as the argument to the javascript code in
JavascriptExecutor.

Reported by mangaroo on 2013-01-28 20:58:47

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

FYI, I just tried out my comment 8 with test site in comment 6. Passing in a WebElement
as argument, following Java debugger, the element is passed correctly but eventually
in the javascript execution, it fails to execute properly and returns the StaleElementReferenceException
mentioned earlier in this issue. If I ran test w/o debugger to step through the code,
I see NullPointerException.

And interestingly, if I accessed the element directly through the DOM from javascript
rather than pass in WebElement argument like this line of javascript code:

document.getElementsByName('j_password')[0].value = 'test';

You see the field set w/ some value (*** of course), read back the value, lo and behold,
it is 'test'. Seems WebDriver is doing something differently than direct DOM access
that's causing this issue.

So it's not just a matter of sendKeys but setting value of elements in certain cases.

So there may be a workaround as I mentioned above, but that mostly works when you define
locators by ID or name. It will be hard to workaround when you need XPath or CSS, unless
you inject jQuery/Sizzle, etc.

Reported by mangaroo on 2013-01-28 21:40:35

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

I haven't had a chance to look at this on Safari 5.1.7, but it sounds similar to a problem
another dev was having with our own test suite.

Basically, the element cache is maintained in a separate JS context from the page's
JS.  The driver uses CSS selectors to reference DOM elements when passing messages
around.  It appears that on Safari 5.1.7 these selectors aren't reliable.

We used to use XPath, but had trouble with SVG elements (see issue 4676).  I'll try
simplifying the CSS by setting a tracer attribute on the element.

Reported by jmleyba on 2013-01-30 04:06:46

  • Status changed: Accepted
@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

Issue 5166 has been merged into this issue.

Reported by jmleyba on 2013-03-05 05:04:29

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

Issue 5284 has been merged into this issue.

Reported by jmleyba on 2013-03-05 05:05:16

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

I am facing a similar issue with this . Did someone find a workaround yet? 

These are the nunit logs that I am seeing. 

SeleniumQCServicesTest.TestClassName <SafariDriver>.Test:
SetUp : OpenQA.Selenium.StaleElementReferenceException : Unable to locate encoded element:
html > body:nth-child(2) > div > form:nth-child(2) > section > div > div > span:nth-child(8)
> input

at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2
parameters)
at OpenQA.Selenium.Remote.RemoteWebElement.SendKeys(String text)
at SeleniumProject.Common.Login(IWebDriver driver, String userName, String password)

Reported by saswatpatnaik on 2013-03-05 22:47:05

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

You can't work around it, it's a bug inside the SafariDriver (or rather, a bug in Safari
5.1.7 that the SD doesn't handle).  I know how to fix it, just haven't had a chance
to.  Hope to get to it this week.

Reported by jmleyba on 2013-03-05 22:50:14

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

I seemed to be able to workaround it, but only if you can define the locator/element
by ID/name/classname and not XPath/CSS. It seems to work if you set the value directly
using native javascript DOM access instead of the usual findElement methods followed
by sendKeys. See comment 9.

Reported by mangaroo on 2013-03-05 23:01:20

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

I am having similar problem when try to do the following:

    driver.findElement( By.id( "securityAnswer1" ) ).sendKeys( securityAnswer1 );

I am using selenium-server-standalone-2.31.0.jar
Browser Name: safari
Browser Version: 5.1.7

   [junit] Unable to locate encoded element: html > body:nth-child(2) > div > div >
div:nth-child(2) > div > div:nth-ch
ld(6) > form > div:nth-child(2) > div > p:nth-child(4) > input:nth-child(2) (WARNING:
The server did not provide any st
cktrace information)
   [junit] Command duration or timeout: 9 milliseconds
   [junit] For documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.html

   [junit] Build info: version: '2.31.0', revision: '1bd294d', time: '2013-02-27 20:52:59'
   [junit] System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version:
'1.6.0_29'
   [junit] Session ID: null
   [junit] Driver info: org.openqa.selenium.safari.SafariDriver
   [junit] Capabilities [{platform=WINDOWS, javascriptEnabled=true, cssSelectorsEnabled=true,
secureSsl=true, browserNa
e=safari, takesScreenshot=true, version=5.1.7}]
   [junit] org.openqa.selenium.StaleElementReferenceException: Unable to locate encoded
element: html > body:nth-child(
) > div > div > div:nth-child(2) > div > div:nth-child(6) > form > div:nth-child(2)
> div > p:nth-child(4) > input:nth-
hild(2) (WARNING: The server did not provide any stacktrace information)
   [junit] Command duration or timeout: 9 milliseconds
   [junit] For documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.html

   [junit] Build info: version: '2.31.0', revision: '1bd294d', time: '2013-02-27 20:52:59'
   [junit] System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version:
'1.6.0_29'
   [junit] Session ID: null
   [junit] Driver info: org.openqa.selenium.safari.SafariDriver
   [junit] Capabilities [{platform=WINDOWS, javascriptEnabled=true, cssSelectorsEnabled=true,
secureSsl=true, browserNa
e=safari, takesScreenshot=true, version=5.1.7}]
   [junit]     at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
   [junit]     at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:187)
   [junit]     at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
   [junit]     at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
   [junit]     at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:268)
   [junit]     at org.openqa.selenium.remote.RemoteWebElement.sendKeys(RemoteWebElement.java:89)


Reported by H0000H on 2013-03-06 17:02:16

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

This issue was updated by revision 3191d6a5af87.

The underlying issue with SafariDriver and sendKeys is fixed, but I still
need to publish a new prebuilt.  Expect this fix to be available in the
2.32.0 release.

Reported by jmleyba on 2013-03-08 21:54:48

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

revision 27b1e3157569 has a new prebuilt SafariDriver, so I'm marking this fixed.

Reported by jmleyba on 2013-03-10 16:25:34

  • Status changed: Fixed
@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

I am using selenium V2.31 and still facing the same issue & same error (same as the
one in the comment# 1) on Safari browser 

Reported by venkat.gangineni on 2013-03-25 13:55:06

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

@19, you should either wait for v2.32 as indicated above or pull down the repository
and get the latest prebuilt for Safari (or build it yourself).

Reported by arran.huxtable on 2013-03-25 14:51:30

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

Hi I am using v 2.32.0 and I am getting the webDriverException "undefined is not a function"
for sendKeys() only in one application.But for the other application which is just
the login screen (credentioals) to enter in the application,sendKeys are working fine.I
am not understanding if this is the App issue,Safari issue,Safari-Driver issue or Web
Driver issue.Please clarify and lets us know the work around until it fixed.Direct
writing using javaScriptExecutor is also not working.

Everything was working fine with 2.29 but now it is not working after reverting back
to 2.29.

System Info :

OS:Mac 10.8
Browser :Safari 6.0.3
WebDriver :2.32

Reported by madhu.kusumakar on 2013-04-18 18:19:40

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

I am using selenium 2.33.0, still getting the same issue:
org.openqa.selenium.StaleElementReferenceException: Unable to locate encoded element:

Expect the fix in the coming release :)

OS: Mac 10.6.8
Safari 5.1.7  
Selenium 2.33.0

Reported by lightfyq on 2013-06-20 03:45:33

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

I am using selenium 2.33.0, still getting the same issue:
org.openqa.selenium.StaleElementReferenceException: 
Unable to locate encoded element:
on Windows 7
Safari 5.1.7


Reported by sakshi@synaptitudeconsulting.com on 2013-09-09 21:13:53

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

I have the same problem now, but just one month ago it was working good.
Now after some changes IE, Chrome, Firefox are OK, but Safari gives me periodicaly
'ungandled WebKit2WebProcess.exe' exception and on Safari during the login there is
no problem with login name on sendKeys. But on ssn/password text element selenium can
click() and clear() with no problem and gives the exception Unable to locate encoded
element on sendKeys(). I cannot find work around...

Reported by gelfer on 2013-09-17 23:04:22

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

I try to nerrow it down and found       
                elementSSN.click();
        elementSSN.clear();
        elementSSN.sendKeys(ssNumber); !!! Passing to set the text

        elementZIP.click();
        elementZIP.clear();
        elementZIP.sendKeys(zipNum.trim()); ???? exception on this step

>>>>>>>>>>>>>>> Now if I change the steps and sendKeys to xipNum first and then ssNumber,
it's failing on second field which was passing as a first element:

        elementZIP.click();
        elementZIP.clear();
        elementZIP.sendKeys(zipNum.trim()); !!! now passing

                elementSSN.click();
        elementSSN.clear();
        elementSSN.sendKeys(ssNumber); ???? exception on this step

Any ideas???????? Need Help!!!

Reported by gelfer on 2013-09-17 23:23:55

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

What does the DOM look around those elements for the two order of commands?  Are they
inside a form?

You can get the HTML for a subset of the DOM with:

String getOuterHtml(WebElement element) {
  return (String) ((JavascriptExecutor) driver).executeScript(
      "return new XMLSerializer().serializeToString(arguments[0]);",
      element);
}

Reported by jmleyba on 2013-09-18 01:04:14

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

Yes they are in the form. Basicaly it looks like:

<form action="/FBLoanStatus/" method="post" novalidate="novalidate"><div id="divLogin">

    <div id="divLogin">
        ...
    <input autocomplete="off" data-val="true" 
data-val-regex="Please enter valid  loan number.<br/>"  
data-val-regex-pattern="^[0-9]{10}" 
data-val-required="Please enter valid loan number.<br/>" 
id="txtlnkey" maxlength="10"    
name="LoanKey" 
style="width:130px;" type="text" value="">      

    <input autocomplete="off" data-val="true" .....
    <input autocomplete="off" data-val="true" .....

    <input id="btnGetStatus" type="button" value="GET MY LOAN STATUS" ....

Reported by gelfer on 2013-09-18 23:13:33

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

I am also getting this error using Windows 8 and Safari 5.1.7.  My tests run fine in
IE, FF and Chrome.

Reported by owenfletcher on 2013-10-01 12:24:15

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

Anybody knows a workaround for this issue? I'm stuck here.

Reported by dungdangphan on 2013-10-14 22:48:35

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

See my comment #9 for one workaround option.

And another FYI, while I didn't mention it earlier and though I have not tested to
verify for Safari, you could use the workaround with XPath and CSS locators as well.
But for these two cases, you may need additional javascript code to execute to use
them, as mentioned here:

http://autumnator.wordpress.com/2013/05/02/testing-xpath-and-css-locators-firepath-style-across-browsers/

Reported by mangaroo on 2013-10-15 01:43:33

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

Why is this marked as fixed/closed as of March 2013 if the problem is still occurring
with the latest version of Selenium/Safari driver (2.5.0)?  I have a simple WebDriver
Java test that clears a text field, then sets its text.  It has always been working
fine with Chrome, FireFox and IE.  The other day I added Safari (v6.1.5, OS X 10.8.5)
into the mix and about 50% of the time the test fails on just the Safari run with a
StaleElementReferenceException.  I even made two methods: IsElementPresent that catches
the StaleElementReferenceException and WaitForElement which uses the former method
to wait until the element is not stale, but even that doesn't work as the StaleElementReferenceException
is thrown the very next line of code after WaitForElement where I clear the text.

Reported by dprantl on 2014-07-14 19:51:14

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

@dprantl:
1) The latest Selenium version is 2.42 at the moment, not 2.5.0
2) Without a sample page and a sample executable scenario your report is non-actionable.

Reported by barancev on 2014-07-14 19:59:51

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

I'm sorry, you are correct, I am using the 2.42.2 Java version.  I will attempt to come
up with a sample scenario to highlight this.

Reported by dprantl on 2014-07-14 20:35:53

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

I am on 2.42 and am still experiencing this problem. I am getting the following error
when I try to do a Keys.ENTER or Keys.RETURN on a screen:

WebDriverException: Message: u'Unknown command: {"id":"vsbjm4dowiw7","name":"sendKeysToActiveElement","parameters":{"value":["\ue007"]}}
(WARNING: The server did not provide any stacktrace information)\nCommand duration
or timeout: 14 milliseconds\nBuild info: version: \'2.33.0\', revision: \'4e90c97\',
time: \'2013-05-22 15:32:38\'\nSystem info: os.name: \'Mac OS X\', os.arch: \'x86_64\',
os.version: \'10.9\', java.version: \'1.7.0_45\'\nSession ID: null\nDriver info: org.openqa.selenium.safari.SafariDriver\nCapabilities
[{platform=MAC, javascriptEnabled=true, cssSelectorsEnabled=true, secureSsl=true, browserName=safari,
takesScreenshot=true, version=7.0}]' ; Stacktrace: 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0 (NativeConstructorAccessorImpl.java:-2)
    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:191)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed (ErrorHandler.java:145)
    at org.openqa.selenium.remote.RemoteWebDriver.execute (RemoteWebDriver.java:554)
    at org.openqa.selenium.remote.RemoteExecuteMethod.execute (RemoteExecuteMethod.java:34)
    at org.openqa.selenium.remote.RemoteKeyboard.sendKeys (RemoteKeyboard.java:35)
    at org.openqa.selenium.support.events.internal.EventFiringKeyboard.sendKeys (EventFiringKeyboard.java:43)
    at org.openqa.selenium.remote.server.handler.interactions.SendKeyToActiveElement.call
(SendKeyToActiveElement.java:53)
    at org.openqa.selenium.remote.server.handler.interactions.SendKeyToActiveElement.call
(SendKeyToActiveElement.java:1)
    at java.util.concurrent.FutureTask.run (FutureTask.java:262)
    at org.openqa.selenium.remote.server.DefaultSession$1.run (DefaultSession.java:169)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:615)
    at java.lang.Thread.run (Thread.java:744) 

Reported by curtis.salisbury on 2014-07-29 20:31:14

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

@comment 34:

sendKeysToActiveElement is part of the interactions API and is not implemented in Safari
yet.  See:

https://code.google.com/p/selenium/issues/detail?id=4136

Reported by jmleyba on 2014-07-29 20:34:12

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

We are facing the same issue with FF 34.0.5 and latest web drivers.

This line of code :

IF(IsAlertPresent())
   driver.SwitchTo().Alert().Accept();

Raises this type of exception :
Expected: null But was: <System.InvalidOperationException: a.document.getElementsByTagName(...)[0].getButton
is not a function at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response
errorResponse) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute,
Dictionary`2 parameters) at DecosAdminCommonLibrary.DecosAdminGlobal.RecycleApplicationPool()
in d:\Local Sources\JOIN Test Automation\Decos JOIN Test Automation\Dev\Selenium\D5\DecosSeleniumAutomation\DecosAdminCommonLibrary\DecosAdminGlobal.cs:line
467> at DecosAdminCommonLibrary.DecosAdminGlobal.RecycleApplicationPool() in d:\Local
Sources\JOIN Test Automation\Decos JOIN Test Automation\Dev\Selenium\D5\DecosSeleniumAutomation\DecosAdminCommonLibrary\DecosAdminGlobal.cs:line
488 at DecosPortalTest.DecosPortalTest.Chapter04_02() in d:\Local Sources\JOIN Test
Automation\Decos JOIN Test Automation\Dev\Selenium\D5\DecosSeleniumAutomation\DecosPortalTest\DecosPortalTest.cs:line
216 

Please provide help.
Many thanks in advanced.

Reported by shashank28raut on 2015-03-27 09:39:07

@lukeis

This comment has been minimized.

Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by luke.semerau on 2015-09-17 18:16:33

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this Mar 4, 2016

@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.