[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 Anna, I really appreciate your help (I couldn't progress without your help). All my problems are seem to be sorted. Thanks again, Guy On Sep 19, 10:30 am, Anna Gabutero a...@lavabit.com wrote: On Thu, Sep 17, 2009 at 09:22:19AM -0700, Guy wrote: 1). How can I get the text out of em tag for each div? that tag seems as not supported. The latest git version supports em: http://github.com/bret/watir/commit/1a8e3368b7e7ce790f8a596a7d8bcefe0...http://github.com/bret/watir/commit/52557ea6936f847c4ee0578608fd03625... Unfortunately, to get this, you'll have to build Watir yourself (http://wiki.openqa.org/display/WTR/Building+Watir) or port the above commits into your sources. There is also the quick and dirty way, courtesy of String#scan: ie.div(:id, 'resultsList').lis.each do |element| puts element.link(:url, /job/).text.scan(/em(.*)\/em/) end The xpath works great but for the em tag only - ie.element_by_xpath (//em).innerText div id=resultsList class=ol id=searchResultsListlispan class=jobsearchNumber1input type=checkbox name=chkJob onClick=UpdateSelectedItems(); value=16015024/input/ spandivh2a href=/job/file-migration-b-analyst-b/gold-coast/ 16015024/File Migration span class=highlightAnalyst/span/a emTLC ITStaff/em/h2 2). Is there a generic method/procedure to iterate for all results page/s? You have to write your own based on the structure of the site/page. You can use the exists? method to check for the presence of an element: ie.link(:text, 'Next').exists? This won't give you an error even if there's no Next link on the page. By the way, Watir offers many selection methods so you may want to check out this page: http://wiki.openqa.org/display/WTR/Methods+Supported+by+Element XPath is really overkill for many cases. - Anna Follows the html: span class=framespan class=frameStarti/i/span div class=contentBox firstBox h1span id=ContentInclude_YourQuery1_ResultsLabelstrong1/strong - strong2/strong of strong2/strong /spanspanjobs containing strongtest analyst/strong in strongGold Coast/strong/span or check if the 'Next' exists (how can I handle a scenario with no 'Next' (just one page with or no results at all): ie.element_by_xpath(//strong[contains(text(),'Next')]).click (this works but how can I handle just one page or no results at all) div class='searchPagination'dl class='jobSearchPagination' a class='nextPage btn pinkbtn_small' href=javascript: PageTo (2)strongNextimg src='/general_ID_items/images/other/ bullet_search_white_small.gif'/strong/adtPage/dtdd class='currentPage'span1/span/dd dda href=javascript: PageTo(2)2/a/dd dda href=javascript: PageTo(3)3/a/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 Thank U all for the helpful support 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: Setting innerHTML of a div using Watir.
It must be in a frame. You may use: ie.frame(...).document.body.focus ie.send(hello) Thanks. Wesley Chen. The easier, the better. On Fri, Sep 18, 2009 at 1:39 PM, karim rayani karim@gmail.com wrote: Why not use Javascript commands, there is a technique to insert/execute javascript commands as well, that would be a better direct way http://karimnumerouno.wordpress.com On Fri, Sep 18, 2009 at 10:45 AM, Prajakta Jadhav jadhav.praja...@gmail.com wrote: Can you post the html code of this page? Are there any frames outside the div? On Fri, Sep 18, 2009 at 5:34 AM, Brian Rosenthal brosent...@facebook.com wrote: Hi, We’re using an “editable div”, and we need to be able to set its contents using Watir (in IE). What’s the best way to do that? It doesn’t seem to respond to IE.text_field(...)... And IE.div(...).innerHTML does not work (nor set). (this syntax) div contenteditable=true/div Thanks, Brian -- 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 -~--~~~~--~~--~--~---
[wtr-general] need a command to check for a feild is visible or not
I have a situation I have a text box which pops up when I select a option from a selectlist above it, otherwise is is not visible on the screen if I use the command available in watir eval(browser.field).should_not exist - it fails if i say should exist ---it passes I think it is in the dom can you suggest me any options Thanx in advance regards ravi --~--~-~--~~~---~--~~ 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: need a command to check for a feild is visible or not
Maybe something like: browser.text_field(:id, 'id').visible? http://wtr.rubyforge.org/rdoc/classes/Watir/Element.html#M000318 Hope that helps. On Sep 21, 1:31 pm, ravi ravi8...@gmail.com wrote: I have a situation I have a text box which pops up when I select a option from a selectlist above it, otherwise is is not visible on the screen if I use the command available in watir eval(browser.field).should_not exist - it fails if i say should exist ---it passes I think it is in the dom can you suggest me any options Thanx in advance regards ravi --~--~-~--~~~---~--~~ 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: need a command to check for a feild is visible or not
I have tried visible?.should be false but it didnt work On Mon, Sep 21, 2009 at 8:19 PM, orde ohil...@gmail.com wrote: Maybe something like: browser.text_field(:id, 'id').visible? http://wtr.rubyforge.org/rdoc/classes/Watir/Element.html#M000318 Hope that helps. On Sep 21, 1:31 pm, ravi ravi8...@gmail.com wrote: I have a situation I have a text box which pops up when I select a option from a selectlist above it, otherwise is is not visible on the screen if I use the command available in watir eval(browser.field).should_not exist - it fails if i say should exist ---it passes I think it is in the dom can you suggest me any options Thanx in advance regards ravi --~--~-~--~~~---~--~~ 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: need a command to check for a feild is visible ornot
If you want to check whether a given object is visible in the UI of the page then you can try: ie.hidden (:attribute, property).visible? ==false then puts 'Object is hidden' else puts 'Object is not hidden' end Note that you have to use hidden instead of text_field or button Thanks, Rohan Ojha Blue Star Infotech l*+91 900 4955058l * +91 22 6688 6969 l 6 +91 22 6688 6999 l * mailto:rohan.o...@bsil.com rohan.o...@bsil.com http://www.bsil.com/ www.bsil.com - Where Partnerships Are Built on Trust _ From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] On Behalf Of ravi pulipaka Sent: Tuesday, September 22, 2009 6:29 AM To: watir-general@googlegroups.com Subject: [wtr-general] Re: need a command to check for a feild is visible ornot I have tried visible?.should be false but it didnt work On Mon, Sep 21, 2009 at 8:19 PM, orde ohil...@gmail.com wrote: Maybe something like: browser.text_field(:id, 'id').visible? http://wtr.rubyforge.org/rdoc/classes/Watir/Element.html#M000318 Hope that helps. On Sep 21, 1:31 pm, ravi ravi8...@gmail.com wrote: I have a situation I have a text box which pops up when I select a option from a selectlist above it, otherwise is is not visible on the screen if I use the command available in watir eval(browser.field).should_not exist - it fails if i say should exist ---it passes I think it is in the dom can you suggest me any options Thanx in advance regards ravi --~--~-~--~~~---~--~~ 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] show_frames not reading nested frames properly
Hello all, I've been recently assigned the task of writing the initial test cases for our company's web app. I have trialled Selenium and after banging my head on the desk with some of its quirks I decided to give Watir a go. So far so good, and having irb natively on the Mac helps a lot. But (and there's always a 'but'), I'm having trouble accessing a nested frame's content. Below is the output of irb when I'm trying interactively (crm is the object to which I attached the Firefox window): crm.show_frames There are 1 frames frame: name: mainFrame index: 1 = 0..0 crm.frame(:name, mainFrame).text = crm.frame(:name, mainFrame).show_frames = crm.frame(:name, mainFrame).html = htmlhead\n\n\ntitleSettings - ActionStep Workflow/title \nmeta http-equiv=\Content-Type\ content=\text/html; charset=UTF-8\\n/headframeset rows=\27px,*\ cols=\*\ frameborder=\no\ border=\0\ framespacing=\0\\nframe src=\/mym/ crm/admin_navbar.php?application=crmamp;select_page=\ name= \leftFrame\ noresize=\noresize\\nframe src=\/mym/asfw/crm/ medium/mediumList.php?application=crm\ id=\CrmAdminFrame\ name= \CrmAdminFrame\ noresize=\noresize\\n/frameset \nnoframesbodySorry, this page requires support for Frames.\n/ body/noframes\n/html As you can probably see, Watir (or FireWatir, I'm not sure) can't see the frames inside the html of frame(:name, mainFrame). This frame is contained within an iframe on the main page. Any tips to why this happen or workarounds or even where to read more about this would be greatly appreciated. Regards, Rafael Fonseca --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---