:onclick isn't supported as a method of locating elements - it doesn't actually appear on the DOM as text, as far as I know, but shows up as a function, so you can't compare text to it. I could be wrong, maybe there's a way to get the text, but I don't think it's likely to be supported in any case.
You might be able to iterate over the collection of buttons and see if the onclick is defined or not. Apart from that, I'm not sure of any other way except going by numeric index. On Mon, Oct 26, 2009 at 07:34, abhisheksreepal <[email protected]>wrote: > > Hi, > > I have just started working with real time application.I am facing > some problems. > > > Issue 1: Unable to Click Buttons > I have observed that there are two buttons. > > Button1: > class: 'normalbutton' > href: 'http://192.168.135.75:8080/edelweiss/content/login.jsf' > > Button2: > class: 'normalbutton' > href: 'http://192.168.135.75:8080/edelweiss/content/login.jsf? > crumb_node=home#<http://192.168.135.75:8080/edelweiss/content/login.jsf?%0Acrumb_node=home#> > ' > onclick: 'var a=function(){this.blur();setPwd();};var b=function() > {if(typeof jsfcljs == > 'function'){jsfcljs(document.getElementById > ('loginForm'),{'j_id75':'j_id75'},'');}return > false};return (a()==false) ? false : b();' > > > > I am unable to click either of this buttons. > Need Advice How to go forward. > > Issue 2: Unable to Click Menu buttons > > There are 4 menu which have SAME "class" and "href" , but different > "onclick" > I have given "onclick" values for the menu buttons > > Menu1: > onclick: if(typeof jsfcljs == 'function'){jsfcljs > (document.getElementById('tabSection'), > {'tabSection:j_id13':'tabSection:j_id13','c > rumb_node':'home'},'');}return false > > Menu2: > onclick: if(typeof jsfcljs == 'function'){jsfcljs > (document.getElementById('tabSection'), > {'tabSection:j_id17':'tabSection:j_id17','crumb_node':'my_acc'},'');} > return false > > Menu3: > onclick: if(typeof jsfcljs == 'function'){jsfcljs > (document.getElementById('tabSection'), > {'tabSection:j_id21':'tabSection:j_id21','crumb_node':'trade'},'');} > return false > > Menu4: > onclick: if(typeof jsfcljs == 'function'){jsfcljs > (document.getElementById('tabSection'), > {'tabSection:j_id25':'tabSection:j_id25','crumb_node':'charts'},'');} > return false > > I do not know whether (:onclick is supported) > How to go forward? > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to [email protected] Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---
