From: micako Date: 2011-01-13T08:30:27+09:00 Subject: Re: Ruby/Watir Beginner - Need Help With Finding Page Element Based on Unique ID Thanks for the reply. On Jan 12, 2:59 pm, "Jonas Pfenniger (zimbatm)" wrote: > 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. > > 2011/1/10 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?