3

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?

2
  • 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
    Commented May 28, 2012 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
    Commented May 28, 2012 at 16:13

5 Answers 5

5
  • 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.
2

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

2

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.

1

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.

0

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 and acknowledge you have read our privacy policy.

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