When a selenium test script executes unusually slow, what are the possible reasons which could be making script performace slow ?

What steps should a tester use to analyse and debug the problem?

  • 3
    What kind of script you have in mind? Manual script? Script for test automation of RIA? Script for application deployment? Script for DB setup? – dzieciou May 28 '12 at 15:37
  • Jasmine, I do not know what you mean by "usually slow". Also, has the script always run slow, or was there a time when it ran faster? – user246 May 28 '12 at 16:13
  • The script uses a poor algorithm, and therefore executes many more statements than are necessary.
  • The script uses external resources (e.g. disk or remote servers) that inject numerous or lengthy delays into the execution.
  • The script's job is inherently computationally expensive.

In some cases Xpath selectors can slow down the run time.


If the selenium tests/objects are embedded into a script in another language (eg java or python), make sure that the underlying code in those scripts aren't slowing you down. For example, external process/function calls or excessive string concatenation, which both could be common in testing scripts, can be slow things down considerably.


too much use of xpath will make the test run slow. so this should be the last resort. we should always try to follow the selenium object identification like use id then name and link before using xpath or csspath.


possible thing is to divide your test methods and your web element objects are in separate classes,it will give you good performance,Follow page object design.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.