MAHI
MAHI

Reputation: 10163

selenium pass value from a file

i am trying to pass a value to test case from a file. here i have worked on a small example, created a js file with content,

var sch = 'java';    // sch.js and added to ide options - selenium ide extension 

i have attached my test case and result i got. the variable value is not read by the ide.

enter image description here

enter image description here

Upvotes: 0

Views: 3302

Answers (2)

serbeys
serbeys

Reputation: 76

You need to add one more command:

storeEval | sch | sch

to read variable from you js-file.

Please note, that you need to save your test, restart Selenium IDE and open test again for correct saving of your selenium ide extensions.

This code works:

<tr>
    <td>open</td>
    <td>/</td>
    <td></td>
</tr>
<tr>
    <td>storeEval</td>
    <td>sch</td>
    <td>sch</td>
</tr>
<tr>
    <td>type</td>
    <td>id=gbqfq</td>
    <td>${sch}</td>
</tr>

Upvotes: 1

dokaspar
dokaspar

Reputation: 8624

The Selenium IDE is not really a tool designed to run your testcases. It helps to generate code that you can use to write your testcases, e.g., in a programming language like Java. Of course you can then read parameters from a file using Java.

Upvotes: 0

Related Questions