[wtr-general] Re: how to install prev versions of watir
watir-scroll is fixed to work with Watir 6 in v0.3.0 On Wednesday, November 16, 2016 at 10:00:27 PM UTC+6, gary wrote: > > will do thanks > > On Wednesday, 16 November 2016 15:48:20 UTC, Titus Fortner wrote: >> >> File a bug on watir-scroll. Alex just needs to switch reference from >> watir-webdriver to watir. > > -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups "Watir General" group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[wtr-general] Re: How to test infinite scrolling on web page
Try to use watir-scroll https://github.com/p0deje/watir-scroll/ - it might help you. On Friday, December 20, 2013 4:53:20 PM UTC+7, Anisha wrote: Hi, I am using watir-webdriver. The application that I am testing has infinite scrolling implemented. It is more or less like 1000 results present but dis[played 10 at a time and next 10 results appear on scrolling the page, so how do I test if infinite scrolling works or not on my web application. I tried the following code: @browser.execute_script(window.scrollTo(0,1500)) sleep 5 But I do not see any movement on the browser. And also, how do I assert that infinite scrolling is working properly. -- Regards, Anisha Narang -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: cannot search by :url
Why do you search for url when attribute is href? It should be b.link(:href, /loadBuildPage/).exists? On Tuesday, September 17, 2013 6:51:42 AM UTC+7, Rakesh Kapoor wrote: i want to search for links by the partial name of path. i want to click on the element where it points to href=/ive/loadBuildPage.ive the actual html fragment is li … /lilia target=insideview href=/ive/loadBuildPage.ive … /a/li i get error invalid attribute for :url. how do i fix it? irb(main):022:0 assert(b.link(:url, /loadBuildPage/).exists?) Watir::Exception::MissingWayOfFindingObjectException: invalid attribute: :url from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.6.4/lib/watir ebdriver/locators/element_locator.rb:238:in `assert_valid_as_attribute' from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.6.4/lib/watir ebdriver/locators/element_locator.rb:219:in `normalize_selector' from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.6.4/lib/watir ebdriver/locators/element_locator.rb:198:in `normalized_selector' from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.6.4/lib/watir ebdriver/locators/element_locator.rb:195:in `each' from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.6.4/lib/watir ebdriver/locators/element_locator.rb:195:in `normalized_selector' from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.6.4/lib/watir ebdriver/locators/element_locator.rb:75:in `find_first_by_multiple' from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.6.4/lib/watir ebdriver/locators/element_locator.rb:32:in `locate' from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.6.4/lib/watir ebdriver/elements/element.rb:509:in `locate' from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.6.4/lib/watir ebdriver/elements/element.rb:487:in `assert_exists' from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.6.4/lib/watir ebdriver/elements/element.rb:43:in `exists?' -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Modal dialog present: A script on this page may be busy, or it may have stopped responding.
Hi Have you tried things mentioned here: http://watirwebdriver.com/javascript-dialogs/? If you have any JS alerts you need to handle them using methods mentioned in provided page or you will always get UnhandledAlertException. Such methods should be used immediately after code/action that calling alert, like: browser.button().click Javascript alert appeared here browser.alert.ok -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Possible element.click bug
Hi It is just idea, because I have a lot of issues due that. When you do: $b.li(:id,'ctl00_AddMenu').hover action, so correct item is hovered, right?I mean Menu1 is become active But then, when you do $b.li(:id, 'ctl00_AddAssetFolderMenuItem').click, menu2 become active and wrong element is clicked From user perspective it looks like mouse cursor moved on wrong menu item If so, you can play with next javascript events, it helps me sometime: $b.li(:id,'ctl00_AddMenu').fire_event(onmousedown) $b.li(:id, 'ctl00_AddAssetFolderMenuItem').click or $b.li(:id,'ctl00_AddMenu').fire_event(onmousedown) $b.li(:id,'ctl00_AddMenu').fire_event(onclick) $b.li(:id, 'ctl00_AddAssetFolderMenuItem').click -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] [watir-webdriver] enablePersistentHover capability access
Hi folks Does somebody know how to access capabilities from https://code.google.com/p/selenium/wiki/DesiredCapabilities page? I am able to access capabilities only from first three tables: require 'watir-webdriver' caps = Selenium::WebDriver::Remote::Capabilities.ie = #Selenium::WebDriver::Remote::Capabilities:0x2617ce0 @capabilities={:browser _name=internet explorer, :version=, :platform=:windows, :javascript_enabl ed=false, :css_selectors_enabled=true, :takes_screenshot=true, :native_events =false, :rotatable=false, :firefox_profile=nil, :proxy=nil} But what about any other (for example specific for IE)? I have tried different version of selenium-webdriver gem (and of course newer than 2.26) without any luck Thanks, Alex -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: how to check TextArea is enabled or disabled
As Jarmo pointed, there is #disabled? method which is generated from HTML spec. I doubt we need one more #enabled? On Wednesday, June 19, 2013 6:20:55 PM UTC+7, mc060200778 wrote: Hi, Is there any method available using which i can check whether the textarea is enabled or disabled. i checked the following http://rdoc.info/gems/watir-webdriver/Watir/TextArea but could not find enabled? method. Please suggest -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [wtr-general] Re: Introducing Watirsome
Yep, I understand. A lot similar does page-object by wrapping elements in own classes thus allowing to support both watir-webdriver and selenium-webdriver. The point of watirsome is a bit different - it exposes Watir classes so you could work with the same old well-known API. That's what I needed. -- Cheerz, Alex Rodionov On Sunday, May 19, 2013 at 21:29 , Jarmo Pertman wrote: By the way, element class method in test-page is not the same as your tag-based methods. Element in test-page is a method for providing container element - e.g. like el in Backbone.js. The method name is element because it is framework agnostic - e.g. you can use it with Watir-WebDriver, Selenium-Webdriver, Capybara or with whatever other framework - i'd say that's the real main difference between test-page and Watirsome. Jarmo On Saturday, May 18, 2013 7:22:18 PM UTC+3, Alex Rodionov wrote: For the record, I have updated Watir readme to include all these libraries. On Saturday, May 18, 2013 8:19:47 PM UTC+7, Alex Rodionov wrote: @Jarmo @Chuck I created this because I've been using page-object (https://github.com/cheezy/page-object) for more than a year and I didn't know abut test-factory and test-page. It has a bit different API compared to them: test-factory and test-page provide with #element class method, while page-object provides with a range of tag-based methods (#div, #text_field, etc.) I find it much nicer as it is more readable. I've been contributing to page-object constantly but at some point faced architecture limitations which resulted that it may be easier to create my own library which implements similar API other than modify page-object. So I did just the same. The main idea is to be as close to Watir API as possible (the same locators, method names) + some extra stuff. It's achieved because watirsome is practically a proxy to Watir browser. This allowed me to move all element definitions to class methods so it's much easier to support such page classes. Extra stuff includes initializers for page classes and region modules (to support polymorphous page objects (http://p0deje.blogspot.ru/2012/01/polymorphous-page-objects.html)), custom locators which for now is any boolean method Watir::Element responds to. For example: # find first visible text field with label Username text_field :username, label: 'Username', visible: true I treat it as an alternative to gems you mentioned which is more suitable for me. On Saturday, May 18, 2013 6:46:25 PM UTC+7, Jarmo Pertman wrote: Hi! If you're looking something really lightweight, then my gem Test::Page is the one you're looking for: https://github.com/jarmo/test-page Jarmo On Friday, May 17, 2013 11:46:18 PM UTC+3, Chuck van der Linden wrote: On Monday, May 13, 2013 11:36:12 PM UTC-7, Alex Rodionov wrote: Hey guys! I've recently released Watirsome, which is a gem I've been using at work for a long time as an alternative to well known page-object. It's a lot similar to it, but more dynamic and based on watir-webdriver. Thus (at least for now), it works only with it. Anyways, you can take a look at https://github.com/p0deje/watirsome and probably give it a shot! How is it different from, or would you contrast it with the test-factory page objects gem? http://rubygems.org/gems/test-factory just wondering as that is a lightweight, designed for Watir page objects gem that I'm using (and so far like very much) -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com (mailto:watir-general@googlegroups.com) http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com (mailto:watir-general+unsubscr...@googlegroups.com) --- You received this message because you are subscribed to a topic in the Google Groups Watir General group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/watir-general/7a9os1u67MI/unsubscribe?hl=en. To unsubscribe from this group and all its topics, send an email to watir-general+unsubscr...@googlegroups.com (mailto:watir-general+unsubscr...@googlegroups.com). For more options, visit https://groups.google.com/groups/opt_out. -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https
[wtr-general] Re: Introducing Watirsome
@Jarmo @Chuck I created this because I've been using page-objecthttps://github.com/cheezy/page-objectfor more than a year and I didn't know abut test-factory and test-page. It has a bit different API compared to them: test-factory and test-page provide with #element class method, while page-object provides with a range of tag-based methods (#div, #text_field, etc.) I find it much nicer as it is more readable. I've been contributing to page-object constantly but at some point faced architecture limitations which resulted that it may be easier to create my own library which implements similar API other than modify page-object. So I did just the same. The main idea is to be as close to Watir API as possible (the same locators, method names) + some extra stuff. It's achieved because watirsome is practically a proxy to Watir browser. This allowed me to move all element definitions to class methods so it's much easier to support such page classes. Extra stuff includes initializers for page classes and region modules (to support polymorphous page objectshttp://p0deje.blogspot.ru/2012/01/polymorphous-page-objects.html), custom locators which for now is any boolean method Watir::Element responds to. For example: # find first visible text field with label Username text_field :username, label: 'Username', visible: true I treat it as an alternative to gems you mentioned which is more suitable for me. On Saturday, May 18, 2013 6:46:25 PM UTC+7, Jarmo Pertman wrote: Hi! If you're looking something really lightweight, then my gem Test::Page is the one you're looking for: https://github.com/jarmo/test-page Jarmo On Friday, May 17, 2013 11:46:18 PM UTC+3, Chuck van der Linden wrote: On Monday, May 13, 2013 11:36:12 PM UTC-7, Alex Rodionov wrote: Hey guys! I've recently released Watirsome, which is a gem I've been using at work for a long time as an alternative to well known page-object. It's a lot similar to it, but more dynamic and based on watir-webdriver. Thus (at least for now), it works only with it. Anyways, you can take a look at https://github.com/p0deje/watirsome and probably give it a shot! How is it different from, or would you contrast it with the test-factory page objects gem? http://rubygems.org/gems/test-factory just wondering as that is a lightweight, designed for Watir page objects gem that I'm using (and so far like very much) -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: How to locate an element on a mask layer?
It is very difficult to help you unless you provide some actual Ruby and HTML code. On Saturday, May 18, 2013 9:28:26 AM UTC+7, Christian wrote: After I clicked a button,then the site gives a floating mask layer. I tried to find an element on the mask layer using class,like (:class=blabla),but it failed. What should I do to locate the element? -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Cannot identify button element by value?
Reposting myself from SO: +1 to raise this as issue on watir-webdriver as it definitely needs discussion. I use button(:value) in my tests a lot and it actually matches button's value, so there is something behind this. According to code, button tag name and value are treated specifically. According to history, Jari has implemented this when he was making watir-webdriver compliant to watirspec, so I suppose it may come from old Watir implementation. Nevertheless, it needs to be discussed. On Saturday, May 18, 2013 12:34:26 AM UTC+7, Chuck van der Linden wrote: On Thursday, May 16, 2013 6:14:34 AM UTC-7, Dan wrote: It doesn't look like it's just Chrome actually. I got the same results in Firefox. Looks like the stackoverflow answer addresses the issue? If I change from button type of button to input type of button it works like you would expect. b = Watir::Browser.new :firefox = #Watir::Browser:0x110337500 url=about:blank title= b.goto(file:///Users/admin/Desktop/button.html) = file:///Users/admin/Desktop/button.html b.html = html xmlns=\http://www.w3.org/1999/xhtml\;head/headbodybutton value=\hey\ onclick=\alert('Hello world!')\ type=\button\Click Me!/button/body/html b.button.value = hey b.button(:value = hey).exists? = false b.button(:value = hey).click Watir::Exception::UnknownObjectException: unable to locate element, using {:value=hey, :tag_name=button} from /Library/Ruby/Gems/1.8/gems/watir-webdriver-0.6.4/lib/watir-webdriver/elements/element.rb:490:in `assert_exists' from /Library/Ruby/Gems/1.8/gems/watir-webdriver-0.6.4/lib/watir-webdriver/elements/element.rb:118:in `click' from (irb):11 # Changed from button to input type of button b.refresh = [] b.html = html xmlns=\http://www.w3.org/1999/xhtml\;head/headbodyinput type=\button\ value=\hey\ onclick=\alert('Hello world!')\ /Click Me!/body/html b.button(:value = hey).exists? = true This is likely because for the input tag of type button, there was no separate text (at least i never see examples of this) the value attribute determined the text that was displayed for the button.. so for that type of element value=text The button tag is a lot more robust but seems to be used less often (perhaps due to (misguided?)advice about browser compatibility issues?) But the actual button tag, the value and the text are two different things, and you may need to specifically use one or the other to select the element A great example here might be il8n issues, where it's easier for scripting code to have a consistent value returned by a button, but you may want to display different text based on a language setting (e.g. a bilingual site) In that case you may also want your automation to identify by the value, as it is predictable. It seems to me on that basis alone, we ought to be able to predictably select a 'button' tag by its value On Wednesday, May 15, 2013 5:35:12 PM UTC-4, Chuck van der Linden wrote: See this SO issue for HTML sample, code samples tried in IRB http://stackoverflow.com/questions/16574999/watir-webdriver-unable-to-identify-button-by-value the short of it. I've got HTML like button type=button class=btn fb-user-type name=fbRadios value=is_agent style=An Agent/button When I try to identify the button by class, or text, it works, but by value such as b.button(:value = is_agent).exists? fails (that returns false, most other stuff returns the typical cannot be located message) what the heck? shouldn't this be working? (Chrome on a Mac) -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Introducing Watirsome
For the record, I have updated Watir readme to include all these libraries. On Saturday, May 18, 2013 8:19:47 PM UTC+7, Alex Rodionov wrote: @Jarmo @Chuck I created this because I've been using page-objecthttps://github.com/cheezy/page-objectfor more than a year and I didn't know abut test-factory and test-page. It has a bit different API compared to them: test-factory and test-page provide with #element class method, while page-object provides with a range of tag-based methods (#div, #text_field, etc.) I find it much nicer as it is more readable. I've been contributing to page-object constantly but at some point faced architecture limitations which resulted that it may be easier to create my own library which implements similar API other than modify page-object. So I did just the same. The main idea is to be as close to Watir API as possible (the same locators, method names) + some extra stuff. It's achieved because watirsome is practically a proxy to Watir browser. This allowed me to move all element definitions to class methods so it's much easier to support such page classes. Extra stuff includes initializers for page classes and region modules (to support polymorphous page objectshttp://p0deje.blogspot.ru/2012/01/polymorphous-page-objects.html), custom locators which for now is any boolean method Watir::Element responds to. For example: # find first visible text field with label Username text_field :username, label: 'Username', visible: true I treat it as an alternative to gems you mentioned which is more suitable for me. On Saturday, May 18, 2013 6:46:25 PM UTC+7, Jarmo Pertman wrote: Hi! If you're looking something really lightweight, then my gem Test::Page is the one you're looking for: https://github.com/jarmo/test-page Jarmo On Friday, May 17, 2013 11:46:18 PM UTC+3, Chuck van der Linden wrote: On Monday, May 13, 2013 11:36:12 PM UTC-7, Alex Rodionov wrote: Hey guys! I've recently released Watirsome, which is a gem I've been using at work for a long time as an alternative to well known page-object. It's a lot similar to it, but more dynamic and based on watir-webdriver. Thus (at least for now), it works only with it. Anyways, you can take a look at https://github.com/p0deje/watirsome and probably give it a shot! How is it different from, or would you contrast it with the test-factory page objects gem? http://rubygems.org/gems/test-factory just wondering as that is a lightweight, designed for Watir page objects gem that I'm using (and so far like very much) -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Parse HTML from database in Watir?
For the record, that was replied on IRC: [09:25am] p0deje: lonny_: you can use data URI [09:26am] p0deje: browser.goto data:text/html,#{html} [09:27am] lonny_: Thanks. I'll give that a try. [09:29am] lonny_: Yes! That worked. Thank you very much. On Thursday, May 16, 2013 9:03:22 AM UTC+7, Lonny Eachus wrote: This is a rather urgent issue. I have some whole-page HTML in a database. I would like to get this HTML into Watir for parsing. How can I tell Watir to load this HTML into the DOM? I know I could write the data to a .html file and read it that way, but that would seem to be a rather roundabout way to do it. How does one load HTML from text into Watir? Lonny Eachus === -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Need to get the count of sections within a specific div
That's pretty straightforward: browser.div(id: 'boxContainer').sections.size On Thursday, May 16, 2013 1:03:39 PM UTC+7, bhag...@gmail.com wrote: HI All, I am new to Watir and I need to get the count of sections within a specific DIV. Please see below. section id=lsBodyContent div id=boxContainer class=lsBoxContainer section class=lsNewContentStructureBox ng-scope ng-repeat=contentStructure in contentStructures p class=ng-bindingText 1/p a href=#/scheme/Text 1 pimg src=assets/img/edit.svg alt=edit-image class=lsEditImg/p /a /section section class=lsNewContentStructureBox ng-scope ng-repeat=contentStructure in contentStructures p class=ng-bindingText 2/p a href=#/scheme/Text 2 pimg src=assets/img/edit.svg alt=edit-image class=lsEditImg/p /a /section section class=lsNewContentStructureBox ng-scope ng-repeat=contentStructure in contentStructures p class=ng-bindingText 3/p a href=#/scheme/Text 3 pimg src=assets/img/edit.svg alt=edit-image class=lsEditImg/p /a /section /div /section I need to get the number of sections within the DIV id boxContainer Thanks, Bhagya. -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Watir webdriver - How to click on last td in table ?
Even more simple browser.table(class: 'rctable').td(index: -1).click On Thursday, May 16, 2013 4:19:35 AM UTC+7, Chuck van der Linden wrote: On Thursday, May 9, 2013 6:23:38 PM UTC-7, Ankita@Adslot wrote: If the number of rows is static, would make sense to use xpath and locate the last row with it and then click on image of the last row. something like b.element(:xpath,//table[@class='rctable']/tbody/tr[15]/td[2]/img[@src=' /tracker/images/skin2/bolean.png']).click If the number of rows/cells is predictable you don't need to resort to xpath, just do something like browser.table(:class = rctable)[15][2].img.click A few other things that might work browser.table(:class = 'rctable').rows.last.img.click On Wednesday, May 1, 2013 12:44:18 AM UTC+10, watir webdriver wrote: Sorry Filipin...ignore my previous comment...its not working and still its clicking on the first td in the table. Any one can help me in this ? On Thursday, April 25, 2013 5:34:21 PM UTC+1, watir webdriver wrote: Hi there, In my application,I've to select the last td (which is an img) in table.Can anyone help me with this ? *HTML :* table class=rctable thead tbody tr td a href=edit.page?id=6Shirts main/a /td td a onclick=return confirm('Delete creative?') href=delete.page?cid=6 a href=edit.page?id=6 a href=?duplicateId=6 /td /tr tr td a href=edit.page?id=7Suits main/a /td td a onclick=return confirm('Delete creative?') href=delete.page?cid=7 a href=edit.page?id=7 a href=?duplicateId=7 /td /tr tr td a href=edit.page?id=8Shoes main/a /td td a onclick=return confirm('Delete creative?') href=delete.page?cid=8 a href=edit.page?id=8 a href=?duplicateId=8 /td /tr tr td a href=edit.page?id=10Womens main/a /td td a onclick=return confirm('Delete creative?') href=delete.page?cid=10 a href=edit.page?id=10 a href=?duplicateId=10 /td /tr tr td a href=edit.page?id=11Coats side/a /td td a onclick=return confirm('Delete creative?') href=delete.page?cid=11 a href=edit.page?id=11 a href=?duplicateId=11 /td /tr tr td a href=edit.page?id=12Knitwear side/a /td td a onclick=return confirm('Delete creative?') href=delete.page?cid=12 a href=edit.page?id=12 a href=?duplicateId=12 /td /tr tr td a href=edit.page?id=13New side/a /td td a onclick=return confirm('Delete creative?') href=delete.page?cid=13 a href=edit.page?id=13 a href=?duplicateId=13 /td /tr tr td a href=edit.page?id=14Shoes side/a /td td a onclick=return confirm('Delete creative?') href=delete.page?cid=14 a href=edit.page?id=14 a href=?duplicateId=14 /td /tr tr td a href=edit.page?id=15Ties side/a /td td a onclick=return confirm('Delete creative?') href=delete.page?cid=15 a href=edit.page?id=15 a href=?duplicateId=15 /td /tr tr td a href=edit.page?id=16Womens side/a /td td a onclick=return confirm('Delete creative?') href=delete.page?cid=16 a href=edit.page?id=16 a href=?duplicateId=16 /td /tr tr td a href=edit.page?id=19Home page spring/a /td td a onclick=return confirm('Delete creative?') href=delete.page?cid=19 a href=edit.page?id=19 a href=?duplicateId=19 /td /tr tr td a href=edit.page?id=34fhg/a /td td a onclick=return confirm('Delete creative?') href=delete.page?cid=34 a href=edit.page?id=34 a href=?duplicateId=34 /td /tr tr td a href=edit.page?id=36AutoTestCreative/a /td td a onclick=return confirm('Delete creative?') href=delete.page?cid=36 a href=edit.page?id=36 a href=?duplicateId=36 /td /tr tr td a href=edit.page?id=37AutoTestCreative/a /td td a onclick=return confirm('Delete creative?') href=delete.page?cid=37 a href=edit.page?id=37 a href=?duplicateId=37 /td /tr tr td a href=edit.page?id=38AutoTestCreative/a /td td a onclick=return confirm('Delete creative?') href=delete.page?cid=38 a href=edit.page?id=38 a href=?duplicateId=38 *img title=Duplicate src=/tracker/images/skin2/bolean.png* /a /td /tr /tbody /table Implemenetd as below : @browser.img(:src = /tracker/images/skin2/bolean.png).click which is clicking on the first image. Help is much more appreciated. Thanks. -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Introducing Watirsome
Hey guys! I've recently released Watirsome, which is a gem I've been using at work for a long time as an alternative to well known page-object. It's a lot similar to it, but more dynamic and based on watir-webdriver. Thus (at least for now), it works only with it. Anyways, you can take a look at https://github.com/p0deje/watirsome and probably give it a shot! -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Re-run mechanism for cucumber+watir-webdriver
Thanks Željko, but I knew about that. Sorry, but I formed my question not in right way. cucumber -f rerun statement will create only list of failed test cases, but I need to be able to configure that process, for example add initialization step (e.g. login into app) to that list. Proposed solution just perfect and what I actually needed except mentioned thing. Could we use tags or something for this purpose to say always put some steps to that rerun file? -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re-run mechanism for cucumber+watir-webdriver
Hi guys Does somebody using any re-run mechanisms for failed test cases (not Continuous Integration approach)? I need something like this: Feature File Scenario 1: Login Given something . Scenario 2: Go_somewhere Given something . Some scenario failed after execution Create batch file Put here: cucumber feature_file_name.feature:3:6:12:20 (where numbers are line numbers of failed test cases) or cucumber feature_file_name.feature:Login:Go_somewhere: Thanks a lot in advance, Alex -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: [watir-webdriver] how to manage timeout for after click event
Solution worked like a charm. Thanks Dan for it Regarding delays, yes you absolutely right and I also think that is unacceptable, but I can't do anything, because I just must to run automation scripts on cheaper devices. Customers have much expensive ones:) -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Browser resize on watir-classic.
Before going on watir-webdriver, I was using autoit for these operations. There are some other solutions, but in total you can't do that using only watir methods -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Unable to select the radiobutton and also unable to detect the iFrame
yes, you need such intermediate things only if you have two iframes with absolutely same attributes -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Watir Webdriver Logger
Just a suggestion I like to use log4r gem for all logging procedures, of course mixing with cucumber. It is pretty simple library that has everything that is needed with all these levels and outputters type of things. http://log4r.rubyforge.org/ -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] [watir-webdriver] how to manage timeout for after click event
Hi guys I have next situation: When I click on one of buttons in my application, page is loading for more than two minutes and raise exception inside of watir-webdriver click method. Obviously any waiters (like wait_until something) will not help in this situation, because exception is raised after event, not before action. Code is simple: browser.button(:type, submit).click or browser.button(:type, submit).wait_until_present.click Exception: C:/Ruby192/lib/ruby/1.9.1/net/protocol.rb:140:in `rescue in rbuf_fill': Timeout::Error (Timeout::Error) from C:/Ruby192/lib/ruby/1.9.1/net/protocol.rb:134:in `rbuf_fill' from C:/Ruby192/lib/ruby/1.9.1/net/protocol.rb:116:in `readuntil' from C:/Ruby192/lib/ruby/1.9.1/net/protocol.rb:126:in `readline' from C:/Ruby192/lib/ruby/1.9.1/net/http.rb:2219:in `read_status_line' from C:/Ruby192/lib/ruby/1.9.1/net/http.rb:2208:in `read_new' from C:/Ruby192/lib/ruby/1.9.1/net/http.rb:1191:in `transport_request' from C:/Ruby192/lib/ruby/1.9.1/net/http.rb:1177:in `request' from C:/Ruby192/lib/ruby/1.9.1/net/http.rb:1170:in `block in request' from C:/Ruby192/lib/ruby/1.9.1/net/http.rb:627:in `start' from C:/Ruby192/lib/ruby/1.9.1/net/http.rb:1168:in `request' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/re mote/http/default.rb:82:in `response_for' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/re mote/http/default.rb:38:in `request' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/re mote/http/common.rb:40:in `call' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/re mote/bridge.rb:598:in `raw_execute' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/re mote/bridge.rb:576:in `execute' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/re mote/bridge.rb:358:in `clickElement' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/co mmon/element.rb:54:in `click' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.2/lib/watir-webdriver/elements/ element.rb:131:in `click' -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: [watir-webdriver] how to manage timeout for after click event
Great. Thanks Dan, I will try that solution -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: newbie question cucumber-watir
Have you tried to use waiters or delays? Something like: @browser.text_field(:name = 'j_username').wait_until_present -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: how to click button from nested divs
I don't think that problem in fact that div is nested, but more that click event is not working as it should Try browser.button(:id, *btnAddNewCustomer*).fire_event(onclick) or browser.button(:id, *btnAddNewCustomer*).fire_event(onmousedown) or browser.button(:id, *btnAddNewCustomer*).send_keys :enter or browser.button(:id, *btnAddNewCustomer*).click browser.button(:id, *btnAddNewCustomer*).click to see whether problem in click action -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Unable to click OK confirm popup
Provide more of your code like where you put mentioned statements Have you tried the same things from irb? -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Element is not clickable at point
try element.fire_event(onclick) or element.fire_event(onmousedown) or element.send_keys :enter instead element.click second, it can be absolutely okay that you are not able to click that button if it under another container. Why automation should able click if you physically can't do that? -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Watir Webdriver Zoom
hmm, as far as I know watir-webdriver gives an immediate exception if you run application using non-default(not 100%) zoom, so my only suggestion that high zooom and UI looks bigger icon and buttons etc is normal and actual/required zoom is not normal :) Just reset your browser zoom settings and it should work And also browse that forum, as far as I remember that question was raised here before -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: How to zoom out web app using watir
You can't do that as watir-webdriver kindly gives you exception. And that's just SUPER as watir in the past just running the scripts without any errors and in result days can be wasted until someone noticed that we had zoom 105% :) -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Selecting values in 2 ndDropdown Issue in Watir-WebDriver
Please provide select list tags for second list as you provided for the first one I have only one suggestion at that moment. Probably, you have two select lists with the same id (MainContent_drpMake) and watir-webdriver taken first of them that it faced in DOM and that list does not contain ACURA value -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Wait method execute_script in watir-webdriver
Hmm Why don't you just wait for all elements that you need to use for your execute_script method and only after that call it? like: browser.element(:attribute, attribute_value).when_present? after that call your method -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Jquery+Watir problem with file_field
b.button(:value, Submit).click Some not so smart ideas :): b.button(:value, Submit).fire_event(onclick) or b.button(:value, Submit).fire_event(onmousedown) or between these two actions b.file_field(:id, messageFile).set(@messagePath) b.button(:value, Submit).click try to do some another action (click somewhere or something) to set focus out from file field -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Need code snipet
But if original window will be closed, so probably you will get an immediate error and will not be able to do browser.window(:title = annoying popup).use do because browser instance will not be initialized anymore but at least try Željko suggestion -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Custom report system for cucumber+watir-webdriver
Yes, mostly I am speaking about HTML reports generated by Cucumber, but absolutely custom (so I can add some extra information like time, build number) and nice looking. I have created something like this, but information: Scenario name Pass Scenario name Fail on white background looks like a crap in 2013 :) So I am asking, maybe someone created nice looking HTML report system for trivial cases and can share the details + One more thing. Is it possible to create re-run mechanism for failed test cases easily? Something like batch file that will contain cucumber Feature_File_name:Failed_scenario_1:Failed_Scenario_2 and etc -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Issue Clicking JQuery Rendered Buttons
I have a lot experience in automating JQuery+Watir and can assure you that DOM tree can be different for IE and Firefox representations So could you please check DOM using Firebug in Firefox to make sure that: div class=ui-dialog-buttonpane ui-widget-content ui-helper-clearfixdiv class=ui-dialog-buttonsetbutton class=ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only type=button role=buttonspan class=ui-button-text OK /span/button/div/div/div has the same appearance? That OK button can be inside of something really different also you can try, just to check that button can be pressed: browser.button(:class, ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only).click but I think that button can have another class in Firefox -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Watir-webdriver and Ruby 2.0.0 - known compatabilty issues?
Do you have any reasons to move on Ruby 2.0? -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Segmentation fault
I would also strongly recommend log4r gem as it is really good tool for logging.It has really nice outputter types and log levels. http://log4r.rubyforge.org/manual.html -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Jquery+Watir problem with file_field
Hmm, strange Could you perform mentioned steps manually? Is everything work as it should? (without any file clearing from select window)? Did you try to put static delay just for test purpose to see that functionality works properly? (like sleep 10) -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: how to install cucumber in windows xp sp3
try command gem update -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Custom report system for cucumber+watir-webdriver
Just curious, maybe someone was working before to create nice looking and informative reports for cucumber+watir-webdriver scripts. Not just (because it is not customizable or not so easy to customize): *cucumber featurename.feature --format html --out report.html --format pretty* * * And not for continuous integration systems like Jenkins or Hudson Something standalone Any links, ideas, pieces of code will be really helpful Thanks in advance -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Drag and drop on Win7+IE9
Sorry It depends not even on position, but whether mouse cursor is physically located inside of browser window, so if I for example have not maximized window and cursor is situated somewhere (no matter where) but not in browser window - everything works properly I appreciate any help Thanks, Alex -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Drag and drop on Win7+IE9
Hi Joe Thanks for suggestion. I did not do that before, but I just have tried to click and it doesn't help to drag and drop Strange, because everything works just perfect for Win8+IE10 and WinXP+IE8. And, of course it works from irb (for Win7+IE9), because mouse concentrated on CMD, not on browser If that was single case, I would not post here, but it is like 60 cases failing due this issue. I am using last watir-webdriver gem and tried three different versions of driver. Thanks, Alex -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Drag and drop on Win7+IE9
Nope I can see how necessary controls (what should be dragged and that where it should be dragged) just blurring (selected for a second). Here is an example that I use for testing: http://dev.sencha.com/deploy/ext-3.4.0/examples/tree/reorder.html Code: browser.span(:text, ext-core).double_click browser.span(:text, debug.js).drag_and_drop_on(browser.span(:text, ext-core)) browser.span(:text, util).drag_and_drop_on(browser.span(:text, ext-core)) I can provide more examples if necessary Only Win7+IE9 Thanks for any help, Alex -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Segmentation fault
Could you put more information? Your OS, fileutil gem version and etc Have you tried different ruby and gem versions? I can see something similar, but very old and on linux: http://www.ruby-forum.com/topic/60495 -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Do Watir scripts run in selenium
If we speak from code similarities prospective: watir scripts can work on watir-webdriver (sometimes with some code changes), but if you mean selenium, so probably no, because watir and selenium have completely different syntax. -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Serious memory leaks on IE9 and IE10 for watir-webdriver
Nope, Firefox 3.6.x, Firefox 15 and IE8 are okay. But for these two browsers I can see that memory increased for each action (click and etc) on 10-15 mb Have you tested something on IE9IE10? Regarding defect (something the same as I have): http://code.google.com/p/selenium/issues/detail?can=2start=700num=100q=colspec=ID%20Stars%20Type%20Status%20Priority%20Milestone%20Owner%20Summarygroupby=sort=id=3918 Regarding example (comment 16 from that defect): Very simple script (no matter what language you will use, can be adopted on watir-webdriver): driver.get(http://google.com;) try: for i in range(1000): el = driver.find_element_by_xpath(//input[@name='q']) el.get_attribute('class') finally: driver.quit() I understand that this thread/group can be not related to webdriver core itself, but anyway I want to try my luck here Appreciate any help -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Data driven testing using watir-classic v 3.0.0
I would propose to use something more simpler than excel like structured text file or xml (or some RDBMS), but if your case is simple enough and such functionality will be used only once, so I prefer to use xml -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [wtr-general] Re: Serious memory leaks on IE9 and IE10 for watir-webdriver
As far I understand that thread: http://code.google.com/p/selenium/issues/detail?can=2start=700num=100q=colspec=ID%20Stars%20Type%20Status%20Priority%20Milestone%20Owner%20Summarygroupby=sort=id=3918 is selenium/webdriver bug tracker system So if I create the same defect, it will be just duplicated On Thursday, February 14, 2013 12:07:52 PM UTC+2, Željko Filipin wrote: On Thu, Feb 14, 2013 at 11:05 AM, Alex Shtayer asht...@gmail.comjavascript: wrote: I understand that this thread/group can be not related to webdriver core itself, but anyway I want to try my luck here Why don't you report the problem in selenium/webdriver bug tracker? Željko -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [wtr-general] Re: Serious memory leaks on IE9 and IE10 for watir-webdriver
Are you closing browser after each case? Yes. Code: https://github.com/wikimedia/qa-browsertests Željko Are you able access that link? Because I get 'This repository is temporarily unavailable.' message ' -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Serious memory leaks on IE9 and IE10 for watir-webdriver
Thanks Željko for providing all this information You give me some nice ideas Probably, I will need to think about closing browser after each case which will be very hard to do due my code not so nice as yours and it is created in such way that it will be mostly impossible to do Need to read Cucumber Book for some possible solutions:) Thanks once more -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [wtr-general] Re: Serious memory leaks on IE9 and IE10 for watir-webdriver
Thanks a lot. Without you I will play with all of this for weeks I am sorry, but last question (pretty off topic) Do we have any alternative for background keyword, but vice verse? I mean not for pre-initialization, but for post-execution I know about hooks: After do |scenario| end But due of project structure it possibly will not work for me(not sure right now) I need to run one scenario before each one (will use background) and one after each scenario. How do you think, is it possible to do? -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Data driven testing using watir-classic v 3.0.0
Yes, I agree. For such kind of tasks yaml will be much better, sorry forgot about that. I use xml for configuration file purpose (it seems more logical for me), but for some input data ranges, it is better to use yaml On Thursday, February 14, 2013 4:01:30 PM UTC+2, Dan wrote: yaml is a good option as well, and much easier to use with Ruby than xml. On Thursday, February 14, 2013 5:09:04 AM UTC-5, Alex Shtayer wrote: I would propose to use something more simpler than excel like structured text file or xml (or some RDBMS), but if your case is simple enough and such functionality will be used only once, so I prefer to use xml -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Serious memory leaks on IE9 and IE10 for watir-webdriver
After some test cases executed (only 5-10 minutes of execution which is not enough for any memory overflow from any point of view) I am getting No connection could be made because the target machine actively refused it . - connect(2) (Errno::ECONNREFUSED) C:/Ruby192/lib/ruby/1.9.1/net/http.rb:644:in `initialize' C:/Ruby192/lib/ruby/1.9.1/net/http.rb:644:in `open' C:/Ruby192/lib/ruby/1.9.1/net/http.rb:644:in `block in connect' C:/Ruby192/lib/ruby/1.9.1/timeout.rb:44:in `timeout' C:/Ruby192/lib/ruby/1.9.1/timeout.rb:87:in `timeout' C:/Ruby192/lib/ruby/1.9.1/net/http.rb:644:in `connect' C:/Ruby192/lib/ruby/1.9.1/net/http.rb:637:in `do_start' C:/Ruby192/lib/ruby/1.9.1/net/http.rb:626:in `start' C:/Ruby192/lib/ruby/1.9.1/net/http.rb:1168:in `request' exception In task manager I can see that 1.5 Gb of RAM is already consumed No matter what test suite and what functionality I am testing I reviewed all the threads and even issue tracking system (there is some kind of this defect, but no update here), so mostly sure that I do not duplicate posts. Is there any way to fix that except closing IE after each action? (it will be very time consuming to re-implement everything). Everything works fine with watir, but not on watir-webdriver I really appreciate any help here! -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Serious memory leaks on IE9 and IE10 for watir-webdriver
Sorry, forget to add: Env: 1. ruby 1.9.2p180 2. watir-webdriver (0.6.2) 3. InternetExplorerDriver server (32-bit) 2.29.0.0 But was reproducible on 2.28.0.0 and 2.27.0.0 too -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: watir, watir-webdriver, watir-classic: history and current state?
but Watir classic is still only for Internet Explorer or something changed? -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Partial match on element id
using regular expressions e.g. browser.link(:id, /.*1234.*/) or xpaths browser.link(:xpath, //a[contains(@id,'1234')])) -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: how cucumber finds html ids - via DOM or by parsing html code ?
I know more about the difference between watir (not classic) and watir-webdriver for simple addressing cases like browser.link(:id, 'blah') I do not see any difference in performance or even watir-webdriver works MUCH faster, but for really complex DOMs and complex addressing like browser.frame(:id, someregexp).link(:id, someregexp) I can see great performance degradation in comparison with watir. I have cases (in complex situations) when watir-webdriver click on single button 5 minutes or so. Maybe, it is just due some of my applications and it is not a general case, but I recommend to look at first what thing do you want to automate. If your application is really complex (I mean with complex DOM), I would prefer to look on Watir classic, but if you application not some Enterprise level and just simple web site (without sub-sub-sub frames), so I prefer watir-webdriver -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: how to set focus on a popup window and continue work in popup window as a Current window in WATIR
Did you get some error? It will be informative if you provide some exception or something rather than 'it is not working' Hmm, not sure how such statement can work at all: popup = $browser.attach($browser.link(:url, $browser.link(:url, javascript:doNothing()).click)) .attach method is more used to attach to existing instances of browser, not to Javascript alerts *e.g.* *Watir*::IE.*attach*(:title, Google) -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Partial match on element id
If I understand your question correctly, so both of my examples are given for string case (not for numbers or something) as all DOM values that we get are strings by default or did you mean how you can use variable instead exact number? you can try something like: browser.link(:id, /.*#{num1}.*/) such statement should pass variable value directly to your expression -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Partial match on element id
yes, that's right. just used to that style :) -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: how to set focus on a popup window and continue work in popup window as a Current window in WATIR
Željko provided good link, but probably that approach works only for watir-webdriver For Watir: - If that popup window is usual modal window, so you can work with it through .attach method - If that popup window is Javascript pop-up, so you do not have any way to do that, except using other libraries like AutoIT, Sikuli or JavaScript itself. Please, refer to: http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups Also refer to: http://wiki.openqa.org/display/WTR/Pop+Ups -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: watir-webdriver href javascript
What do you mean by automate? How to click on the element? You can use usual method like: browser.link(:text, Select).click or if due any reason click method does not work: browser.link(:text, Select).fire_event(onclick) or browser.link(:text, Select).fire_event(onmousedown) On Wednesday, February 6, 2013 11:11:52 AM UTC+2, mc060200778 wrote: Hi, how would you automate following Javascript link in watir-webdriver? a href='javascript:selectDevice(122334455,12121212,#divAddCustomerLine);'Select/a Thanks -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: help please
Maybe, you can try browser.div(:*id, idDiv_PWD_UsernameExample*).send_keys blah-blah or browser.div(:*id, idDiv_PWD_UsernameExample*).click browser.send_keys blah-blah That solution works for me perfectly (for text in divs) On Saturday, February 2, 2013 8:19:11 PM UTC+2, mc060200778 wrote: Hi, my question is how to set value in the textbox with following html code *div id=idDiv_PWD_UsernameExample class=placeholder ltr_override aria-hidden=true style=cursor: text;som...@example.com javascript: /div* *1st:* @browser = Watir::Browser.new :chrome @browser.div(:id = idDiv_PWD_UsernameExample).set 'te...@test.comjavascript: ' *2nd:* @browser = Watir::Browser.new :chrome @browser.text_field(:id = idDiv_PWD_UsernameExample).set ( te...@test.com javascript:) *3rd:* @browser = Watir::Browser.new :chrome @browser.div(:class = *placeholder ltr_override*).set (te...@test.comjavascript: ) -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Getting constant net/protocol.rb:140:in `rescue in rbuf_fill': Timeout::Error exception for Watir-webdriver after couple hours of use
The same exception we get when IEDriver is not installed at all, so does anybody has situation when driver stopped to respond or hanged up? It should be reproducible whether you have more or less complex test suite On Tuesday, February 5, 2013 1:27:16 PM UTC+2, Alex Shtayer wrote: Env: 1. ruby 1.9.2p180 2. watir-webdriver (0.6.2) 3. InternetExplorerDriver server (32-bit) 2.29.0.0 I am running usual functional tests (that worked perfectly on usual watir), so it is almost 100% no dependencies on what I test, but more what I use for testing. Issue can be reproduced on FF too, not only on IE, but on IE more frequently That exception usually occurs in random places and usually after couple of hours running the script. If I close the browser frequently, so issue reproduced more rarely, but still reproduce I really need your help in that and maybe someone already faced it and know the solution. Big,big thanks in advance -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [wtr-general] input type=image
Input is a parent class for all inputs (like buttons, checkboxes, text_fields and etc), so if you can't use any sub-class of elements due you input is a special one (like *input type=image*), you can use just browser.input and watir will look for all inputs (buttons, checkboxes, unusual and etc) through whole DOM till it match provided attribute (:value=Add New Customer) On Monday, February 4, 2013 3:30:24 PM UTC+2, mc060200778 wrote: Perfect Joe, its amazingly working now. Now my question is: *how do you know to user @browser.input?* The following page does not tells anything to use image as an input http://wiki.openqa.org/display/WTR/HTML+Elements+Supported+by+Watir Thanks, On Mon, Feb 4, 2013 at 5:24 PM, Joe Fleck joefl...@gmail.comjavascript: wrote: Hi Sohail, I would treat it as a input. @browser.input(:value=Add New Customer).click Or any of the above. Joe On Mon, Feb 4, 2013 at 8:20 AM, Sohail Mirza mrz...@gmail.comjavascript: wrote: Oscar, if i am not wrong, the following URL tells to record it as a button. http://wiki.openqa.org/display/WTR/HTML+Elements+Supported+by+Watir Am i missing some important point here? Thanks On Mon, Feb 4, 2013 at 5:18 PM, Oscar Rieken bis...@gmail.comjavascript: wrote: well its an image and you are telling watir to look for a button http://rdoc.info/github/jarib/watir-webdriver/master/Watir/Element On Mon, Feb 4, 2013 at 8:15 AM, Sohail Mirza mrz...@gmail.comjavascript: wrote: Hi, i have following html code for input type image input type=image src=/MyTestDemo/Images/add.png value=Add New Customer data-bind=visible: IsAddAllowed,click: $root.AddNewCustomer class=ui-button How can i perform click event on above? i am trying the following but failing @browser.button(:src,/MyTestDemo/Images/add/).click @browser.button(:class = ui-button).click Please Thanks -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-...@googlegroups.com javascript: http://groups.google.com/group/watir-general watir-genera...@googlegroups.com javascript: --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-genera...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-...@googlegroups.com javascript: http://groups.google.com/group/watir-general watir-genera...@googlegroups.com javascript: --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-genera...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-...@googlegroups.com javascript: http://groups.google.com/group/watir-general watir-genera...@googlegroups.com javascript: --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-genera...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-...@googlegroups.com javascript: http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comhttp://groups.google.com/group/watir-generalwatir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-genera...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: .attach method
Actually you can. And without any problem through usual browser.window(:title=Browser title).use do code end or even to sub-window browser.window(:title=Browser title).use do code browser.window(:title=Browser title).use do code browser.window(:title=Browser title).use do code end end end If we speak about alerts and etc, so it is separate API: browser.alert.ok or browser.alert.close etc On Saturday, February 2, 2013 6:45:56 PM UTC+2, Jim Evans wrote: You don't. The WebDriver API doesn't support attaching to an existing browser yet, so watir-webdriver can't provide this functionality either. Additionally, a large use case for attaching to an existing browser window is in manipulating popup browser windows[1], and WebDriver does provide a Window API for that purpose. How watir-webdriver exploits that API, I couldn't say. --Jim [1] Disclaimer: I don't mean to suggest that there aren't other use cases for the .attach method, or that popup windows are the most important use case for that API, or even that it's the use case you're trying to solve. I'm just presenting the state of things as they are in WebDriver. Patches, as always, gratefully received. -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: How to run watir script onan already opened Chrome Browser
On watir through .attach method on watir-webdriver through browser.window(title).use On Friday, February 1, 2013 6:19:27 PM UTC+2, mc060200778 wrote: Hi, I wanted to know How to run watir script on an already opened Chrome Browser. I dont want to open new Chrome Instance. THe web application is already openened in Chrome and i just want to run the script. Thanks for comments Sohail -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Unable to acces text_field inside a frame coz of some #document tag in the HTML.
Okay, so provide HTML that you see in IE developer tool $ie.frame(:name,centent).present? = true but $ie.frame(:name,centent).text_field(:name,validateDealer).present? flase so, maybe you have one more sub frame? but it is really not good (it seems that frame is empty or what) irb(main):015:0 $ie.frame(:name,centent).text_field(:name,dealerCode).set(22r25) NoMethodError: unknown property or method: `body' In any case, we need more details On Monday, January 28, 2013 1:59:41 PM UTC+2, Deepak Kumar wrote: Hi, I am using IE developer and also tried developer tool of chrome also :( On Wednesday, January 23, 2013 8:08:33 PM UTC+5:30, Deepak Kumar wrote: Hi everyone, I am trying to access a text_field of page.HTML format is as follows html head-/head body iframe name=centent src=homepage.jsp * #document* html slick-uniqueid = 1 head-head body script --/script div id = headerHome div class=utilityNavHome id=utilityNavHome form name = 'validateDealer' i tried through IRB and tried to us flash() function but can only use the function on Iframe tag after that i am not able to acess any element. Is #document creating a problem. Thanks regards Deepak Kumar -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: How to handle download bar in IE 9
I automate such kind of things through AutoIT due pop-ups are not usual window and cannot be attached or something On Tuesday, July 17, 2012 8:32:27 AM UTC+3, Agung Surya wrote: Hi, I'm having a problem regarding access the new pop up in IE 9 using Watir This pop up regarding the save or open pop up that like a tab in the bottom of the page. Could some one please share the steps to access those button?(Open, save as, and cancel button) -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: watir, watir-webdriver, watir-classic: history and current state?
General impression: I created hundreds of cases for different functionality (in some cases really complex one) on watir classic and firewatir. After that I spent last six months to migrate everything on one platform (watir-webdriver) as it helps me keep code for all browsers much more maintainable and in the same way. (we don't need all this firefox plug-ins and etc). Also I love new way of handling pop-ups in watir-webdriver, so I finally get rid all AutoIT code and have pure watir code. As for me, watir-webdriver works MUCH more reliable than watir for small cases (I do not see any random things), but for long runs I see some crashes that I cannot debug in any way due the driver itself (.exe, so black box for me). So if you do not see any issues with driver, I will recommend to use watir-webdriver Is it true that watir-webdriver has improved significantly in the past 12 months? I know only for last 6 months, but yes. As for me - as Željko said 'Not sure if I would say significantly, but I would say it has improved' The true motivation for watir-classic: If you have all your code on watir and you don't want to migrate it. As watir-webdrvier completely differently interacts with elements in comparison with watir, you will need to work a lot for such migration. Even the syntax is similar, it doesn't mean that your code will work. For example, my watir code can click on elements that are not visible (like directly through DOM), but watir-webdriver will definitely crash and etc. -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Unable to find the chromedriver executable
Once more http://code.google.com/p/selenium/wiki/ChromeDriver Download and copy mentioned file for example in: C:\Ruby193\bin -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Re: Problems with Select Lists in my application
Refer to: http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups I am using solution #9 for more than 3 years and it works just fine -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Getting constant net/protocol.rb:140:in `rescue in rbuf_fill': Timeout::Error exception for Watir-webdriver after couple hours of use
Env: 1. ruby 1.9.2p180 2. watir-webdriver (0.6.2) 3. InternetExplorerDriver server (32-bit) 2.29.0.0 I am running usual functional tests (that worked perfectly on usual watir), so it is almost 100% no dependencies on what I test, but more what I use for testing. Issue can be reproduced on FF too, not only on IE, but on IE more frequently That exception usually occurs in random places and usually after couple of hours running the script. If I close the browser frequently, so issue reproduced more rarely, but still reproduce I really need your help in that and maybe someone already faced it and know the solution. Big,big thanks in advance -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups Watir General group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[wtr-general] Watir wait until key pressed
Hello, Is it possible to make Watir wait until some special key is pressed? I'm doing browser automation, and there are some moments that requires manual verification. I want to Watir to do a pause and when I press a special key - to make Watir go ahead doing the next steps. How to make it happen? Thank you. I tried: b = Watir::Browser.new :firefox b.goto 'http://google.com' t = b.text_field :id = 'gbqfq' t.set 'free love' if t.exists? browser.wait_until { b.send_keys :shift } b.close But it doesn't work :( It doesn't wait for a shift special key to be pressed. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Using Watir Webdriver I am able to detect that a WYSIWYG ckeditor exists, but any attempt to send_keys to it outputs a blank string?
Other frames on the same webpage do not present this problem for me. Problem seems to be only when attempting to enter any text to the WYSIWYG ckeditor. b.frame(:title, Rich text editor, currentItem.contentText, press ALT 0 for help.).exists? = true b.frame(:title, Rich text editor, currentItem.contentText, press ALT 0 for help.).send_keys 'random text' = # should output = random text Is anyone else experiencing this issue or have a solution? Thanks in advance. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Using Watir Webdriver I am able to detect that a WYSIWYG ckeditor exists, but any attempt to send_keys to it outputs a blank string?
Yeah I actually found that link prior to posting. I was able to execute the example with no errors. However, the issue still remains on the webpage that I am testing. Both the locating iframe and executing javascript methods fail for me using the firefox(13.0) browser. If you would like to try it- b = Watir::Browser.new :ff b.goto weddingwire.com b.a(:href, '/wedding/UserLogin').click b.text_field(:name, 'userName').set 'redwedding...@gmail.com' b.text_field(:name, 'password').set 'gatsby321' b.send_keys :enter b.goto http://www.weddingwire.com/wedding/UserMyWebsitePageEdit?pid=98ccb20ae6ee6feb; #from this point I cannot enter text into the WYSIWYG using javascript or send_keys method Any more thoughts? Thank you again! On Monday, June 18, 2012 11:12:59 AM UTC-4, Željko Filipin wrote: On Mon, Jun 18, 2012 at 3:55 PM, Alex ap...@weddingwire.com wrote: Problem seems to be only when attempting to enter any text to the WYSIWYG ckeditor. Did you read this? http://watirwebdriver.com/wysiwyg-editors/ Željko -- filipin.eu Looking for a software tester that eats, sleeps and breathes Watir? Look no more. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Need help on jssh installation for firefox
Chethan, Could you try the version of the JSSH plug-in available here, please? You'll need to download this as a file. http://github.com/ajcollins/JSSH-XPIs/raw/7dd112a4defb3a61d1f94d9f95a9d4ecaaedb5f7/plugins/jssh-20090517-WINNT.xpi Also, are you running Firefox with multiple profiles? If so, JSSH needs to be installed in the default profile. Thanks, Alex On 3 Jun 2009, at 14:02, Chethan wrote: Pls Help me out on this Jssh issue. Thanks, Chethan On Jun 3, 9:54 am, Chethan chethan2...@gmail.com wrote: Yes I am admin user for the machine i am using. Here are the steps i followed. 1. browse tohttp://wtr.rubyforge.org/ 1. Installed Ruby fromhttp://rubyforge.org. 2. from command prompt entered gem update --system 3. then entered gem install watir 4. installed firefox add-on Jssh from the wtr.rubyforge.org site 5. run manually C:\Program Files\Mozilla Firefoxfirefox.exe -jssh 6 checked for Jssh port by telnet localhost 9997 Following error was seen Connecting To localhost...Could not open connection to the host, on port 9997: C onnect failed I am using windows XP(sp2) firefox version is 3.0.10 jssh version is 0.9 Thanks, Chethan On Jun 2, 6:10 pm, Angrez Singh ang...@gmail.com wrote: Are you an admin user on your machine? I use Firewatir a lot on my machine (Windows XP SP2) with Firefox 3.0.10) and never faced any problem with jssh. - Angrez On Tue, Jun 2, 2009 at 6:04 PM, Chethan chethan2...@gmail.com wrote: Yes I installed Jssh plug in but if i do telnet localhost 9997 it say there is no service running on 9997 port. That is what i described in my earlier mails. Thanks, Chethan On Jun 2, 5:30 pm, jason jason.franklin.sto...@gmail.com wrote: did you install the jssh firefox plugin??? On 2 Jun., 14:05, Chethan chethan2...@gmail.com wrote: I installed the Firewatir with new method rather then gem install firewatir command, I done that through gem install watir online how the new Watir overview describes. Thanks, Chethan On Jun 2, 3:04 pm, Chethan chethan2...@gmail.com wrote: Hi, I am using window-Xp(sp2) my Firefox version is 3.0.10. Rgds, Chethan --~--~-~--~~~---~--~~ 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: override js confirm FireWatir
Aidy, I'm guessing and not strong on Javascript, but might it be the lack of a semi-colon after 'return true'? Best wishes, Alex Collins On 2 Jun 2009, at 17:03, aidy lewis wrote: Hi, I am trying to override a js confirm in FireWatir: $jssh_socket.send(window.confirm=function(){return true};\n, 0) read_socket Without success, has anyone managed to do this? Aidy --~--~-~--~~~---~--~~ 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: Noob problem
You may need to add require 'rubygems' to the top of your script, depending upon how ruby has been installed for you. Alex Collins On 28 May 2009, at 00:31, James wrote: I finally got watir and ruby installed I believe. I am now trying to do the google seach example, but when I run the .rb file I get: google_search.rb:14: in `require' : no such file to load -- watir (LoadError) Do I need to do anything special to load watir before I run the file? I thought the file call up watir? I am running all of this from the command line, is that correct? The google_search.rb is taken from the examples. I am running windows xp Thanks for all the help in advance --~--~-~--~~~---~--~~ 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 execute the single comment?
Wesley, Replace exec() with eval() - this will run (evaluate) the Ruby code you provide as an argument to it, in the current context. Best wishes, Alex Collins On 25 May 2009, at 11:56, Wesley Chen wrote: Hi, guys, I have the requirement like: require 'watir' $ie=Watir::IE.new str1=$ie.goto('www.google.com') exec(str1) $ie.close It can't succeed. Anybody knows how to go through it? so that I can open the IE, then goto www.google.com, then close the IE window? Any suggestion would be quite appreciated. Thanks. Wesley Chen. --~--~-~--~~~---~--~~ 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: Watir - some VERY slow functions
Paul, I just put a quick performance page with 200 radio elements on. Using Watir 1.6.2 in a Windows XP Virtual Machine it took me just under 5 seconds to iterate over all of them and print the values. I agree that it did seem to run more slowly per element by the end. Could you possibly create a test page which you can share that recreates the issue you are seeing? Thanks, Alex On 21 May 2009, at 05:15, Paul Denize wrote: I finally found a performance issue and it was in the watir library. If a page (and dont get me started about it) has 200 plus radio buttons and your watir script decides to print all the attributes like so radios = ie.radios() for radio in radios puts radio.name puts radio.value end Then please be ready to wait for 16 Minutes . It seems it goes slower and slower as the process runs ... asking for the name or value of the 200th will take a LOT longer than asking for the name/value of the 1st. I was somewhat confused when I called ie.radios the documentation suggests it returns an array of radios. But that would imply that asking for a property on the first item in the arrray would be exactly the same speed as asking for a property on the last (which clearly it is not). Now I started to do the same parsing of the document as done by show_all_objects but I had difficulty replicating some attributes (like a links text) and some of the element types. Could someone please look at the performance issues with these functions or suggest a function that could output all the page elements. I was using the code below and calling with say puts objectlist(ie.links) puts objectlist(ie.forms) puts objectlist(ie.text_fields) puts objectlist(ie.radios) puts objectlist(ie.checkboxes) puts objectlist(ie.select_lists) puts objectlist(ie.file_fields) puts objectlist(ie.buttons) Now normally I was only outputting one when the user called sa radio (:id,'xxx') and it failed I'd output objectlist(ie.radios) so they could see all the radios that exist. But the performance has meant I have had to comment all that out for now. def objectlist(objects) objs_info = [] index=1 objects.each {|f| obj_info = [] obj_info.push(:index=#{index}) index+=1 begin if (f.object_id!=) obj_info.push(:id=#{f.object_id}) end rescue end begin if (f.name!=) obj_info.push(:name=#{f.name}) end rescue end begin if (f.text!=) obj_info.push(:text=#{f.text}) end rescue end begin if (f.value!=) obj_info.push(:value=#{f.value}) end rescue end puts obj_info.join(, ) objs_info.push(obj_info.join(, )) } return objs_info end --~--~-~--~~~---~--~~ 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: no such file to load -- firewatir
Are you sure that the gem is installed correctly? Can you check that firewatir is listed when you run gem list. If firewatir is not shown, you may have installed it as a particular user and not system-wide. Try sudo gem install firewatir to fix this. Alex On 18 May 2009, at 20:25, Josh wrote: I am on Mac OSx and am having trouble getting firewatir to run. On Ubuntu it works fine. I added require 'rubygems' to the top of my script but that didn't solve the problem (I shouldn't have to do that anyways because it has been working for 5 months). Any ideas? Thanks, Josh --~--~-~--~~~---~--~~ 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: Saving xml contents of a page shown on screen
Natasha, This is where you need to use a little natural Ruby. For example: filename = 'output.xml' File.open(filename, 'w').write browser.html Another useful style is: File.open(filename, 'w') do |output| output.puts Whatever I want to put in the file. end Hope this helps. Alex On 18 May 2009, at 18:46, Natasha wrote: Hello All, Apologies for an unambiguous subject line. Following is a scenario in my test: 1. On a particular page, we have a hyperlink. 2. When you click on that hyperlink, it opens up an XML document in the same window 3. I wanted to copy the contents and save that XML file on disk. I can do that manually by clicking on File menu option of the browser and selecting Save As option. Is there a way I can manully save the output of the entire page as an XML file? Thanks, Natasha --~--~-~--~~~---~--~~ 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] Error when building commonwatir - FIX (url) is not a URI
Hi all, Thanks to Angrez and http://wiki.openqa.org/display/WTR/Building+Watir I was able to find the latest watir files, and tried to build it. Everything was fine, except when building commonwatir, when I got the error: FIX (url) is not a URI --~--~-~--~~~---~--~~ 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: Error when building commonwatir - FIX (url) is not a URI
Hi Bill, Thanks for replying. I followed your instructions, but unfortunately the error is still there ... Is there anything else you did last week? Thanks, Alex On Apr 30, 9:34 pm, Bill Agee billa...@gmail.com wrote: I had that happen too, last week, when I was trying to get the latest FireWatir attach changes. :) I think what I did to work around this was to edit commonwatir/manifest.txt and remove the line for README.txt. I can't remember making any other changes so hopefully this was it. Then, rake gems would successfully build all three .gem files. I think I saw another complaint about the README file when installing the gems, but it was harmless. Thanks Bill On Thu, Apr 30, 2009 at 9:24 AM, alex alexrot...@gmail.com wrote: Hi all, Thanks to Angrez andhttp://wiki.openqa.org/display/WTR/Building+Watir I was able to find the latest watir files, and tried to build it. Everything was fine, except when building commonwatir, when I got the error: FIX (url) is not a URI --~--~-~--~~~---~--~~ 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: Error when building commonwatir - FIX (url) is not a URI
Thanks a lot Bill. You were right, replacing *FIX (url) with a valid URL solved the problem. Alex On Apr 30, 11:14 pm, Bill Agee billa...@gmail.com wrote: Oh, whoops, yeah, my fix was actually different. Editing the manifest file doesn't help. The workaround that actually works is: 1) Edit watir/commonwatir/README.txt 2) Change line 3 to: *http://www.watir.com I think the value can be anything as long as it's a valid URL. :) This time 'rake gems' shouldn't complain, and you should get the commonwatir gem file. On Thu, Apr 30, 2009 at 12:53 PM, alex alexrot...@gmail.com wrote: Hi Bill, Thanks for replying. I followed your instructions, but unfortunately the error is still there ... Is there anything else you did last week? Thanks, Alex On Apr 30, 9:34 pm, Bill Agee billa...@gmail.com wrote: I had that happen too, last week, when I was trying to get the latest FireWatir attach changes. :) I think what I did to work around this was to edit commonwatir/manifest.txt and remove the line for README.txt. I can't remember making any other changes so hopefully this was it. Then, rake gems would successfully build all three .gem files. I think I saw another complaint about the README file when installing the gems, but it was harmless. Thanks Bill On Thu, Apr 30, 2009 at 9:24 AM, alex alexrot...@gmail.com wrote: Hi all, Thanks to Angrez andhttp://wiki.openqa.org/display/WTR/Building+Watir I was able to find the latest watir files, and tried to build it. Everything was fine, except when building commonwatir, when I got the error: FIX (url) is not a URI --~--~-~--~~~---~--~~ 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: Rescue
John, Asking the obvious, if you don't want the code to run, why not remove it or comment it out? I'm not entirely sure what you are after, so a general response which I hope may still be useful. Firstly, the protected code block has the structure: begin expr.. [rescue [error_type,..] expr..].. [else expr..] [ensure expr..] end In this, the end statement ends the block. It does not stop the program running. In this case, the end statement after your puts 'please login..' line closes the begin block. To stop the program / script running, call the 'exit' method. Alternatively, if you want to build in behaviour around the lack of a browser, you could always use an if-block: if browser # do stuff when you have a browser else # do stuff when you have no browser (browser = nil) end Alex On 26 Apr 2009, at 07:01, «°¤§ømåtïçCðrp§ë¤°» wrote: I'm running a script, which has a rescue clause, but I want it to (essentially) break, when the rescue clause is invoked. Instead, it runs to the next line: C:\Documents and Settings\Marissa\Desktopruby T3.rb What is the user's First Name? Test What is the user's Last Name? Test ALERT: You must have a running instance of SVC open! Please log into SVC and restart Sevin. Exiting: Code1. T3.rb:18: undefined method `frame' for nil:NilClass (NoMethodError) To state the obvious: The frame it's looking for is not going to be there, so I don't even want it to go there. [Code] require 'watir' puts What is the user's First Name? Fname = gets.chomp #Removes return (recognized as new line command) character '\n' puts What is the user's Last Name? Lname = gets.chomp #Removes return (recognized as new line command) character '\n' begin @browser = Watir::IE.attach(:url, 'https:// www.servicecenterweb.unisys.com/sc2/index.do') rescue Watir::Exception::NoMatchingWindowFoundException puts ALERT: You must have a running instance of SVC open! @browser1 = Watir::IE.new @browser1.goto('https://www.servicecenterweb.unisys.com/sc2/ index.do') puts Please log into SVC and restart Sevin. Exiting: Code1. end @browser.frame(:id, 'detail').button(:id, 'X8').click #Insert company name and user @browser.frame(:id, 'detail').text_field(:id, 'X7').set(BAXTER) @browser.frame(:id, 'detail').text_field(:id, 'X78').set(Fname) @browser.frame(:id, 'detail').text_field(:id, 'X80').set(Lname) [/Code] If I put a 'break' in the rescue clause, it doesn't seem to like it, and 'end' really doesn't end, as you can see. So, is there a way I can ditch the script, if the rescue is invoked, or will I just have to deal with it going on to the next line? Thanks! --~--~-~--~~~---~--~~ 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: jssh error - Watir::Exception::UnableToStartJSShException
Emily, Are you running a 64 bit version of ubuntu? The JSSH plugins available are 32-bit only, I believe: http://code.google.com/p/firewatir/issues/detail?id=38 You can compile your own extension: http://blog.baroquebobcat.com/2009/01/06/jssh-firefox-ubuntu-64bit/ If you're not sure, could you post the output of 'uname -a', please? Thank you, Alex On 23 Apr 2009, at 03:17, emz452 wrote: Hi there, I have recently started working from home and have just finished setting up my rails development environment. I'm running into a problem with Watir when running some of my tests. This was all running smoothly on my PC at work, so it must be some setting or configuration problem on my home pc. I've seen this posted a couple of times in the forum, however I have tried all the recommended solutions and still can't seem to resolve it. The full error is: Unable to connect to machine : 127.0.0.1 on port 9997. Make sure that JSSh is properly installed and Firefox is running with '-jssh' option (Watir::Exception::UnableToStartJSShException) /home/emily/Documents/metis/vendor/plugins/watir-on-rails/lib/ watir_on_rails.rb:35:in `open_browser' ./features/support/watir.rb:331:in `initialize' ./features/support/watir.rb:11:in `new' ./features/support/watir.rb:11:in `initialize' A firefox browser does open up, but nothing further happens. My setup: I'm using Ubuntu 8.04 (Hardy) (dual boot with a windows pc) I have the gem firewatir 1.6.2 installed. I'm using Firefox 3 and have the JSSh 0.9 extension installed and enabled. (I made sure to select the Linux, Firefox 3 version from here: http://wiki.openqa.org/display/WTR/FireWatir+Installation#FireWatirInstallation-2)InstalltheJSSHFirefoxExtension My firefox settings are - - New pages should be opened in a new window - Popups are not blocked I have tried uninstalling/re-installing the JSSh extension, disabling and re-enabling it and restarted firefox each time. If I launch firefox with -jssh and try to telnet: em...@emily-desktop:~$ firefox -jssh em...@emily-desktop:~$ telnet localhost 9997 Trying 127.0.0.1... telnet: Unable to connect to remote host: Connection refused em...@emily-desktop:~$ When I run the unit tests it fails: em...@emily-desktop:/usr/lib/ruby/gems/1.8/gems/firewatir-1.6.2/ unittests$ sudo ruby mozilla_all_tests.rb [sudo] password for emily: /usr/lib/ruby/gems/1.8/gems/firewatir-1.6.2/unittests/setup.rb:13:in `require': no such file to load -- watir (LoadError) from /usr/lib/ruby/gems/1.8/gems/firewatir-1.6.2/unittests/setup.rb: 13 from mozilla_all_tests.rb:3:in `require' from mozilla_all_tests.rb:3 However I read that this happens with 1.6.2, so I'm not sure if this means anything. (I think I need to copy development files across?) If anyone has any suggestions of possible settings/config changes I could check, it would be greatly appreciated! I'm new to watir - so there may be something very obvious I've missed! Many thanks, Emily --~--~-~--~~~---~--~~ 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: Test Results Report Methods
Perhaps this is something that your editor is interpreting differently? I find that I cannot paste this code into IRB. However, if the code is placed in a file and then run, the correct output is written if I 'cat' the file. If I open the file directly in TextEdit and do not manually specify UTF-8 encoding, the output is wrongly displayed. Try manually specifying the encoding. Alex On 19 Apr 2009, at 04:03, Wesley Chen wrote: It doesn't work. I get the result as: row of CSV data 浣犲ソ鍚? 鎴戝緢濂? When I put the info out from the csv by fastercsv, I can get the expected chinese characters. Thanks. Wesley Chen. 2009/4/18 Alex Collins a.j.collins...@gmail.com Wesley, You need to tell Ruby to support the characters using the $KCODE global variable . The following works for me. $KCODE = 'utf-8' require 'watir' require 'fastercsv' FasterCSV.open(file.csv, w) do |csv| csv [row, of, CSV, data] csv [你好吗?, 我很好] end Best wishes, Alex On 18 Apr 2009, at 04:07, Wesley Chen wrote: Do you know how to make it support the chinese character? When I have installed fastercsv and run the code below: require 'watir' require 'fastercsv' FasterCSV.open(c:\\file.csv, w) do |csv| csv [row, of, CSV, data] csv [你好吗?, 我很好] # ... end The chinese character can never display right in my .CSV file. but when I run the code puts 你好吗 in my editor, I can get the expected output. Any suggestion would be quite appreciated. Thanks. Wesley Chen. On Sat, Apr 18, 2009 at 8:45 AM, George george.sand...@gmail.com wrote: gem install fastercsv --~--~-~--~~~---~--~~ 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: FireWatir bug/anomaly
On 13 Apr 2009, at 19:59, Bret Pettichord wrote: I think there are 2 bugs here. 1. Firewatir does not issue an error when users use undefined methods. Agree with this. I had a quick look but my trivial catch-all patch breaks various tests. I'll have a look tomorrow at fitting this into element.rb's method_missing call. 2. SelectList#set needs to be defined as an alias for SelectList#select (as it is in IE-Watir). I checked this morning - this is already fixed in the firewatir on GitHub in Bret's Watir repository. Alex --~--~-~--~~~---~--~~ 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: FireWatir bug/anomaly
I've just had a quick look, also on FF3/Mac. The issue is not that the select_list element is invisible - you can address it correctly as show by calling: @browser.select_lists or @browser.select_list(:id, 'cAbb') Calling the methods method on the element reveals that the set method you are calling is not present. I was surprised to see that this method exists - I've always used the select method, which works fine. The RDoc reveals that set should be an alias for select. I would suggest using the select method for the time being: @browser.select_list(:id,cAbb).select(software jobs) However, if you wish to use the set method, add the following code to your firewatir/htmlelements.rb file in the SelectList class beneath the select method's definition: alias :set :select Best wishes, Alex On 12 Apr 2009, at 00:07, Jarmo Pertman wrote: Try to print out html for that select_list to make sure that you are really dealing with the correct select_list and there aren't any hidden ones or whatsoever. Or try just plain old .flash method to see if correct list is flashing :) Jarmo On Apr 5, 7:07 am, Chris christopher.mcma...@gmail.com wrote: This snippet show the issue on FF3/Mac. select_list on craigslist seems to be invisible. FWIW, Selenium IDE can address the select_list with no problem require 'rubygems' require 'firewatir' @browser = Watir::Browser.new @browser.goto(http://newyork.craigslist.org/jjj/;) #CAN'T ADDRESS BY INDEX @browser.select_list(:index,1).set(software jobs) #CAN'T ADDRESS BY ID @browser.select_list(:id,cAbb).set(software jobs) #CAN'T SET THE select_list VIA 'value=foo' @browser.select_list(:id,cAbb).set(sof) FireWatir generates no error for any of these calls. --~--~-~--~~~---~--~~ 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: the ie.goto() problem
I believe that the issue is that you are passing in an Array into goto, when it expects a string: http://wtr.rubyforge.org/rdoc/ - look at the Watir::IE class' goto method. You create an array on the following line: thisLocation = folderLocation, i Explicitly stated, you can read this as: thisLocation = [folderLocation, i] thisLocation is therefore an Array. To convert this to a string, simply call the to_s method on the array. For example: [1, 2].to_s = 12 [c:\\file\\, foo.bar].to_s = c:\\file\\foo.bar You therefore need to amend your script so that you call: ie.goto(thisLocation.to_s) However, if you are looking to join file names to directory paths, I suggest you look at Ruby's File and Dir classes. They have many useful helpers, for example, File.join does exactly what we are doing above, but in a platform-safe manner. Alex On 12 Apr 2009, at 02:57, Chai Taolun wrote: Hi~ Sorry, this is not like that, I want to visit some webpage using the name I store in the text file. I need to find a way to do this. Thank you allen On Sat, Apr 11, 2009 at 1:22 PM, kiran gki...@gmail.com wrote: Hi, I think problem with folder path. suppose if we want open a file located in D:\watir The statement for watir ie.goto(D:\\watir) it would help you. On Apr 11, 12:15 pm, Chai Taolun ctco...@gmail.com wrote: Hi~ Ruby is new to me and I got this problem in this code. Could you give me some help? Thank you infile.each{ |i| thisLocation = folderLocation, i print thisLocation k =testCaseNumber while k !=0 ie = Watir::IE.new ie.goto(thisLocation) and here is the error c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 358:in `method_missing': navigate (WIN32OLERuntimeError) OLE error code:0 in Unknown No Description HRESULT error code:0x80020005 Type mismatch.from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb: 358:in `goto' from awat.rb:61 from awat.rb:54:in `each' from awat.rb:54http://localhost:81/Homework/HswitchS.phpExit code: 1 Thank you so much and looking forward your help ^_^ Allen -- There are some things in this world will never change and some things do change. -- There are some things in this world will never change and some things do change. --~--~-~--~~~---~--~~ 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: Package creation
Vikas, Ruby probably isn't what you're looking for in that case. Although I have previously seen some options for creating executables from Ruby code. I don't have any links or information on them. Alex On 13 Mar 2009, at 04:05, Vikas Tulashyam vtulash...@gmail.com wrote: Hi Tiffany, Thanks for the time, I went through the examples at the link, but I coudn't find anything suitable. I want to create a executable package and don't want to provide the source code to the user. Thanks On Mar 12, 11:22 pm, Tiffany Fodor tcfo...@comcast.net wrote: Hi Vikas! I recommend that you take a look at the wiki - there are lots of tutorials and examples: http://wiki.openqa.org/display/WTR/Examples -Tiffany On Mar 11, 11:47 pm, Vikas Tulashyam vtulash...@gmail.com wrote: Hi, I am trying to create a framework in Watir, so I need to create a package/Installable for this purpose. Please give me some pointer in this area. Thanks Vikas --~--~-~--~~~---~--~~ 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: Drop down Contents
You can compare arrays very easily in ruby use the == method. I think order matters so you might wish to sort (.sort) your array. There is a method on a select box to get all of the options ( .options() ). This returns an array. You can then store your expected results in an array and compare the two. Alex On 12 Feb 2009, at 17:29, Jason Shelton jas.shel...@hotmail.com wrote: All, I am writing to ask if anyone has a quick way of verifying the contents of a drop down. I have a list of names, and I want to verify that each name is being displayed in the drop down. Thanks in advance for all of your help. - Shelton Windows Live™: Keep your life in sync. See how it works. --~--~-~--~~~---~--~~ 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: Drop down Contents
Interesting. I found the options() method from the rdoc. However, I do not get the behaviour I expect. Use getAllContents() instead; this does return an array, as expected. Alex On 12 Feb 2009, at 19:15, Jason Shelton wrote: I tried the following code, and I am getting the undefined method error. Am I missing a library? Thanks in advance. items = $ie.select_list(:name, 'xxx') itemsArray = items.options() - Shelton From: a.j.collins...@gmail.com To: watir-general@googlegroups.com Subject: [wtr-general] Re: Drop down Contents Date: Thu, 12 Feb 2009 18:33:22 + You can compare arrays very easily in ruby use the == method. I think order matters so you might wish to sort (.sort) your array. There is a method on a select box to get all of the options ( .options() ). This returns an array. You can then store your expected results in an array and compare the two. Alex On 12 Feb 2009, at 17:29, Jason Shelton jas.shel...@hotmail.com wrote: All, I am writing to ask if anyone has a quick way of verifying the contents of a drop down. I have a list of names, and I want to verify that each name is being displayed in the drop down. Thanks in advance for all of your help. - Shelton Windows Live™: Keep your life in sync. See how it works. --~--~-~--~~~---~--~~ 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: using data from a csv file
Do a quick search on Google for CSV::Loader - this will allow you to load a csv easily. You can then substitute values into your query as desired. On 12 Feb 2009, at 00:53, jtk jeff.kr...@gmail.com wrote: Hello, Can anyone help me pull data out of a csv file and insert it into a SQL query? I am trying to create a csv file, read the file, pull data from a specific cell then insert that data into a SQL query and execute the query. I know how to create the file and read it and run SQL inside my script I just can't seem to grab the data out of the file and insert it into my query. Thanks in advance if anyone has any help. Example code would be great. --~--~-~--~~~---~--~~ 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 create a Hash Table using CSV or FaterCSV
Margam, This is all to do with the basics of Ruby. It would be well worth working through some of the ruby tutorials. In this case; hash[] On 14 Jan 2009, at 01:19, Margam nk.mar...@gmail.com wrote: Follow Up Hello All, After googling for some time, I found an easy way to get the data into an Hash. Thanks to One Mr.Ryan. - hash = {} CSV.foreach('test.csv') do |row| hash[row[0]] = row[1] end - But I have some questions regarding accessing the values using the Key field. Based on the CSV file example I had mentioned in my previous entry: 1. When I do: $browser.goto(hash[URL]) I get a error: -- NameError: uninitialized constant TestSuite::URL c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/ active_support/dependencies.rb:493:in `const_missing' csvdriven.rb:102:in `test00_gmail' -- But works fine when I do: $browser.goto(hash['URL']). Why are the single quotes required? 2. When I try to output the values using the KEys like this: puts hash['URL'] the output looks like this: http://gamil.com; Why does the output has the double quotes? Hope my questions are clear. Thank you. Margam On Jan 13, 3:58 pm, Margam nk.mar...@gmail.com wrote: Hello All, I have been recently learning to use both the CSV module and the FasterCSV gem to create an array from a CSV file. Say my CSV file(file.csv) looks like this (first row is the header, not used in script): Parameter,Value URL,http://gamil.com Login,mylogin Password,mypassword My script using the CSV module is: require 'csv' array=[] CSV::Reader.parse(File.open(file.csv)){|row| array row[1]} The above code saves the Values in column two into an array. I use the array elements in my script. IN the same way, is there a method to create a Hash table. I would like to access the values in column 2 using the Key on column 1. I want to do this, as the CSV file may keep changing. Also how to access the Hash keys(or use them in the script)? Kindly provide guidance. Thank you Margam --~--~-~--~~~---~--~~ 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 create a Hash Table using CSV or FaterCSV
My apologies - knocked send whilst getting onto the train. In this case, you are using the CSV modules to load strings as key/ value pairs into a hash. The important bit being that both the key, and the value when retrieved from the hash will be strings. Let us examines few snippets of your code: hash[URL] This tries to access the value in the hash stored for the key contained in the URL constant. In Ruby, If is starts with a capital, it is a constant. As you haven't initialised this constant, Ruby does not know which element to look at. Hence the error. So the quotation marks are required because your key is a string. And alternative would be to use a symbol eg: hash[row[0].to_sym] = row[1] You could then access it with: hash[:URL] (warning: I'm not certain about capitals as symbols - may need to be lower case) Likewise, when you access the value, you are accessing a String object (an instance of a Ruby class). That it is a string is indicated by the double quotes. You may be interested in looking at YAML. It is a markup form available in Ruby which is typically used for what you are doing. Hope this helps, Alex On 14 Jan 2009, at 01:19, Margam nk.mar...@gmail.com wrote: Follow Up Hello All, After googling for some time, I found an easy way to get the data into an Hash. Thanks to One Mr.Ryan. - hash = {} CSV.foreach('test.csv') do |row| hash[row[0]] = row[1] end - But I have some questions regarding accessing the values using the Key field. Based on the CSV file example I had mentioned in my previous entry: 1. When I do: $browser.goto(hash[URL]) I get a error: -- NameError: uninitialized constant TestSuite::URL c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/ active_support/dependencies.rb:493:in `const_missing' csvdriven.rb:102:in `test00_gmail' -- But works fine when I do: $browser.goto(hash['URL']). Why are the single quotes required? 2. When I try to output the values using the KEys like this: puts hash['URL'] the output looks like this: http://gamil.com; Why does the output has the double quotes? Hope my questions are clear. Thank you. Margam On Jan 13, 3:58 pm, Margam nk.mar...@gmail.com wrote: Hello All, I have been recently learning to use both the CSV module and the FasterCSV gem to create an array from a CSV file. Say my CSV file(file.csv) looks like this (first row is the header, not used in script): Parameter,Value URL,http://gamil.com Login,mylogin Password,mypassword My script using the CSV module is: require 'csv' array=[] CSV::Reader.parse(File.open(file.csv)){|row| array row[1]} The above code saves the Values in column two into an array. I use the array elements in my script. IN the same way, is there a method to create a Hash table. I would like to access the values in column 2 using the Key on column 1. I want to do this, as the CSV file may keep changing. Also how to access the Hash keys(or use them in the script)? Kindly provide guidance. Thank you Margam --~--~-~--~~~---~--~~ 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: Please help - getting error 'Unable to locate element'
That means that your $ie variable is nil. Which in turn means that you haven't successfully started a browser. You should have a line like: $ie = Watir::Browser.new This line starts the browser and connects it to $ie variable for you to use. The open() method may be used instead, I believe. If the webmetrics recorder has not been updated to Watir 1.6 then the line might read: $ie = Watir::IE.new If this is the case you will either need to downgrade Watir or modify the script. If you are still having difficulties, it would be helpful to see your script code. Alex On 13 Jan 2009, at 02:01, H2006 hemali2...@gmail.com wrote: Actually adding 'require 'rubygems' , solved the above problem but then I am getting error, undefined method `frame' for nil:NilClass (NoMethodError) I also tried to run from irb and got the same error. $ie.frame(:index, 4).link(:text, 'My').flash $ie.frame(:index, 4).link(:text, 'My').click Can someone help, pls?? On Jan 12, 5:42 pm, H2006 hemali2...@gmail.com wrote: I tried to use web metrics but now I am getting different error message, C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `gem_original_require': no such file to load Can someone help?? On Jan 12, 3:34 pm, Darryl L. Brown d-l-br...@roadrunner.com wrote: Hello, Glad that I could help. Gem Dandy H2006 wrote: Hi Dandy, first, Thank you so much for the information. I am currently using IE developer toolbar. when I click on find element and click on the text field, it is highlighted but script does not recognize it. my application only works on IE so fire bug will not help. Let me try out the Webmetrics, if that helps.. I really appreciate the information that you have provided. -H2006 On Sat, Jan 10, 2009 at 6:04 AM, gem dandy d-l- br...@roadrunner.com mailto:d-l-br...@roadrunner.com wrote: Hello H2006, If you can't identify the element with the IE Developer toolbar or Firebug (my favorite), Give Webmetrics a try. It's basically a Watir recorder /helper and will get you started. The tool download - http://www.webmetrics.com/products/script_recorder.html You will also need to apply this patch after installing the tool - http://www.webmetrics.com/scriptrecorder/vs_piaredist.exe I feel your pain. I was a Watir virgin 6 weeks ago. Take a look at this post for some links to some very good material for newbies- http://groups.google.com/group/watir-general/browse_thread/thread/811 ... Regards, Gem (newbie) Dandy --Walk before you run On Jan 10, 2:42 am, Anna Gabutero a...@lavabit.com mailto:a...@lavabit.com wrote: Hi, On Fri, Jan 09, 2009 at 06:23:32PM -0800, H2006 wrote: Hello, I am newbie to Waitr Ruby. I am testing windows application that works only on IE. I am exploring some front end automation tool and found Watir might be the great choice. I have followed the tutorial and simple google search test and it works fine. I am so excited to use this tool for my web application But the problem I am facing is when i tried to create simple search for my test application, i am getting ' Unable to locate' error.. Same error appears with all possible methods that i tried ( ex: .click, .flash, .set etc..) Only .exists? and .include command works in my script. Can anyone help me? Am I missing anything for installation? Do I need to add anything else other than require 'watir' in the beginning of my script? Watir version: 1.6.2 Ruby version 1.8.6 Error: c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ element.rb:52:in `assert_exists': Unable to locate element, using :id, /txtSegSearch/ (Watir::Exception::UnknownObjectException) Watir simply can't find the element based on the criteria you gave it. The .exists? method works because it only checks for the existence of the element, but it's probably returning false. Maybe this text field isn't in the frMain frame? If you're having trouble with the structure of the document you're testing, you can use the IE developer toolbar to help you understand it. HTH, Anna --- --- -- No virus found in this incoming message. Checked by AVG -http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.6/1889 - Release Date: 1/12/2009 8:18 PM --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---