Using Selenium IDE with random values

前端 未结 12 1883
囚心锁ツ
囚心锁ツ 2020-12-04 07:49

Is it possible to create Selenium tests using the Firefox plugin that use randomly generated values to help do regression tests?

The full story: I w

12条回答
  •  一个人的身影
    2020-12-04 08:28

    Selenium RC gives you much more freedom than Selenium IDE, in that you can:

    • (1) Enter any value to a certain field
    • (2) Choose any field to test in a certain HTML form
    • (3) Choose any execution order/step to test a certain set of fields.

    You asked how to enter some random value in a field using Selenium IDE, other people have answered you how to generate and enter random values in a field using Selenium RC. That falls into the testing phase (1): "Enter any value to a certain field".

    Using Selenium RC you could easily do the phase (2) and (3): testing any field under any execution step by doing some programming in a supported language like Java, PHP, CSharp, Ruby, Perl, Python.

    Following is the steps to do phase (2) and (3):

    • Create list of your HTML fields so that you could easily iterate through them
    • Create a random variable to control the step, say RAND_STEP
    • Create a random variable to control the field, say RAND_FIELD
    • [Eventually, create a random variable to control the value entered into a certain field, say RAND_VALUE, if you want to do phase (1)]
    • Now, inside your fuzzing algorithm, iterate first through the values of RAND_STEP, then with each such iteration, iterate through RAND_FIELD, then finally iterate through RAND_VALUE.

    See my other answer about fuzzing test, Selenium and white/black box testing

提交回复
热议问题