[wtr-general] Re: Carriage Returns

2011-08-17 Thread joedio
Hillary,

See if specifying the ASCII code for the Carriage Return will work.
The Carriage Return is ASCII character 10.

Here an example in irb:

irb(main):006:0 putsa + 10.chr + b + 10.chr + c
a
b
c
= nil

So you code would be:
b.text_field(:id, x).set(a + 10.chr + b + 10.chr + c)


Joe

On Aug 15, 6:11 pm, hillary weimar1...@gmail.com wrote:
 I have a text area that allows the user to copy and past from a file values
 that are separated by a carriage return like this:
 a
 b
 c

 In watir, this code worked:
 b.text_field(:id, x).set(a
 b
 c)

 But when i tried this in web-driver it doesn't anymore. It enters text but
 the values are no longer separated by a carriage return.

 I've tried everything in this 
 posthttps://groups.google.com/d/topic/watir-general/SONhM3BnJD4/discussion.
 And I can't use send_keys because the text area doesn't allow the user to
 use up, down, or enter/return.

 Does anyone have any ideas?

-- 
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: Carriage Returns

2011-08-17 Thread hillary
That didn't work either. 

My code: 
browser.div(:id, popup_black_list).text_field(:id, 
TextBoxFilterAccountItemID).set(44F5DED9-6DF6-4854-A3EB-7658C106CC7C + 
10.chr + 3160E198-072D-42EB-964E-0B3C0840B6DE + 10.chr + 
2BACBD11-962F-4C8A-A3E6-0EFEB351EF96 + 10.chr + 
8A9C7469-B6B7-4409-A831-DAB824B742CF). It just set the values but didn't 
separate them by carriage returns. 


-- 
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: Carriage Returns

2011-08-17 Thread hillary
Thanks for the suggestion, but that didn't work either. 

My code (in case i'm doing something wrong): 
browser.div(:id, popup_black_list).text_field(:id, 
TextBoxFilterAccountItemID).set(44F5DED9-6DF6-4854-A3EB-7658C106CC7C + 
10.chr + 3160E198-072D-42EB-964E-0B3C0840B6DE + 10.chr + 
2BACBD11-962F-4C8A-A3E6-0EFEB351EF96 + 10.chr + 
8A9C7469-B6B7-4409-A831-DAB824B742CF). This is how it was entered in the 
text box = 
44F5DED9-6DF6-4854-A3EB-7658C106CC7C3160E198-072D-42EB-964E-0B3C0840B6DE2BACBD11-962F-4C8A-A3E6-0EFEB351EF968A9C7469-B6B7-4409-A831-DAB824B742CF

-- 
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: How do I select the second identical table?

2011-08-17 Thread Jarmo Pertman
I don't see anything in bold, but by using :xpath, then every other
selector will be ignored and the FIRST matched element will be
returned just like when using :id (it just doesn't make sense to
use :xpath and :index together). So, use something better, for
example :text if you can't use any of the :class, :id or similar
locators.

And nice catch about #tables not supporting :xpath at all. This
support should be added :)

Jarmo

On Aug 16, 5:43 pm, Dmitriy Korobskiy dkro...@gmail.com wrote:
 On 8/16/11 4:51 AM, Željko Filipin wrote: On Tue, Aug 16, 2011 at 12:20 AM, 
 Dmitriy Korobskiy dkro...@gmail.com
  mailto:dkro...@gmail.com wrote:
   I'm somewhat stumped trying to select the second table out of
  multiple identical tables on the page in Watir 2.0.1. It should be
  simple, right?

  Please note that `:index = 1` in Watir 1.x means the first table, and
  in Watir 2.x means the second table.

 Sure. I'm using 2.0.1 and I need the second table.

  Please post HTML of the tables.

  Željko

 Here is the relevant fragment. The target table is highlighted in bold.

 table width=1000 cellpadding=0 cellspacing=0 border=0
 align=center bgcolor=#ff
 tr
 td align=left valign=top class=content_bgimg
 src=images/point.gif width=1 height=1 border=0/td
 td align=left valign=top

 !-- InstanceBeginEditable name=Content --

 table cellpadding=0 cellspacing=0 border=0 align=center
 width=95%
 tr
 td colspan=3 align=left valign=topimg src=images/point.gif
 width=1 height=15 border=0 //td
 /tr

 tr
 td colspan=3 align=left valign=top class=headertxtMy Open
 Carts/td
 /tr
 tr

 td colspan=3 align=left valign=topimg src=images/point.gif
 width=1 height=11 border=0 //td
 /tr
 tr
 td colspan=5 align=left valign=middlea
 href=cartAction.cfm?action=newimg src=images/new_cart_bt.gif
 alt=New Cart width=90 height=24 border=0 //a/td
 /tr
 tr
 td align=left valign=top
 table class=tablesorter data
                      cellpadding=5 cellspacing=1 style=width:950px;
 thead

 tr
 th class=smalltxt width=300pxCart Name/th
 th class=smalltxt width=150pxCreated Date/th
 th class=smalltxt width=150pxLast Updated Date/th
 th class=smalltxt width=200pxActions/th
 th class=smalltxt width=100pxStatus/th

 /tr/thead
 tbody

 tr
 td class=row1a
 href=cartAction.cfm?action=selectcartId=KorobskiyD_110714135613  
 class=link1KorobskiyD_110714135613/a/td
 td class=row1Jul 14, 2011 1:56 PM/td
 td class=row1Jul 29, 2011 11:34 AM/td
 td class=row1a
 href=cartAction.cfm?action=submitcartId=KorobskiyD_110714135613
 class=link1img src=./images/submit_icon_n.gif title=Submit Cart
 alt=Submit Cart border=0 hspace=4/a a
 href=deleteConfirmation.cfm?cartId=KorobskiyD_110714135613
 class=link1img src=./images/delete_icon_n.gif title=Delete Cart
 alt=Delete Cart border=0 hspace=4/a a
 href=cartHistory.cfm?cartId=KorobskiyD_110714135613 class=link1img
 src=./images/cart_history_icon.gif title=Cart History alt=Cart
 History border=0 hspace=4/a/td

 td class=row1Open/td
 /tr

 tr
 td class=row1a
 href=cartAction.cfm?action=selectcartId=KorobskiyD_110816050326  
 class=link1KorobskiyD_110816050326/a/td
 td class=row1Aug 16, 2011 5:03 AM/td
 td class=row1Aug 16, 2011 5:03 AM/td
 td class=row1a
 href=deleteConfirmation.cfm?cartId=KorobskiyD_110816050326
 class=link1img src=./images/delete_icon_n.gif title=Delete Cart
 alt=Delete Cart border=0 hspace=4/a a
 href=cartHistory.cfm?cartId=KorobskiyD_110816050326 class=link1img
 src=./images/cart_history_icon.gif title=Cart History alt=Cart
 History border=0 hspace=4/a/td

 td class=row1Open/td
 /tr

 /tbody
 /table
 /td
 /tr
 tr
 td colspan=3 align=left valign=topimg src=images/point.gif
 width=1 height=29 border=0 //td

 /tr

 tr
 td colspan=3 align=left valign=top class=headertxtMy Submitted
 Carts/p/td
 /tr
 tr
 td align=left valign=top
 *table class=tablesorter data
                      align=left cellpadding=5 cellspacing=1
 style=width:950px; border=0
 theadtr

 th class=smalltxt width=300pxCart Name/th
 th class=smalltxt width=150pxCreated Date/th
 th class=smalltxt width=150pxLast Updated Date/th
 th class=smalltxt width=200pxActions/th
 th class=smalltxt width=100pxStatus/th
 /tr/thead

 tbody

 tr

 td class=row1a href=cart.cfm?cartId=KorobskiyD_110712121510
 class=link1KorobskiyD_110712121510/a/td
 td class=row1Jul 12, 2011 12:15 PM/td
 td class=row1Jul 14, 2011 1:54 PM/td
 td class=row1a
 href=cartHistory.cfm?cartId=KorobskiyD_110712121510 class=link1img
 src=./images/cart_history_icon.gif title=Cart History alt=Cart
 History border=0 hspace=4/a/td
 td class=row1Submitted to NBS/td

 /tr

 tr

 td class=row1a href=cart.cfm?cartId=TEST class=link1TEST/a/td
 td class=row1Jun 26, 2011 8:57 PM/td
 td class=row1Aug 16, 2011 5:01 AM/td
 td class=row1a href=cartAction.cfm?action=exportcartId=TEST
 class=link1img border=0
 hspace=4src=./images/download_spread_i.gif title=Download
 Spreadsheet alt=Download Spreadsheet/a a
 href=cartHistory.cfm?cartId=TEST class=link1img
 src=./images/cart_history_icon.gif 

Re: [wtr-general] Re: How do I select the second identical table?

2011-08-17 Thread Dmitriy Korobskiy

On 8/17/11 1:21 PM, Jarmo Pertman wrote:

I don't see anything in bold, but by using :xpath, then every other
selector will be ignored and the FIRST matched element will be
returned just like when using :id (it just doesn't make sense to
use :xpath and :index together). So, use something better, for
example :text if you can't use any of the :class, :id or similar
locators.

Yep, it works to locate the first table, but the second one is the problem.
I primarily use XPath locators to locate data tables based on columns 
(table headers) that they have.
I can switch to :class locator actually in conjunction with :index = 1. 
Another option is to to add ids into the source app and switch to id 
locators.


And nice catch about #tables not supporting :xpath at all. This
support should be added :)

Jarmo
Yes, it would make Watir compatible with Watir-WebDriver for this test 
case. Do you want me to create a Watir ticket for this?


--
DK
AIM: DKroot1, Skype: DKroot

--
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] watir-webriver won't create a Watir::Browser for Firefox 6.0

2011-08-17 Thread Tony Zanella
Using Ubuntu Natty Narwhal, I just updated my Firefox to Firefox 6.0
today. Now, watir-webdriver will not follow through on creating
Watir::Browser.new :firefox

$ gem list --local | grep watir-webdriver
watir-webdriver (0.3.1)

Everything is OK with chrome:

$ irb
ruby-1.8.7-p352 :001  require 'rubygems'
 = true
ruby-1.8.7-p352 :002  require 'watir-webdriver'
 = true
ruby-1.8.7-p352 :003  browser=Watir::Browser.new :chrome
 = #Watir::Browser:0x7fc97b06f558 url=about:blank
title=about:blank

But, with firefox, watir-webdriver will not return a Browser object:

ruby-1.8.7-p352 :004  firefox=Watir::Browser.new :firefox

This brings up a browser window, but the irb prompt just hangs, and
eventually times out:

Selenium::WebDriver::Error::WebDriverError: unable to obtain stable
firefox connection in 60 seconds (127.0.0.1:7055)
from /home/amz/.rvm/gems/ruby-1.8.7-p352/gems/selenium-
webdriver-2.3.2/lib/selenium/webdriver/firefox/launcher.rb:77:in
`connect_until_stable'
from /home/amz/.rvm/gems/ruby-1.8.7-p352/gems/selenium-
webdriver-2.3.2/lib/selenium/webdriver/firefox/launcher.rb:37:in
`launch'
from /home/amz/.rvm/gems/ruby-1.8.7-p352/gems/selenium-
webdriver-2.3.2/lib/selenium/webdriver/firefox/socket_lock.rb:20:in
`locked'
from /home/amz/.rvm/gems/ruby-1.8.7-p352/gems/selenium-
webdriver-2.3.2/lib/selenium/webdriver/firefox/launcher.rb:32:in
`launch'
from /home/amz/.rvm/gems/ruby-1.8.7-p352/gems/selenium-
webdriver-2.3.2/lib/selenium/webdriver/firefox/bridge.rb:19:in
`initialize'
from /home/amz/.rvm/gems/ruby-1.8.7-p352/gems/selenium-
webdriver-2.3.2/lib/selenium/webdriver/common/driver.rb:29:in `new'
from /home/amz/.rvm/gems/ruby-1.8.7-p352/gems/selenium-
webdriver-2.3.2/lib/selenium/webdriver/common/driver.rb:29:in `for'
from /home/amz/.rvm/gems/ruby-1.8.7-p352/gems/selenium-
webdriver-2.3.2/lib/selenium/webdriver.rb:81:in `for'
from /home/amz/.rvm/gems/ruby-1.8.7-p352/gems/watir-webdriver-0.3.1/
lib/watir-webdriver/browser.rb:35:in `initialize'
from (irb):4:in `new'
from (irb):4

Any suggestions, short of downgrading 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


Re: [wtr-general] watir-webriver won't create a Watir::Browser for Firefox 6.0

2011-08-17 Thread Jari Bakken
On Wed, Aug 17, 2011 at 9:39 PM, Tony Zanella tony.zane...@gmail.comwrote:


 Any suggestions, short of downgrading Firefox?


Upgrade selenium-webdriver to 2.4.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


[wtr-general] Re: watir-webriver won't create a Watir::Browser for Firefox 6.0

2011-08-17 Thread Tony Zanella
Thanks Jari, that did it!

On Aug 17, 4:13 pm, Jari Bakken jari.bak...@gmail.com wrote:
 On Wed, Aug 17, 2011 at 9:39 PM, Tony Zanella tony.zane...@gmail.comwrote:



  Any suggestions, short of downgrading Firefox?

 Upgrade selenium-webdriver to 2.4.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


[wtr-general] Re: watir-webriver won't create a Watir::Browser for Firefox 6.0

2011-08-17 Thread Tony Zanella
Thanks Dmitriy, that did it!

On Aug 17, 4:15 pm, Dmitriy Korobskiy dkro...@gmail.com wrote:
 On 8/17/11 3:39 PM, Tony Zanella wrote:

  Using Ubuntu Natty Narwhal, I just updated my Firefox to Firefox 6.0
  today. Now, watir-webdriver will not follow through on creating
  Watir::Browser.new :firefox

  $ gem list --local | grep watir-webdriver
  watir-webdriver (0.3.1)

  [skipped]
  Any suggestions, short of downgrading Firefox?

 Try to upgrade selenium-webdriver to 2.4.0. It works with Fx 6.0 for me.

 --
 DK
 AIM: DKroot1, Skype: DKroot

-- 
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