0

Intermittent Failures with webdriver.js

I am creating some webdriver.js* scripts to automate some time consuming test setup activities. However, when I run the script and do other things with my keyboard and mouse, I come back and find that, intermittently, a particular element cannot be found. And it's a different element each time.

When I run the same scripts and just watch them run, the scripts execute correctly.

Also, when I researched this potential problem, I came up with lots of stuff on using the mouse in webdriver scripts and problems with the click method itself but couldn't find anything to do with my issue. So I'm wondering whether I'm just doing something wrong here.

So What's The Question?

My question is: Is webdriver.js not meant to run like this? (that is, run locally while the keyboard and mouse are doing other things)?

Webdriver.py?

I don't remember having these problems when I used webdriver.py a few years back. iirc, I was able to run the scripts while the workstation was locked (via Win + L) though my memory isn't what it used to be ;)

I would use webdriver.py, however, no one else in our team knows python so I thought I would go webdriver.js since we all know javascript :)

Params: IE11, Windows 10.

* Also, when I say "webdriver.js", I mean the webdriver that is installed after following the steps here

Community
  • 1
  • 1
JoeyC
  • 764
  • 11
  • 19

1 Answers1

0

I found that if I replaced the .click() calls with an equivalent .sendKeys() call (e.g. webdriver.Key.ENTER / webdriver.Key.SPACE) , this would get around the problem. I could even lock my workstation and the scripts would run without any problems.

JoeyC
  • 764
  • 11
  • 19