Ruby/Watir Beginner - Need Help With Finding Page Element Based onUnique ID

M

micako

I am new to Ruby and am attempting to automate some tests. I have come
across a scenario for which I cannot find a solution. I am hoping
someone here can assist me.

I am trying to write a test that will create a new field and then
delete it.

When creating the field, you give it a name (which does not have to be
unique - possibly irrelevant as I plan to give it a unique name with
each run). Upon submitting the form, a unique id is assigned to that
field. The field then has options on it, including 'delete'.

The field name itself is merely a label and cannot be interacted with.
There are several other fields that already exist on that page which I
do not want to delete.

The option links (delete, edit, etc) are associated to the unique ID.

How do I find out what the unique ID is in order to locate the correct
'delete' link on the page?
 
J

Jonas Pfenniger (zimbatm)

Hi micako,

I don't know watir, but I would add a class to the element, so that
you can find it either by it's type (class) or unique id.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top