Agreed On Fri, Nov 19, 2010 at 4:45 AM, Chuck van der Linden <[email protected]>wrote:
> Let me add my voice to Dave's here. You need to take this problem to > the devs, and explain your need to have some way to reliably identify > elements on the page. It needs to be something that doesn't get > changed if they re-design the page. ID values work great if they are > unique within the page (proper HTML) and not randomly generated.. > Name or Class attributres can also work. This need is common to doing > automation using just about any tool or utility on the face of the > planet. > > The key is to decide on something, and then use it consistently. and > whatever is decided on, the devs need to understand once they set a > value (e.g. name:"User") of an attribute on an element, that they > should not change it if they refactor the page (eg. "User" ==> > "UserName") since doing so will break your test scripts. > > This really needs to be only ONE thing.. (ID, Name, or Class being > your best choices) and as long as you get that, then the others > could vary as much as the devs want or even be generated randomly. > > You can use Index for your scripts, but because it is relative to any > other elements of the same type, it's very common to see the index > value for things change as page content changes, which then breaks all > your scripts and requires you to 'fix' them on a far to frequent > basis. That kind of 'brittle' automation is a nightmare and can > easily end up costing you more time than it saves. So I only resort > to Index when I have no better choice available, and would never do so > except on a few cases where nothing else worked, never as the main > means for an entire series of test scripts. (or you will rapidly find > yourself spending more time fixing old scripts than writing new ones) > > > > On Nov 18, 7:44 am, Dave McNulla <[email protected]> wrote: > > I would advise the team that you are working on about the > > "testability" of your product. Which is more inconvenient, adding the > > capability to automate, or running manual tests FOR THE REST OF YOUR > > LIFE! If you can get the developers to write at least the occasional > > test, they will want to help you fix that. Or maybe it's just a > > problem with the login screen? > > > > Good luck, > > > > Dave > > > > On Nov 18, 2:56 am, Hrishikesh Bose <[email protected]> wrote: > > > > > > > > > i got some success using index. thanks guys. will update more :) > > > > > On Thu, Nov 18, 2010 at 4:24 PM, ®eljko Filipin < > > > > > [email protected]> wrote: > > > >http://wiki.openqa.org/display/WTR/Index > > > > > > Zeljko > > > > > > On Thursday, November 18, 2010, Hrishikesh Bose > > > > <[email protected]> wrote: > > > > > how can i use index? > > > > > > > On Thu, Nov 18, 2010 at 3:35 PM, Hrishikesh Bose < > > > > [email protected]> wrote: > > > > > > > i tried - other attribute which i got is tab index which is 0 for > each > > > > input field. Don't have name field. > > > > > > > On Thu, Nov 18, 2010 at 3:30 PM, Prajakta Jadhav < > > > > [email protected]> wrote: > > > > > Try using some other element property like name or value instead of > id. > > > > You could find their values using developer's tool bar. > > > > > > > 2010/11/18 Hrishikesh Bose <[email protected]> > > > > > may be i am new to the Watir. > > > > > > > The problem i am facing is as following. > > > > > > > . i need to automate a use case which is like a new window. i > provide > > > > name and password and click save to create a new user. > > > > > > > Now the Name and Password are text fields. I can get the ids using > > > > developer tool bar. but the next time i reload the page and try to > run the > > > > automation script again, the text_field ids get changed to a new > value and > > > > my test script fails > > > > > > > so the first time i select the text field i get <INPUT id="c_179" > > > > > > > > Once the page is reloaded i get <INPUT id="c_2"> > > > > > > > what i should do so that even if these IDs are changing i can find > the > > > > same element. > > > > > > > thanks, > > > > > hrishikesh bose > > > > > > > On Thu, Nov 18, 2010 at 3:14 PM, ®eljko Filipin < > > > > [email protected]> wrote: > > > > > On Thu, Nov 18, 2010 at 10:32 AM, Hrishikesh Bose < > > > > [email protected]> wrote: > > > > >> so got this questions on whether we can use WATIR to automate AJAX > web > > > > pages. > > > > > > > You should be able to do it. Most of us automate web applications > with a > > > > lot of javascript. Let us know if you have a problem with someting. > > > > > > > ®eljko > > > > > -- > > > > > watir.com - community manager > > > > > watirpodcast.com - host > > > > > testingpodcast.com - audio podcasts on software testing. all of > them > > > > > > > -- > > > > > Before posting, please readhttp://watir.com/support. In short: > search > > > > before you ask, be nice. > > > > > > > [email protected] > > > > >http://groups.google.com/group/watir-general > > > > > [email protected]<watir-general%[email protected]> > <watir-general%2bunsubscr...@goog legroups.com> > > > > > > > -- > > > > > Before posting, please readhttp://watir.com/support. In short: > search > > > > before you ask, be nice. > > > > > > > [email protected] > > > > >http://groups.google.com/group/watir-general > > > > > [email protected]<watir-general%[email protected]> > <watir-general%2bunsubscr...@goog legroups.com> > > > > > > > -- > > > > > Before posting, please readhttp://watir.com/support. In short: > search > > > > before you ask, be nice. > > > > > > > watir-gene...@googlegr > > > > > > -- > > > > Before posting, please readhttp://watir.com/support. In short: > search > > > > before you ask, be nice. > > > > > > [email protected] > > > >http://groups.google.com/group/watir-general > > > > [email protected]<watir-general%[email protected]> > <http://groups.google.com/group/watir-general%0Awatir-general+unsubscr...>- > Hide quoted text - > > > > - Show quoted text - > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > [email protected] > http://groups.google.com/group/watir-general > [email protected]<http://groups.google.com/group/watir-general%[email protected]> > -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected]
