1

So first time posting, and I am not even sure Selenium IDE can handle what I want.

So on the web page I have 10 quantity fields (its a simple e-commerce site) And I want to populate these 10 Quantity fields with values, however the id of these Qty fields can change.

e.g

Command          Target                Value

type           id=qtyField_124098        1

type           id=qtyField_124099        2           etc.

Is there an easy way to represent the Target by position. So I could put a value of 1 into the first Qty field, and 2 into the second Qty field.

2 Answers 2

2

Your best bet is to change your locator from the id to xpath. As such you could use something like //input[n] but obviously you'd change based on what is the actual xpath value for those fields.

EDIT:

With an example:

<div>
    <input> </input>
    <input> </input>
</div>

To reference the first <input> yourxpath` would be

//div/input[1]

the second would be

//div/input[2]

Obviously, in most cases xpath expressions will be more complicated than that but hopefully this gives you a starting point.

1
  • how to work with //input[n], something with examples. because for me it cant able to find out. Commented Feb 12, 2014 at 7:36
0

As this code helps me to find values dynamically and helped me, hope it will also help you

click   name=cmb_text_xxx
mouseOver   css=a:contains("xxx")
mouseDown   css=a:contains("xxx")
click       css=a:contains("xxx")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.