Re: [selenium-users] WebDriver.Sendkeys fills target field few times

4,460 views
Skip to first unread message

Shaba K

unread,
Aug 9, 2012, 5:37:23 PM8/9/12
to seleniu...@googlegroups.com
Hi There,

can you paste the exact code you've written 

so that we can point out what is wrong.

on top of my mind i assume you are passing same id each time.

cheers,
s

On Thu, Aug 9, 2012 at 4:59 PM, Михаил Никульшин <mixe...@gmail.com> wrote:
Hello, I have this issue - on slow server machine (virtual winserver 2008R2, 2GbRAM) I'm filling fields like:
var by = By.Id("elementId");
_driver.Click(by);
_driver.FindElement(by).Clear();
Thread.Sleep(250);
_driver.FindElement(by).SendKeys(value);
Thread.Sleep(250);
_driver.FindElement(by).SendKeys(Keys.Tab);
Thread.Sleep(250);
And each field fills few times repeatedly.
How could I avoid it?
On fast developer machine (Win7x64) all works fine.
PS Chrome 21.0.1180.75
chromedriver 22.0.1203
Selenium Webdriver 2.25.1

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/pxBVca1W15kJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Михаил Никульшин

unread,
Aug 10, 2012, 11:53:05 AM8/10/12
to seleniu...@googlegroups.com
Found issue about it:
Got the same problem.
Win2008 R2

I think I'm doing too much requests for webdriver in a row.

Михаил Никульшин

unread,
Aug 10, 2012, 12:23:30 PM8/10/12
to seleniu...@googlegroups.com
Solved it, if there are no timeout (based on machine speed - usually thread.sleep(250) works fine) between interactions with driver - driver couldn't throw event from browser to test - and you gets error.

In one place of my code I'm returning _driver.FindElement from function and immediately fires SendKeys. It was wrong.

пятница, 10 августа 2012 г., 19:53:05 UTC+4 пользователь Михаил Никульшин написал:

Shaba K

unread,
Aug 10, 2012, 12:31:08 PM8/10/12
to seleniu...@googlegroups.com
Hi,

You say u resolved the issue by adding Thread.Sleep() is it ??

cheers,
s

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/tWzCCutVS8QJ.

Михаил Никульшин

unread,
Aug 13, 2012, 2:42:34 AM8/13/12
to seleniu...@googlegroups.com
Yep, Thread.Sleep between any interactions with webdriver, e.g. on slow machine it fails:
(return _driver.FindElement(by).Displayed) && (_driver.FindElement(by).Enabled)
and this works fine:
bool found =_driver.FindElement(by).Displayed;
Thread.Sleep(250);
return (found && (_driver.FindElement(by).Enabled));

PS Of course you could use built-in realisation of Waits but it is not versatile too.

пятница, 10 августа 2012 г., 20:31:08 UTC+4 пользователь Shaba написал:

Shaba K

unread,
Aug 13, 2012, 6:07:10 AM8/13/12
to seleniu...@googlegroups.com
Not for a temp fix ..

Not sure if selenium development team has looked into issue 3719 

cheers,
s

To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/0hglqh9UiEIJ.
Reply all
Reply to author
Forward
0 new messages