Re: Issue 971 in selenium: SendKeys with long unicode characters cause firefox hung.

537 views
Skip to first unread message

sele...@googlecode.com

unread,
Jan 11, 2011, 4:10:55 AM1/11/11
to selenium-deve...@googlegroups.com

Comment #9 on issue 971 by MaGonglei: SendKeys with long unicode characters
cause firefox hung.
http://code.google.com/p/selenium/issues/detail?id=971

Finally,I have sometime tried the Java.
There is no this bug to firefox for java.

other browsers:
IE works fine both in .net and java;
Chrome some other bugs in both .net and java,maybe the OS problem, it seems
that somebody have reported, I'll check it.

For my situation:

selenium: selenium-java-2.0b1
Windows 7 64bit
Java: jre-se 1.6
My java code:
public static void main(String[] args) {

System.setProperty("webdriver.firefox.bin",
"D:/Program Files (x86)/Mozilla Firefox/firefox.exe");

FirefoxDriver driver = new FirefoxDriver();
// ChromeDriver driver = new ChromeDriver();
// InternetExplorerDriver driver = new InternetExplorerDriver();
driver.navigate().to("http://www.google.com");

WebElement googleKeyWord = driver

.findElementByXPath("//*[@id='body']/center/form/table/tbody/tr/td[2]/div/input");

//"谷歌" means "google"
for (int i = 0; i < 100; i++) {
googleKeyWord.sendKeys(i + "谷歌");

}




sele...@googlecode.com

unread,
Jan 11, 2011, 6:09:17 AM1/11/11
to selenium-deve...@googlegroups.com

Comment #10 on issue 971 by james.h....@gmail.com: SendKeys with long
unicode characters cause firefox hung.
http://code.google.com/p/selenium/issues/detail?id=971

Please clarify this for me: the problem does or does not happen with the
Java code you posted above?

sele...@googlecode.com

unread,
Jan 11, 2011, 8:46:01 AM1/11/11
to selenium-deve...@googlegroups.com

Comment #11 on issue 971 by MaGonglei: SendKeys with long unicode

No problem for java.

sele...@googlecode.com

unread,
Jan 13, 2011, 1:49:53 AM1/13/11
to selenium-deve...@googlegroups.com

Comment #12 on issue 971 by MaGonglei: SendKeys with long unicode
I made another 2 test to make sure the point.

1.Using the Japanese word "グーグル" (google) to try the .net code, I met
the same problem as the Chinese word "谷歌".

2.I set up the Java selenium server,and then use the .net code to use the
local java server to run the firefox. I didn't met the unicode problem.
My .net code using Java selenium server:

selenium-server-standalone-2.0b1.jar

static void Main(string[] args)
{
var driver = new RemoteWebDriver(DesiredCapabilities.Firefox());
driver.Navigate().GoToUrl("http://www.google.com");

var searchWord = driver.FindElementByName("q");

//Chinese word "谷歌" means "google"
for (int i = 0; i < 50; i++)
{
searchWord.SendKeys(string.Format("{0}谷歌", i));
}

searchWord.SendKeys("over");

driver.Quit();
}

So I believe the problem must be in the code for firefox of .net.


sele...@googlecode.com

unread,
Jan 13, 2011, 10:23:11 AM1/13/11
to selenium-deve...@googlegroups.com

Comment #13 on issue 971 by james.h....@gmail.com: SendKeys with long
unicode characters cause firefox hung.
http://code.google.com/p/selenium/issues/detail?id=971

Yes, and here is another set of code that shows the problem:

static void Main(string[] args)
{
//string keys
= "óóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóó";
//works (length of 77)
string keys
= "óóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóóó";
//doesn't work (length of 78)

FirefoxDriver driver = new FirefoxDriver();
driver.Navigate().GoToUrl("http://www.google.com");

IWebElement element = driver.FindElement(By.Name("q"));
element.SendKeys(keys);

driver.Quit();
}

I post this code to point out a couple of things. First, it's not a loop
causing the problem; a single .SendKeys() call will exhibit the behavior.
Second, it appears to happen on any Unicode character, not simply those
used in East Asian languages.

I've debugged the problem a fair bit, and I can confirm that the .NET
bindings are sending valid JSON over the wire to the Firefox extension, and
that the extension is properly receiving and interpreting the request. The
problem is happening somewhere in the native (C++) code that actually
presses the keys via native events.

sele...@googlecode.com

unread,
Mar 10, 2011, 1:39:04 AM3/10/11
to selenium-deve...@googlegroups.com

Comment #14 on issue 971 by MaGong...@gmail.com: SendKeys with long unicode
I met another Unicode problem for .net bindings.
The RemoteWebDriver doesn't support Unicode XPath, like this:"//*[@value='百
度一下']"
But if I use the local FirefoxDriver Class , it works OK.

My environment:
windows 7 64-bit
Firefox/3.6.8
selenium-dotnet-2.0b2
selenium-java-2.0b
selenium-server-standalone-2.0b2.jar
jdk1.6.0_23 64bit
.net Framework 4


My C# code:
static public void Main()
{
var driver = new RemoteWebDriver(DesiredCapabilities.Firefox());
driver.Navigate().GoToUrl("http://www.baidu.com");
driver.FindElementById("kw").SendKeys("test");
driver.FindElementByXPath(".//*[@value='百度一
下']".ToString()).Click();
}
It will throws
"Unable to locate element:
{"method":"xpath","selector":".//*[@value='百度一下']"}
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1',
java.version: '1.6.0_23'
Driver info: driver.version: EventFiringWebDriver
"


And I tried it in Java, it works OK.
My Java code:
public static void main(String[] args) {

URL url = null;
try {
url = new URL("http://127.0.0.1:4444/wd/hub");
} catch (MalformedURLException e) {
e.printStackTrace();
}
RemoteWebDriver driver = new RemoteWebDriver(url,
DesiredCapabilities.firefox());

driver.navigate().to("http://www.baidu.com");
driver.findElementById("kw").sendKeys("test");
driver.findElementByXPath(".//*[@value='百度一下']").click();

}




sele...@googlecode.com

unread,
Oct 3, 2011, 2:24:06 AM10/3/11
to selenium-deve...@googlegroups.com
Updates:
Labels: Component-WebDriver

Comment #15 on issue 971 by barancev: SendKeys with long unicode characters

(No comment was entered for this change.)

sele...@googlecode.com

unread,
Nov 19, 2011, 1:38:50 PM11/19/11
to selenium-deve...@googlegroups.com
Updates:
Cc: james.h....@gmail.com

Comment #16 on issue 971 by james.h....@gmail.com: SendKeys with long

unicode characters cause firefox hung.
http://code.google.com/p/selenium/issues/detail?id=971

Issue 2838 has been merged into this issue.

sele...@googlecode.com

unread,
Nov 22, 2011, 10:07:30 AM11/22/11
to selenium-deve...@googlegroups.com
Updates:
Labels: Lang-CSharp Browser-Firefox

Comment #17 on issue 971 by barancev: SendKeys with long unicode characters

(No comment was entered for this change.)

sele...@googlecode.com

unread,
Nov 22, 2011, 10:11:31 AM11/22/11
to selenium-deve...@googlegroups.com

Comment #18 on issue 971 by barancev: SendKeys with long unicode characters

Issue 2910 has been merged into this issue.

sele...@googlecode.com

unread,
Nov 23, 2011, 9:33:57 AM11/23/11
to selenium-deve...@googlegroups.com

Comment #19 on issue 971 by geliy...@gmail.com: SendKeys with long unicode
yes. .C# dot NET and firfox driver.
the problem is that the firefox freeze. slenium does not show any error
with the test that running.

how do we solve this issue?
how can I help you find the issue..?

you can also try to do a loop in sendkeys...wach time for different
charachter, loop for 10000 and it should happens.

please download firefox in hebrew also:
http://www.oldapps.com/firefox.php?old_firefox=6632

and please use firefox a pagw with charset 1255...

I created a test for you to reproduce the issue:
driver.Navigate().GoToUrl("http://forum.freaks.co.il");
IWebElement UsernameTextBox =
driver.FindElement(ByID("navbar_username")); // if this is not the id so
try the id "username" OR "vb_login_username" // one of them should
retrieve the usename textbox element

UsernameTextBox.SendKeys("דגשכגדלחךכידגלךחכידגשלךחכידגשלחךכידגלחךכידגלחךכידלגחךשכידגחלכידלגחךשכילחגךשדכילחגךשדיכלךחשדגדלשחךכידגשלחךכישדלךח");


then, you can reproduce this.
Thank you for your support.


sele...@googlecode.com

unread,
Nov 23, 2011, 6:57:16 PM11/23/11
to selenium-deve...@googlegroups.com

Comment #20 on issue 971 by a.cab...@gmail.com: SendKeys with long unicode

I'm experiencing the same issue.

FirefoxDriver binding in C#.

Any workarounds?

sele...@googlecode.com

unread,
Nov 23, 2011, 10:37:56 PM11/23/11
to selenium-deve...@googlegroups.com

Comment #21 on issue 971 by geliy...@gmail.com: SendKeys with long unicode

the workaround is to copy paste using the clipboard

sele...@googlecode.com

unread,
Nov 24, 2011, 5:27:38 AM11/24/11
to selenium-deve...@googlegroups.com

Comment #23 on issue 971 by logix...@gmail.com: SendKeys with long unicode

i faced same issue when using FFWebdriver, c# .Net 4, FF8 on win 7 x64. FF
hangs when trying to SendKey with Russian chars.

----
Comment 22 by geliy...@gmail.com, Today (6 hours ago)

the workaround is to copy paste using the clipboard

------------
What do you meant? How can i paste text to IWebElement?

sele...@googlecode.com

unread,
Nov 24, 2011, 5:31:40 AM11/24/11
to selenium-deve...@googlegroups.com

Comment #24 on issue 971 by logix...@gmail.com: SendKeys with long unicode

update to comment 23: WebDriverVersion is 2.13

sele...@googlecode.com

unread,
Nov 24, 2011, 6:35:59 AM11/24/11
to selenium-deve...@googlegroups.com

Comment #25 on issue 971 by kristian...@gmail.com: SendKeys with long
unicode characters cause firefox hung.
http://code.google.com/p/selenium/issues/detail?id=971

Could someone try running with the (java based) selenium-server and see how
that changes the problem? It would seem like this is some kind of encoding
issue in the .NET bindings, but it would be interesting to know what
happens with the server in-between the .NET bindings and the browser.

sele...@googlecode.com

unread,
Nov 24, 2011, 12:10:58 PM11/24/11
to selenium-deve...@googlegroups.com

Comment #26 on issue 971 by james.h....@gmail.com: SendKeys with long
unicode characters cause firefox hung.
http://code.google.com/p/selenium/issues/detail?id=971

I have done this research already, as evidenced by the comments I've
previously applied to this issue. I have debugged the issue using .NET
(which repros the issue) and the Ruby (which does not). The JSON content
sent across the wire to the Firefox extension was identical when I tried it
then. I'd have to retry that to see if it's still the case.

sele...@googlecode.com

unread,
Nov 29, 2011, 3:38:04 AM11/29/11
to selenium-deve...@googlegroups.com

Comment #27 on issue 971 by logix...@gmail.com: SendKeys with long unicode

workaround for the issue:

control.Clear();
// send text clipboard
Clipboard.SetText(data.Value);
// paste content of clipboard to control by Shift-Insert
control.SendKeys(Keys.Shift + Keys.Insert);

sele...@googlecode.com

unread,
Jan 27, 2012, 11:59:11 AM1/27/12
to selenium-deve...@googlegroups.com
Updates:
Owner: ---

Comment #28 on issue 971 by berr...@google.com: SendKeys with long unicode

(No comment was entered for this change.)

Reply all
Reply to author
Forward
0 new messages