0

I'm writing a functional test in PHPUnit using Selenium WebDriver.

I need to do this:

$searchBox->send_keys("bath & body"); to simulate typing into a text box.

When I run the test, I see it type bath body instead, skipping the ampersand.

I eventually narrowed the problem down to one part of Jquery-ui Autocomplete that was interfering. The source option.

If I temporarily remove the 'source' option, the test runs fine.

All other javascript could remain in place and work fine.

Of course it doesn't make sense to remove the 'source' option; it's required.

Does anyone know what the problem is and whether there is a workaround?

P.S. This question started here: https://stackoverflow.com/a/11957421/470749

4

1 回答 1

0

I've got the same problem on java. Resolved it by define a new String like this:

String amp = Keys.chord(Keys.SHIFT, "7");

the code will simulate the key combination SHIFT+7 avoiding the issue. Don't know how realize it on PHP, but hope it could be useful to you.

于 2013-03-08T18:05:58.363 回答