Re: [wtr-general] Re: Printing a Text on Browser

2011-05-05 Thread Željko Filipin
On Thu, May 5, 2011 at 9:40 AM, Ashu  wrote:
> on trying the above I get the following error
> :undefined method 'td' for # title="company:network">

Try this then:

puts browser.cell(:id => "e0_id").text

Ž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


[wtr-general] Re: Printing a Text on Browser

2011-05-05 Thread Ashu
Hi,
on trying the above I get the following error
:undefined method 'td' for #


On May 5, 1:34 am, Željko Filipin 
wrote:
> On Wed, May 4, 2011 at 10:31 PM, Ashu  wrote:
> > Product Id > >123456
> > Can you please help me, as I want to trace and display 123456.
>
> Try this:
>
> puts browser.td(:id => "e0_id").text
>
> Željko
> --
> watir.com - community manager
> watir.com/book - author
> watirpodcast.com - host
> viaqa.mobi conference on software testing - organizer

-- 
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] Re: Watir with Telerik Rad Grid

2011-05-05 Thread Željko Filipin
On Thu, May 5, 2011 at 8:28 AM, ranjith kumar  wrote:
> Applogies for the delay.

We are not in a hurry. :)

> I am attching 2 text files with the application code for telerik grid, and
telerik combo  box.

Now we are going somewhere. Unfortunately, we are not there yet. You have
provided server-side code (executes on web server) and we need client site
HTML (rendered in your browser). Watir does not care what is on the server,
it only interacts with the browser.

Ž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


[wtr-general] How to access cell or row index using watir-webdriver

2011-05-05 Thread Dan Claudiu Pop
Hello,

Can you guide me with some general approaches to get the index of a
row or cell with watir-webdriver ?

I've tried some approaches like:

   @browser.tbody(:index, 0).rows.each do |row|
  if  row.text.include?("#{name}") then
 puts row.row_index
  end
end

And also i tried with "each_with_index" but didn't get the expected
output.

Thank you,
Dan

-- 
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] How to access cell or row index using watir-webdriver

2011-05-05 Thread Željko Filipin
On Thu, May 5, 2011 at 10:31 AM, Dan Claudiu Pop 
wrote:
> And also i tried with "each_with_index" but didn't get the expected

What did you get and what did you expect? Please also provide your code.

Rubydoc says watir-webdriver does not have a method with "index" in name:

http://rubydoc.info/gems/watir-webdriver/

Željko
--
watir.com - community manager
watir.com/book - author
watirpodcast.com - host
viaqa.mobi conference on software testing - organizer

-- 
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: Printing a Text on Browser

2011-05-05 Thread Ashu
Well I tried it,
but since there doesnt exist any cell in the HTML, hence it does
return with a error.


On May 5, 12:54 pm, Željko Filipin 
wrote:
> On Thu, May 5, 2011 at 9:40 AM, Ashu  wrote:
> > on trying the above I get the following error
> > :undefined method 'td' for # > title="company:network">
>
> Try this then:
>
> puts browser.cell(:id => "e0_id").text
>
> Ž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


Re: [wtr-general] Re: Watir with Telerik Rad Grid

2011-05-05 Thread Željko Filipin
On Thu, May 5, 2011 at 11:00 AM, ranjith kumar 
wrote:
> Please find the Client side HTML.

You have posted server side code again. We need code *rendered in your
browser*. You can get it with firebug or similar tool.

Žejko

-- 
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 to return cell or row index using watir-webdriver

2011-05-05 Thread Dan Claudiu Pop
I've used (a solution posted by you):

@browser.tbody(:index, 0).rows.each_with_index do |row, index|
  row.cells.each do |cell|
if cell.text == "some_text"
  puts @browser.tbody(:index, 0)[index]
  break
end
  end
 end

It returns: #. I want to return the actual
row  index/number. I can do with a count but didn't wanted that
approach.

What i am trying to accomplish is to click delete/update (which id on
url is generated dynamically) based on a cell which i can identify by
text, therefore deleting/updating the corresponding row.

Here is the UI => http://i52.tinypic.com/2yu12jd.png
And DOM: => http://i53.tinypic.com/2bwo5t.png

Any other approach would be welcome:

Maybe something like (didn't get this work): @browser.td(:text =>
"text_name").td(:xpath => ""//a[@href=/delete/").click


On May 5, 11:35 am, Željko Filipin 
wrote:
> On Thu, May 5, 2011 at 10:31 AM, Dan Claudiu Pop 
> wrote:
>
> > And also i tried with "each_with_index" but didn't get the expected
>
> What did you get and what did you expect? Please also provide your code.
>
> Rubydoc says watir-webdriver does not have a method with "index" in name:
>
> http://rubydoc.info/gems/watir-webdriver/
>
> Željko
> --
> watir.com - community manager
> watir.com/book - author
> watirpodcast.com - host
> viaqa.mobi conference on software testing - organizer

-- 
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] Re: How to return cell or row index using watir-webdriver

2011-05-05 Thread Željko Filipin
On Thu, May 5, 2011 at 11:23 AM, Dan Claudiu Pop 
wrote:
>  puts @browser.tbody(:index, 0)[index]
> It returns: #. I want to return the actual
> row  index/number.

Try this:

puts index

instead of:

puts @browser.tbody(:index, 0)[index]

Ž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


Re: [wtr-general] Re: Watir with Telerik Rad Grid

2011-05-05 Thread Željko Filipin
2011/5/5 ranjith kumar 
> This time i took the code from view source of my IE browser.

Better, but still not there. :)

You have sent HTML source that is sent to your browser. What Watir sees is
HTML elements rendered from HTML source code and changed by JavaScript. So,
the best way to see what Watir sees is to use Firebug or similar tool for
IE.

Ž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


Re: [wtr-general] Re: Watir with Telerik Rad Grid

2011-05-05 Thread ranjith kumar
Hi,


I am trying my best to give the data.

And i am also giving the URL of telerik which i was referring to


*Rad Cmobo Box:*
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/filteringcombo/defaultcs.aspx

Seelct a value from drop down.

*Rad Grid:*
http://demos.telerik.com/aspnet-ajax/grid/examples/client/selecting/defaultcs.aspx

selecting the row from the grid.

Please check these links
On Thu, May 5, 2011 at 3:13 PM, Željko Filipin <
zeljko.fili...@wa-research.ch> wrote:

> 2011/5/5 ranjith kumar 
> > This time i took the code from view source of my IE browser.
>
> Better, but still not there. :)
>
> You have sent HTML source that is sent to your browser. What Watir sees is
> HTML elements rendered from HTML source code and changed by JavaScript. So,
> the best way to see what Watir sees is to use Firebug or similar tool for
> IE.
>
> Ž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
>

-- 
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: Printing a Text on Browser

2011-05-05 Thread Ashu
Is there an alternative wherein I can list all the tables and then
locate the particular desired text?
Thanks...

On May 5, 1:48 pm, Ashu  wrote:
> Well I tried it,
> but since there doesnt exist any cell in the HTML, hence it does
> return with a error.
>
> On May 5, 12:54 pm, Željko Filipin 
> wrote:
>
> > On Thu, May 5, 2011 at 9:40 AM, Ashu  wrote:
> > > on trying the above I get the following error
> > > :undefined method 'td' for # > > title="company:network">
>
> > Try this then:
>
> > puts browser.cell(:id => "e0_id").text
>
> > Ž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


Re: [wtr-general] Re: Watir with Telerik Rad Grid

2011-05-05 Thread Željko Filipin
On Thu, May 5, 2011 at 12:17 PM, ranjith kumar 
wrote:
> I am trying my best to give the data.

I can see that. If you were not making progress I would not bother to reply.

>
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/filteringcombo/defaultcs.aspx
> Seelct a value from drop down.

Now you are talking! :)

I have used firebug to inspect the page.

Let me know if you do not understand what this means:

$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0]

$ gem list watir-webdriver
watir-webdriver (0.2.3)

Select value:

require "rubygems"
require "watir-webdriver"
b = Watir::Browser.new :ff
b.goto "
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/filteringcombo/defaultcs.aspx
"
b.input(:id => "RadComboBox1_Input").click
b.ul(:class => "rcbList").li(:text => "Aria Cruz").click

>
http://demos.telerik.com/aspnet-ajax/grid/examples/client/selecting/defaultcs.aspx
> selecting the row from the grid.

b.goto "
http://demos.telerik.com/aspnet-ajax/grid/examples/client/selecting/defaultcs.aspx
"
b.tr(:id => "RadGrid1_ctl00__0").click

This was fun.

Ž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


[wtr-general] Re: How to return cell or row index using watir-webdriver

2011-05-05 Thread Dan Claudiu Pop
Yep, works just fine :)

Gracias,
Dan

On May 5, 12:27 pm, Željko Filipin 
wrote:
> On Thu, May 5, 2011 at 11:23 AM, Dan Claudiu Pop 
> wrote:
>
> >      puts @browser.tbody(:index, 0)[index]
> > It returns: #. I want to return the actual
> > row  index/number.
>
> Try this:
>
> puts index
>
> instead of:
>
> puts @browser.tbody(:index, 0)[index]
>
> Ž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


Re: [wtr-general] Re: Watir with Telerik Rad Grid

2011-05-05 Thread ranjith kumar
Thanks lot for your script.

I am able to run it.

Is there any function or method to wait till the url opens completely or
page loads completely using watir.

COuld you please also provide any material availble for automation using
watir apart from what is availble in watir website.

regards,
Ranjith



On Thu, May 5, 2011 at 4:15 PM, Željko Filipin <
zeljko.fili...@wa-research.ch> wrote:

> On Thu, May 5, 2011 at 12:17 PM, ranjith kumar 
> wrote:
> > I am trying my best to give the data.
>
> I can see that. If you were not making progress I would not bother to
> reply.
>
>
> >
> http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/filteringcombo/defaultcs.aspx
> > Seelct a value from drop down.
>
> Now you are talking! :)
>
> I have used firebug to inspect the page.
>
> Let me know if you do not understand what this means:
>
> $ ruby -v
> ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.0]
>
> $ gem list watir-webdriver
> watir-webdriver (0.2.3)
>
> Select value:
>
> require "rubygems"
> require "watir-webdriver"
> b = Watir::Browser.new :ff
> b.goto "
> http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/filteringcombo/defaultcs.aspx
> "
> b.input(:id => "RadComboBox1_Input").click
> b.ul(:class => "rcbList").li(:text => "Aria Cruz").click
>
>
> >
> http://demos.telerik.com/aspnet-ajax/grid/examples/client/selecting/defaultcs.aspx
> > selecting the row from the grid.
>
> b.goto "
> http://demos.telerik.com/aspnet-ajax/grid/examples/client/selecting/defaultcs.aspx
> "
> b.tr(:id => "RadGrid1_ctl00__0").click
>
> This was fun.
>
>
> Ž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
>

-- 
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] Re: Watir with Telerik Rad Grid

2011-05-05 Thread Željko Filipin
On Thu, May 5, 2011 at 2:00 PM, ranjith kumar  wrote:
> Is there any function or method to wait till the url opens completely or
page loads completely using watir.

I am not sure is this up to date:

http://wiki.openqa.org/display/WTR/How+to+wait+with+Watir

> COuld you please also provide any material availble for automation using
watir apart from what is availble in watir website.

As far as I know, watir.com points to everything.

Ž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


Re: [wtr-general] How to access cell or row index using watir-webdriver

2011-05-05 Thread Jari Bakken
On Thu, May 5, 2011 at 10:31 AM, Dan Claudiu Pop
 wrote:

> And also i tried with "each_with_index" but didn't get the expected
> output.
>

That should work.

-- 
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: Printing a Text on Browser

2011-05-05 Thread orde
puts browser.div(:class, "system").text will print 123456

To see all tables on a page, use the show_tables method:
http://rdoc.info/gems/watir/1.8.1/Watir/IE#show_tables-instance_method

Hope it helps.

orde

On May 5, 3:14 am, Ashu  wrote:
> Is there an alternative wherein I can list all the tables and then
> locate the particular desired text?
> Thanks...
>
> On May 5, 1:48 pm, Ashu  wrote:
>
>
>
>
>
>
>
> > Well I tried it,
> > but since there doesnt exist any cell in the HTML, hence it does
> > return with a error.
>
> > On May 5, 12:54 pm, Željko Filipin 
> > wrote:
>
> > > On Thu, May 5, 2011 at 9:40 AM, Ashu  wrote:
> > > > on trying the above I get the following error
> > > > :undefined method 'td' for # > > > title="company:network">
>
> > > Try this then:
>
> > > puts browser.cell(:id => "e0_id").text
>
> > > Ž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


[wtr-general] Waiting for page load using Watir

2011-05-05 Thread ranjith kumar
Hello Team,

I want my script to wait till a page loads completely or till i find a
link/text/object in the page using watir


Could you please provide me some sample examples for that.

Exa:--
Navigate to www.google.co.in...
I want my sctipt to wait til i could see *done* status in the status bar of
my IE.
The same way for waiting till i find the button "search"

Please help.

Regards,
Ranjith

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