sendKeys on field with jquery maskedinput

1,724 views
Skip to first unread message

kolec

unread,
May 14, 2011, 1:31:04 PM5/14/11
to webdriver
We have encoutered the same problem: sendKeys has no effect on text
field with maskedInput (jquery plugin). Are there any news about
solving that problem ?
Kind regards!

Simon Stewart

unread,
May 16, 2011, 5:27:07 AM5/16/11
to webd...@googlegroups.com
It'd be Really Useful to know which browser and version you're using
on which OS and version. And which version of jquery you're using.
With that information, I'd be able to start thinking about looking
into this...

Simon

> --
> You received this message because you are subscribed to the Google Groups "webdriver" group.
> To post to this group, send email to webd...@googlegroups.com.
> To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
>
>

mk

unread,
May 21, 2011, 8:52:09 PM5/21/11
to webdriver
Hello Simon

I am having the same problem. My form has a field which takes phone
number. The text field has a formatting which looks like (___)___-___

I use this:
driver.findElement(By.xpath("//input[contains(@id,'"+field.trim()
+"')]")).sendKeys(data);

There is no effect on this field.
I use FirefoxDriver();
My OS: Win xP Pro
Browser: Firefox 4.0.1

Please let me know.

Modha

On May 16, 2:27 am, Simon Stewart <simon.m.stew...@gmail.com> wrote:
> It'd be Really Useful to know which browser and version you're using
> on which OS and version. And which version of jquery you're using.
> With that information, I'd be able to start thinking about looking
> into this...
>

Simon Stewart

unread,
May 23, 2011, 6:12:13 AM5/23/11
to webd...@googlegroups.com
Is there a demo page somewhere public that we can use to examine this problem?

Simon

alan.richardson

unread,
May 23, 2011, 4:02:26 PM5/23/11
to webdriver
There is a demo on the Masked Input Plugin author's site
http://digitalbush.com/projects/masked-input-plugin/

The following code offers a workaround by dropping to Selenium
emulation. There are bound to be other workarounds that would achieve
the same results. SendKeys did not put the date 01/01/1970 into the
date box, but the type, followed by blank sendKeys triggered enough of
the events to get the input into the box.

@Test
public void maskedInputPlugin(){

WebDriver fdriver = new FirefoxDriver();
fdriver.get("http://digitalbush.com/projects/masked-input-plugin/");

fdriver.findElement(By.id("tabs")).findElement(By.linkText("Demo")).click();

// following does not trigger plugin code
//driver.findElement(By.id("date")).sendKeys("01011970");

// workaround
Selenium selenium = new WebDriverBackedSelenium(fdriver,"");
selenium.type("date", "01011970");
fdriver.findElement(By.id("date")).sendKeys("");

}

Hope that helps,

Alan
Reply all
Reply to author
Forward
0 new messages