[wtr-general] Re: how to install prev versions of watir

2016-11-16 Thread Alex Rodionov
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

2013-12-20 Thread Alex Rodionov
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

2013-09-17 Thread Alex Rodionov
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: how to check TextArea is enabled or disabled

2013-06-27 Thread Alex Rodionov
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

2013-05-19 Thread Alex Rodionov
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

2013-05-18 Thread Alex Rodionov
@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?

2013-05-18 Thread Alex Rodionov
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?

2013-05-18 Thread Alex Rodionov
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

2013-05-18 Thread Alex Rodionov
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?

2013-05-16 Thread Alex Rodionov
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

2013-05-16 Thread Alex Rodionov
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 ?

2013-05-16 Thread Alex Rodionov
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

2013-05-14 Thread Alex Rodionov
 

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.