Re: [Wtr-general] url for link
Hi Thanks, It didn't gave me any error but It didn't cliked on that. This is exactly my html souce. div id=ContractDoc dojoType=ContentPane label=Contract style=padding: 10px; overflow:auto; of this kind. This is exactly not a link, its a tab link. so how to click such type of links?? and the other type of link is div dojoType=TreeNode object=K title=span style='font-size:12px; font-weight:normal;text-decoration: underline;'Confidentiality/span objectId=28 I used the ie.span(:index,10).click then it worked, but it will be the problem if the index number changes, Please help me for such type of links.. Thanks in Advance - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6325messageID=18613#18613 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] url for link
Hi Thanks a lot, It worked. I am using it a lot. But now i got another doubt if the link is div id=ContractDoc dojoType=ContentPane label=Contract style=padding: 10px; overflow:auto; of this kind. This is exactly not a link, its a tab link. so how to click such type of links?? and the other typw of link is div dojoType=TreeNode object=K title=span style='font-size:12px; font-weight:normal;text-decoration: underline;'Confidentiality/span objectId=28/div I used the ie.span(:index,10).click then it worked, but it will be the problem if the index number changes, Please help me for such type of links.. Thanks in Advance - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6325messageID=18476#18476 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] url for link
HI , Thank You it worked for that link. But I am having the links of the same kind with same contract_id=227. a href=# onclick=new Ajax.Request('/data_entry/ajax_add_term/131?contract_id=227', {asynchronous:true, evalScripts:true}); return false;add a term/a a href=# onclick=new Ajax.Request('/data_entry/ajax_add_term/132?contract_id=227', {asynchronous:true, evalScripts:true}); return false;add a term/a a href=# onclick=new Ajax.Request('/data_entry/ajax_add_term/133?contract_id=227', {asynchronous:true, evalScripts:true}); return false;add a term/a So for this kind of links what should be done? I am having nearly 15 links of the same text with same type of ajax urls. Please help me for such kinds. Thanks in Advance, Harish - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6325messageID=18373#18373 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] url for link
ie.link(:html, /133/).click or ie.link(:html, /ajax_add_term\/133/).click -- Zeljko Filipin zeljkofilipin.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] url for link
Hi, I tried the two types but its giving error. data_entry.eb.rb:16: syntax error, unexpected tINTEGER, expecting ')' ie.link(:html,/ajax_add_term/131/).click So any other ideas, i tried all the combinations. but its getting error. Please help me. - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6325messageID=18387#18387 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] url for link
you missed typed it, type it exactly ie.link(:html, /ajax_add_term\/133/).click I think the \ / is allowing the forward slash to be used as a string and not as a special regex character. - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6325messageID=18390#18390 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] url for link
This does not work? ie.link(:html, /133/).click -- Zeljko Filipin zeljkofilipin.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] url for link
On 2/8/07, John Lolis [EMAIL PROTECTED] wrote: you missed typed it, type it exactly ie.link(:html, /ajax_add_term\/133/).click I think the \ / is allowing the forward slash to be used as a string and not as a special regex character. Exactly. -- Zeljko Filipin zeljkofilipin.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] url for link
On 2/2/07, Prema Arya [EMAIL PROTECTED] wrote: You can't use regular expression in xpath with XPATH 1.0, you can use it in XPATH 2.0 and rexml supports only xpath 1.0. You can use string operations like substring, string before, string after though. http://www.w3.org/TR/xpath#section-String-Functions. Thanks Prema, I will take a look (I do not really need it, I was just curious). -- Zeljko Filipin zeljkofilipin.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] url for link
On 1/31/07, Bret Pettichord [EMAIL PROTECTED] wrote: ie.link(:html, /contract_id=227/).click Once more, this is so cool. -- Zeljko Filipin zeljkofilipin.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] url for link
On 1/30/07, Naga Harish Kanegolla [EMAIL PROTECTED] wrote: a href=# onclick=new Ajax.Request('/data_entry/ajax_add_term/131?contract_id=227', {asynchronous:true, evalScripts:true}); return false;add a term/a Can regular expressions be used with xpath? This does not work. ie.link(:xpath, //[EMAIL PROTECTED]'#{/227/}']/).click Watir::Exception::UnknownObjectException: Unable to locate object, using xpath and //[EMAIL PROTECTED]'(?-mix:227)']/ -- Zeljko Filipin zeljkofilipin.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] url for link
Hi, You can't use regular expression in xpath with XPATH 1.0, you can use it in XPATH 2.0 and rexml supports only xpath 1.0. You can use string operations like substring, string before, string after though. http://www.w3.org/TR/xpath#section-String-Functions. Prema On 2/2/07, Željko Filipin [EMAIL PROTECTED] wrote: On 1/30/07, Naga Harish Kanegolla [EMAIL PROTECTED] wrote: a href=# onclick=new Ajax.Request('/data_entry/ajax_add_term/131?contract_id=227', {asynchronous:true, evalScripts:true}); return false;add a term/a Can regular expressions be used with xpath? This does not work. ie.link(:xpath, //[EMAIL PROTECTED]'#{/227/}']/).click Watir::Exception::UnknownObjectException: Unable to locate object, using xpath and //[EMAIL PROTECTED]'(?-mix:227)']/ -- Zeljko Filipin zeljkofilipin.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -- Prema Arya ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] url for link
Hi, I got this working by using the index number. ie.link(:index,15).click. Thanks a lot, Harish - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6325messageID=17989#17989 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] url for link
While I do like the answer that RyanD gave that that has not refreshed here yet, you [i]can[/i] access a link element from its text property. So with you code: a href=# onclick=new Ajax.Request('/data_entry/ajax_add_term/131?contract_id=227', {asynchronous:true, evalScripts:true}); return false;add a term/a You can access this link in this manner: ie = IE.attach ( :title, PageTitle ) myAjaxLink = ie.link( :text, add a term ) Now it works, but do consider Ryan's suggestion in the longterm. Hope this helps :) Nathan Christie - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6325messageID=17870#17870 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] url for link
Naga Harish Kanegolla wrote: Hi all, Till now I am using ie.link(:url,http//www.xyz/abc.html) for a link in watir.Now I have a problem for the ajax link. i.e., the url obtained in the html source is a href=# onclick=new Ajax.Request('/data_entry/ajax_add_term/131?contract_id=227', {asynchronous:true, evalScripts:true}); return false;add a term/a So how could i use this url for the link in watir?? Please tell me the syntax in watir for using such type of ajax links. Actually i am having the same add a term more than 10 . so i can't use the text link.Please help me out such types. In addition to the other suggestions, this will work in 1.5: ie.link(:html, /contract_id=227/).click ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] url for link
Hi, I tried using ie.link(:text,add a term) but i have add a term link more than 10 in the same page. So how could i use that?? - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6325messageID=17906#17906 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] url for link
Hi all, Till now I am using ie.link(:url,http//www.xyz/abc.html) for a link in watir.Now I have a problem for the ajax link. i.e., the url obtained in the html source is a href=# onclick=new Ajax.Request('/data_entry/ajax_add_term/131?contract_id=227', {asynchronous:true, evalScripts:true}); return false;add a term/a So how could i use this url for the link in watir?? Please tell me the syntax in watir for using such type of ajax links. Actually i am having the same add a term more than 10 . so i can't use the text link.Please help me out such types. Thanks in Advance Harish - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6325messageID=17798#17798 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] url for link
The best way to do this is to completely seperate your markup (html) from your behaviour (js). Your link should actually point to a real URL that works in case someone has JS turned off. This way you can select the link with ie.link(:url, 'linkurl'). If you give the url a unique id or even a class that all ajax urls will use, you can use JS (most likely a JS library) to select the links and add event handlers to them (and possibly parse the url to understand what the request params are), making the AJAX call and killing the event so the browser doesn't actually request the page. That's how I would do it. -Ryan Naga Harish Kanegolla wrote: Hi all, Till now I am using ie.link(:url,http//www.xyz/abc.html) for a link in watir.Now I have a problem for the ajax link. i.e., the url obtained in the html source is a href=# onclick=new Ajax.Request('/data_entry/ajax_add_term/131?contract_id=227', {asynchronous:true, evalScripts:true}); return false;add a term/a So how could i use this url for the link in watir?? Please tell me the syntax in watir for using such type of ajax links. Actually i am having the same add a term more than 10 . so i can't use the text link.Please help me out such types. Thanks in Advance Harish - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6325messageID=17798#17798 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -- Ryan Doherty Messenger WebDev Yahoo! ID: ryan.doherty ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general