[wtr-general] Re: Window Attachment with regular expression in FireWatir
yes it works but i have to attach with current window without specifying any title string, any solution for that. On Fri, Sep 11, 2009 at 11:24 AM, Angrez Singh ang...@gmail.com wrote: Does giving full title works with firewatir? On Fri, Sep 11, 2009 at 10:37 AM, Rajat Singhal coolraja...@gmail.comwrote: Hi all Can anyone help me how to attach window in firewatir using regular expression(Current window attachment) In Watir i m using: ie = Watir::IE.attach(:title,//) which works perfectly .attach(:title,//) doesn't work with fire watir. Kindly let me know how it is possible with watir. Thanks in advance. -- Regards Rajat Singhal +919718729742 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: element focus status
Hi Daary, The flash will just flash off the element. But i need to verify that the perticular element has been flashed/focused. Thanks Manoj On Sep 11, 5:00 am, Darryl Brown d-l-br...@roadrunner.com wrote: Hi Manoj, You can use .flash in place of the focus Darryl On Sep 10, 9:39 am, manoj test...@gmail.com wrote: Hi, I am trying to automate the tab navigation in web page. I can focus on the element by element.focus(). But how can i verify that that element has been focused? Please let me know ASAP. Thanks Manoj --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: How to read an xml file using watir scripts
Hi Zeljko, http://www.germane-software.com/software/rexml/ I tried the above website and followed the example as described which recommends REXML which is inside ruby, however it does not work. No errors even. Do i need to change configuration or make it enable something to use the library REXML. Any idea on this? Could you please let me know? I did use the statements as below in the file. require rexml/document include REXML doc = Document.new File.new(mydoc.xml) doc.elements.each(Inventory/section) { |element| puts elements.attributes[name] } On Sep 9, 1:17 pm, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Wed, Sep 9, 2009 at 8:54 AM, msazeez28july sabdulkha...@gmail.com wrote: how do i read an xml file using watir scripts? Watir is _just_ a Ruby library for driving browsers. If you want to read/edit xml files, there are Ruby libraries for that. I am not familiar with xml parsing, but I think you should take a look at one of these: http://wiki.github.com/hpricot/hpricothttp://nokogiri.rubyforge.org/nokogiri/http://www.germane-software.com/software/rexml/ Željko --http://watirpodcast.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Window Attachment with regular expression in FireWatir
right now Firewatir only supports adding by URL and title. I look into why regex is not working during attach. - Angrez On Fri, Sep 11, 2009 at 11:31 AM, Rajat Singhal coolraja...@gmail.comwrote: yes it works but i have to attach with current window without specifying any title string, any solution for that. On Fri, Sep 11, 2009 at 11:24 AM, Angrez Singh ang...@gmail.com wrote: Does giving full title works with firewatir? On Fri, Sep 11, 2009 at 10:37 AM, Rajat Singhal coolraja...@gmail.comwrote: Hi all Can anyone help me how to attach window in firewatir using regular expression(Current window attachment) In Watir i m using: ie = Watir::IE.attach(:title,//) which works perfectly .attach(:title,//) doesn't work with fire watir. Kindly let me know how it is possible with watir. Thanks in advance. -- Regards Rajat Singhal +919718729742 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: I'm looking for a way to count all PageTo(*) elements or to loop until the bullet_search_white_small.gif doesn't exist in the page
Hello Orde, It sure works but I should have ask my question better. The peoplesoft-b-test-b-b- analyst-b/brisbane can't be hard coded into the xpath as it changes. is there a way to use regexpr in the xpath? I think that /job/ is always returns. Cheers, Guy On Sep 11, 9:26 am, orde ohil...@gmail.com wrote: You should take a look athttp://wiki.openqa.org/display/WTR/XPath. Something like this should work: puts browser.link(:xpath,//a...@href='/job/peoplesoft-b-test-b-b- analyst-b/brisbane/15956235/']/).text Hope it helps. On Sep 10, 8:32 am, Guy guy.kid...@gmail.com wrote: Hi Orde, It is very helpful and I already put that in my script. I would appreciate help with the next (xpath) I try to get the PEOPLESOFT TEST ANALYST and the date 'Fri 04 Sep' using xpath without getting the right value. Any ideas would be welcome. div id=resultsList class=ol id=searchResultsListlispan class=jobsearchNumber1input type=checkbox name=chkJob onClick=UpdateSelectedItems(); value=15956235/input/ spandivh2a href=/job/peoplesoft-b-test-b-b-analyst-b/brisbane/ 15956235/PEOPLESOFT span class=highlightTEST ANALYST/span/a emIntegrated Business Technologies Pty Ltd/em/h2span class=jobSearchJobListedDateFri 04 Sep/ spandivpImmediate requirement for an experienced PeopleSoft test analyst across HR/Payroll/pspan class=taxonomya href=javascript:ClassTree('catindustry=1215')I.T. amp; T/a gt; a href=javascript:ClassTree ('catoccupation=1491amp;catindustry=1215')QA/Testers/a/span/ divh3Brisbane/h3h3/h3/div/lilispan Many Thanks, Guy On Sep 10, 2:21 am, orde ohil...@gmail.com wrote: This will give you the number of links: browser = [your browser of choice] puts browser.links.length --- To create the loop: while browser.image(:src, /bullet_search_white_small.gif/).exists? puts 'exists' sleep 2 browser.refresh end Hope that helps. orde On Sep 9, 7:56 am, Guy guy.kid...@gmail.com wrote: Hello All, I'm New with watir but appreciate how good it is. I'm looking for a way to count all PageTo(*) elements or to loop until the bullet_search_white_small.gif ('Next' image) doesn't exist in the page Follows is the html code from the site div class='searchPagination'dl class='jobSearchPagination' a class='nextPage btn pinkbtn_small' href=javascript: PageTo (4)strongNextimg src='/general_ID_items/images/other/ bullet_search_white_small.gif'/strong/adtPage/dt dda href=javascript: PageTo(1)1/a/dd dda href=javascript: PageTo(2)2/a/ class='currentPage'span3/span/dd dda href=javascript: PageTo(4)4/a/dd dda href=javascript: PageTo(5)5/a/dd dda href=javascript: PageTo(6)6/a/dd dda href=javascript: PageTo(7)7/a/dd dda href=javascript: PageTo(8)8/a/dd dda href=javascript: PageTo(9)9/a/dd dda href=javascript: PageTo(10)10/a/dd/dl/div /div Cheers, Guy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: I'm looking for a way to count all PageTo(*) elements or to loop until the bullet_search_white_small.gif doesn't exist in the page
For the comment below: $ie.element_by_xpath(//img[contains(@src, 'report_delete.png')]).click It can locate an image element, which has src attributes, for the report_delete.png is just part of the src. I think it can help you. Thanks. Wesley Chen. On Fri, Sep 11, 2009 at 6:03 PM, Guy guy.kid...@gmail.com wrote: Hello Orde, It sure works but I should have ask my question better. The peoplesoft-b-test-b-b- analyst-b/brisbane can't be hard coded into the xpath as it changes. is there a way to use regexpr in the xpath? I think that /job/ is always returns. Cheers, Guy On Sep 11, 9:26 am, orde ohil...@gmail.com wrote: You should take a look athttp://wiki.openqa.org/display/WTR/XPath. Something like this should work: puts browser.link(:xpath,//a...@href='/job/peoplesoft-b-test-b-b- analyst-b/brisbane/15956235/']/).text Hope it helps. On Sep 10, 8:32 am, Guy guy.kid...@gmail.com wrote: Hi Orde, It is very helpful and I already put that in my script. I would appreciate help with the next (xpath) I try to get the PEOPLESOFT TEST ANALYST and the date 'Fri 04 Sep' using xpath without getting the right value. Any ideas would be welcome. div id=resultsList class=ol id=searchResultsListlispan class=jobsearchNumber1input type=checkbox name=chkJob onClick=UpdateSelectedItems(); value=15956235/input/ spandivh2a href=/job/peoplesoft-b-test-b-b-analyst-b/brisbane/ 15956235/PEOPLESOFT span class=highlightTEST ANALYST/span/a emIntegrated Business Technologies Pty Ltd/em/h2span class=jobSearchJobListedDateFri 04 Sep/ spandivpImmediate requirement for an experienced PeopleSoft test analyst across HR/Payroll/pspan class=taxonomya href=javascript:ClassTree('catindustry=1215')I.T. amp; T/a gt; a href=javascript:ClassTree ('catoccupation=1491amp;catindustry=1215')QA/Testers/a/span/ divh3Brisbane/h3h3/h3/div/lilispan Many Thanks, Guy On Sep 10, 2:21 am, orde ohil...@gmail.com wrote: This will give you the number of links: browser = [your browser of choice] puts browser.links.length --- To create the loop: while browser.image(:src, /bullet_search_white_small.gif/).exists? puts 'exists' sleep 2 browser.refresh end Hope that helps. orde On Sep 9, 7:56 am, Guy guy.kid...@gmail.com wrote: Hello All, I'm New with watir but appreciate how good it is. I'm looking for a way to count all PageTo(*) elements or to loop until the bullet_search_white_small.gif ('Next' image) doesn't exist in the page Follows is the html code from the site div class='searchPagination'dl class='jobSearchPagination' a class='nextPage btn pinkbtn_small' href=javascript: PageTo (4)strongNextimg src='/general_ID_items/images/other/ bullet_search_white_small.gif'/strong/adtPage/dt dda href=javascript: PageTo(1)1/a/dd dda href=javascript: PageTo(2)2/a/ class='currentPage'span3/span/dd dda href=javascript: PageTo(4)4/a/dd dda href=javascript: PageTo(5)5/a/dd dda href=javascript: PageTo(6)6/a/dd dda href=javascript: PageTo(7)7/a/dd dda href=javascript: PageTo(8)8/a/dd dda href=javascript: PageTo(9)9/a/dd dda href=javascript: PageTo(10)10/a/dd/dl/div /div Cheers, Guy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: element focus status
Hello Manoj, If you can flash an object, then you should be able to focus the object There is no visual indication that the object has been focused unless it is somewhere of the screen. I use it all of the time to show a certain part of page when the page larger than the screen size during script development. Regards, Darryl On Sep 11, 2:26 am, manoj test...@gmail.com wrote: Hi Daary, The flash will just flash off the element. But i need to verify that the perticular element has been flashed/focused. Thanks Manoj On Sep 11, 5:00 am, Darryl Brown d-l-br...@roadrunner.com wrote: Hi Manoj, You can use .flash in place of the focus Darryl On Sep 10, 9:39 am, manoj test...@gmail.com wrote: Hi, I am trying to automate the tab navigation in web page. I can focus on the element by element.focus(). But how can i verify that that element has been focused? Please let me know ASAP. Thanks Manoj --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: element focus status
Hi Darry Thanks for your input. I am able to focus on the object. But my need is to verify that that particular element has been focused. So is that any method which return the status of the element which is focused(say true) and for other element it should return false? Thanks Manoj On Sep 11, 4:43 pm, Darryl Brown d-l-br...@roadrunner.com wrote: Hello Manoj, If you can flash an object, then you should be able to focus the object There is no visual indication that the object has been focused unless it is somewhere of the screen. I use it all of the time to show a certain part of page when the page larger than the screen size during script development. Regards, Darryl On Sep 11, 2:26 am, manoj test...@gmail.com wrote: Hi Daary, The flash will just flash off the element. But i need to verify that the perticular element has been flashed/focused. Thanks Manoj On Sep 11, 5:00 am, Darryl Brown d-l-br...@roadrunner.com wrote: Hi Manoj, You can use .flash in place of the focus Darryl On Sep 10, 9:39 am, manoj test...@gmail.com wrote: Hi, I am trying to automate the tab navigation in web page. I can focus on the element by element.focus(). But how can i verify that that element has been focused? Please let me know ASAP. Thanks Manoj --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Window Attachment with regular expression in FireWatir
Hi Angrez I got a solution for this, i made a change in firefox.rb file in firewatir gem in find_window method in firefox.rb, i changed jssh_command var regExp = new RegExp(#{what}.inspect); to jssh_command var regExp = new RegExp(#{what}); and it works for .attach(:title,//) Thanks On Fri, Sep 11, 2009 at 12:18 PM, Angrez Singh ang...@gmail.com wrote: right now Firewatir only supports adding by URL and title. I look into why regex is not working during attach. - Angrez On Fri, Sep 11, 2009 at 11:31 AM, Rajat Singhal coolraja...@gmail.comwrote: yes it works but i have to attach with current window without specifying any title string, any solution for that. On Fri, Sep 11, 2009 at 11:24 AM, Angrez Singh ang...@gmail.com wrote: Does giving full title works with firewatir? On Fri, Sep 11, 2009 at 10:37 AM, Rajat Singhal coolraja...@gmail.comwrote: Hi all Can anyone help me how to attach window in firewatir using regular expression(Current window attachment) In Watir i m using: ie = Watir::IE.attach(:title,//) which works perfectly .attach(:title,//) doesn't work with fire watir. Kindly let me know how it is possible with watir. Thanks in advance. -- Regards Rajat Singhal +919718729742 -- Regards Rajat Singhal +919718729742 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Selecting a url from an array
I am using the following to collect all the links on a page and now need to select a particular link to click on; $browser.links.each do |l| #Relative link if (l.href.first == /) $url = $browser.url + l.href[1..-1] else $url = l.href end if !$links.include?($url) $links.push $url end end The following finds the very first link but I need to find the first link that contains a certain word; $links.detect { |$links| /^http/ =~ $links } Have tried the line below but it gets confused because of the extra //. $links.detect { |$links| /^http://word/ =~ $links } Is it possible to tell watir/ruby to ignore the extra forward slashes? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Unable to identify new IE browser windows
I am not able to attach to a new IE window. When I click on a link in browser it opens new browser. I have to access elements in new browser window. Can any one give suggession to access elements in new browser window. sample code I have written Watir::Browser.default='ie' browser=Watir::Browser.new browser.goto site name browser.link(:text, 'PartnerName').click # it opens a new partner browser window browser1 = Watir::IE.attach(:url, 'partner site url') # here I got error browser1.image(:src, /bt_sign_up/).click when it executed 5th line I got the following error in `attach_browser_window': Unable to locate a window with url of 'sample url' (Watir::Exception::NoMatchingWindowFoundException) I think I might have made mistake in my code it self. Please help in this context. Thanks, Vijay --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Unable to identify new IE browser windows
On Fri, Sep 11, 2009 at 3:17 PM, dvkbabu dvkb...@gmail.com wrote: in `attach_browser_window': Unable to locate a window with url of 'sample url' (Watir::Exception::NoMatchingWindowFoundException) You have to use real page url instead of 'sample url' Something like this: browser1 = Watir::IE.attach(:url, 'http://www.google.com/') You should read this: http://wiki.openqa.org/display/WTR/New+Browser+Windows Željko -- http://watirpodcast.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: after massive watir crawl..
Curious, I'm not sure if your issue was resolved, but I wanted to let you know that I switched to WWW::Mechanize for a simple crawler that was hitting around 10,000 pages. The script finished in under an hour, verifying everything I needed. So, depending on your test cases and requirements, this might be a viable solution for you. The WWW::Mech version of my script was just over 8 lines; pretty simple. Adam On Sep 8, 11:12 am, AR reed.a...@gmail.com wrote: I've had the same issue while doing a little sanity checking on some marketing websites that we control. Using IE.new_process helped a little, but Ruby would always die before the script completed. On Aug 30, 6:33 pm, Chris McMahon christopher.mcma...@gmail.com wrote: looks to me that something must be stuck somewhere, and I need to clear that away, but I don't know what I need to clear away.. I restarted the computer, but the problem does not go away. Could anyone tell me what I need to clear away in order to have smooth internet access?? I seem to recall that Ruby under some circumstances will hog memory until Bad Things Happen. If you're crawling all these pages and saving bits of information, be sure you're writing out to a file along the way and flushing the write buffer when you do it. -Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: element focus status
Hello Manoj, For what you're trying do just put.exist? in place of .focus. It will return true or false Example: $ie.frame(:index, 3).frame(:index, 3).button(:id, 'editButton').exist? Darryl On Sep 11, 7:57 am, manoj test...@gmail.com wrote: Hi Darry Thanks for your input. I am able to focus on the object. But my need is to verify that that particular element has been focused. So is that any method which return the status of the element which is focused(say true) and for other element it should return false? Thanks Manoj On Sep 11, 4:43 pm, Darryl Brown d-l-br...@roadrunner.com wrote: Hello Manoj, If you can flash an object, then you should be able to focus the object There is no visual indication that the object has been focused unless it is somewhere of the screen. I use it all of the time to show a certain part of page when the page larger than the screen size during script development. Regards, Darryl On Sep 11, 2:26 am, manoj test...@gmail.com wrote: Hi Daary, The flash will just flash off the element. But i need to verify that the perticular element has been flashed/focused. Thanks Manoj On Sep 11, 5:00 am, Darryl Brown d-l-br...@roadrunner.com wrote: Hi Manoj, You can use .flash in place of the focus Darryl On Sep 10, 9:39 am, manoj test...@gmail.com wrote: Hi, I am trying to automate the tab navigation in web page. I can focus on the element by element.focus(). But how can i verify that that element has been focused? Please let me know ASAP. Thanks Manoj --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: How to identify pop-up windows using watir tool
Hello Ravi Please refer to the following link that has an example that closes a popup using the Google preferences page. http://groups.google.com/group/watir-general/browse_thread/thread/eeb37d3a8562936/e9ec1258c2aa547f?hl=enq=#e9ec1258c2aa547f Regards, Darryl On Sep 11, 1:55 am, tester1 jamuser...@gmail.com wrote: Have 'Close' button in that pop-up window. This is just like on-screen notification thing, which is displaying in inner window pop-up. Thanks/Ravi On Sep 11, 5:14 am, Darryl Brown d-l-br...@roadrunner.com wrote: Hello, What is the context of the popup that you're trying to handle? Does it have a button - such as 'OK' to make it go away? Darryl On Sep 10, 7:41 am, tester1 jamuser...@gmail.com wrote: I would like to identify 'Error message' pop-up windows in using watir? Thanks/tester1 On Sep 10, 4:39 pm, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Thu, Sep 10, 2009 at 1:37 PM, tester1 jamuser...@gmail.com wrote: Can anybody please help me How to identify pop-up windows using watir tool? Did you read this? http://wiki.openqa.org/display/WTR/Pop+Ups Željko --http://watirpodcast.com/-Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Selecting a url from an array
Have tried the line below but it gets confused because of the extra //. $links.detect { |$links| /^http://word/=~ $links } Is it possible to tell watir/ruby to ignore the extra forward slashes? Does this work? $links.detect { |$links| /^http:\/\/word/=~ $links } Hope it helps. On Sep 11, 6:11 am, ash ashbr...@gmail.com wrote: I am using the following to collect all the links on a page and now need to select a particular link to click on; $browser.links.each do |l| #Relative link if (l.href.first == /) $url = $browser.url + l.href[1..-1] else $url = l.href end if !$links.include?($url) $links.push $url end end The following finds the very first link but I need to find the first link that contains a certain word; $links.detect { |$links| /^http/ =~ $links } Have tried the line below but it gets confused because of the extra //. $links.detect { |$links| /^http://word/=~ $links } Is it possible to tell watir/ruby to ignore the extra forward slashes? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: element focus status
Manoj, Have you looked at the show_active() on Watir::IE? (http://wtr.rubyforge.org/rdoc/classes/Watir/IE.html#M000267) It returns a string that you could easily parse. Looking at the source (http://wtr.rubyforge.org/rdoc/classes/Watir/IE.src/M000267.html), it looks like it uses document.activeElement to get the object that has focus. I don't know if you would be able to use that to compare to the object that you set focus on or not. Hope this helps, /\/\ark -Original Message- From: watir-general@googlegroups.com [mailto:watir- gene...@googlegroups.com] On Behalf Of Darryl Brown Sent: Friday, September 11, 2009 1:04 PM To: Watir General Subject: [wtr-general] Re: element focus status Hello Manoj, For what you're trying do just put.exist? in place of .focus. It will return true or false Example: $ie.frame(:index, 3).frame(:index, 3).button(:id, 'editButton').exist? Darryl On Sep 11, 7:57 am, manoj test...@gmail.com wrote: Hi Darry Thanks for your input. I am able to focus on the object. But my need is to verify that that particular element has been focused. So is that any method which return the status of the element which is focused(say true) and for other element it should return false? Thanks Manoj On Sep 11, 4:43 pm, Darryl Brown d-l-br...@roadrunner.com wrote: Hello Manoj, If you can flash an object, then you should be able to focus the object There is no visual indication that the object has been focused unless it is somewhere of the screen. I use it all of the time to show a certain part of page when the page larger than the screen size during script development. Regards, Darryl On Sep 11, 2:26 am, manoj test...@gmail.com wrote: Hi Daary, The flash will just flash off the element. But i need to verify that the perticular element has been flashed/focused. Thanks Manoj On Sep 11, 5:00 am, Darryl Brown d-l-br...@roadrunner.com wrote: Hi Manoj, You can use .flash in place of the focus Darryl On Sep 10, 9:39 am, manoj test...@gmail.com wrote: Hi, I am trying to automate the tab navigation in web page. I can focus on the element by element.focus(). But how can i verify that that element has been focused? Please let me know ASAP. Thanks Manoj __ Information from ESET NOD32 Antivirus, version of virus signature database 4417 (20090911) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com __ Information from ESET NOD32 Antivirus, version of virus signature database 4417 (20090911) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Selecting a url from an array
You need to write the regular expresssions in the correct format for this dude. Best Karim Rayani On Sat, Sep 12, 2009 at 12:37 AM, orde ohil...@gmail.com wrote: Have tried the line below but it gets confused because of the extra //. $links.detect { |$links| /^http://word/=~ $links } Is it possible to tell watir/ruby to ignore the extra forward slashes? Does this work? $links.detect { |$links| /^http:\/\/word/=~ $links } Hope it helps. On Sep 11, 6:11 am, ash ashbr...@gmail.com wrote: I am using the following to collect all the links on a page and now need to select a particular link to click on; $browser.links.each do |l| #Relative link if (l.href.first == /) $url = $browser.url + l.href[1..-1] else $url = l.href end if !$links.include?($url) $links.push $url end end The following finds the very first link but I need to find the first link that contains a certain word; $links.detect { |$links| /^http/ =~ $links } Have tried the line below but it gets confused because of the extra //. $links.detect { |$links| /^http://word/=~ $links } Is it possible to tell watir/ruby to ignore the extra forward slashes? -- Regards, Alkarim Rayani --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---