Re: [wtr-general] Verify if a tag appears on a page

2012-09-07 Thread Jarmo Pertman
I'd recommend to use #present? instead, because #visible? will throw an 
error if element does not exist.

In short:
#exists? - means that element has to exist on the page, does not matter if 
it is visible or not
#visible? - means that element is visible on the page. Raises an error if 
element does not exist.
#present? - means that element has to exist on the page and is visible.

Jarmo Pertman
-
IT does really matter - http://itreallymatters.net


On Thursday, September 6, 2012 9:19:09 PM UTC+3, Daniela wrote:
>
> Hi Joe,
>
> Thank you a lot!
>
> It work's for me!
>
> Daniela
>
> Em quinta-feira, 6 de setembro de 2012 15h13min42s UTC-3, Joe Fl escreveu:
>>
>> Hi Daniela, 
>>
>> You can do the following: 
>>
>> browser.a(:text,'Adicionar mídia').visible? 
>>
>> Joe 
>>
>> On Thu, Sep 6, 2012 at 12:56 PM, Oscar Rieken  wrote: 
>> > well you can first locate the element and then there a few different 
>> ways 
>> > to check if the element exists? 
>> > 
>> http://watir.github.com/watir-webdriver/doc/Watir/Element.html#exists%3F-instance_method
>>  
>> > 
>> > 
>> > On Thu, Sep 6, 2012 at 12:48 PM, Daniela  
>> wrote: 
>> >> 
>> >> Hi.. 
>> >> 
>> >> Please, how can i verify if an object appears on a page? .. for 
>> example, 
>> >> look at this html: 
>> >> 
>> >> Adicionar 
>> mídia 
>> >> 
>> >> I want to verify if the link "Adicionar mídia" is in the page. 
>> >> 
>> >> How can i do this? 
>> >> 
>> >> Thanks! 
>> >> 
>> >> -- 
>> >> Before posting, please read http://watir.com/support. In short: 
>> search 
>> >> before you ask, be nice. 
>> >> 
>> >> watir-...@googlegroups.com 
>> >> http://groups.google.com/group/watir-general 
>> >> watir-genera...@googlegroups.com 
>> > 
>> > 
>> > -- 
>> > Before posting, please read http://watir.com/support. In short: search 
>> > before you ask, be nice. 
>> > 
>> > watir-...@googlegroups.com 
>> > http://groups.google.com/group/watir-general 
>> > watir-genera...@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: Working with GWT table

2012-09-07 Thread Joe Fl
Hi Anthony,

I tried the suggestion but there are some many panel on the package it's 
difficult to confirm the one I need to interact with.

I tried this to see how many tds exist on the page and it brought back 33.

tds = br.div(:id,'main').tds

I also tried to increment by one and get the text of the td and I get 
duplicate responses.

cell = br.div(:id => "main").td(:index => 1).text

Do you have any other ideas what I could do?

Here is the html.  You will see the tables don't have useful tags.






























Thanks again.  And Any help would be great.

Joe


On Sunday, September 2, 2012 6:57:08 PM UTC-4, Anthony Hallett wrote:
>
> try cell = br.div(:id => "main").td(:index => 1)  
>
> On Saturday, 1 September 2012 06:21:15 UTC+10, Joe Fl wrote:
>>
>> Hi Everyone,
>>
>> I am working on automating an GWT app for the first time.  I am trying to 
>> get data from td tag in a 
>> specific table .  
>>
>> When I run the following code:
>>
>> thr = br.div(:class,'middleCenterInner').trs
>>
>> I get the data from the first td.  I need to get to the second.
>>
>> Here the code:
>>
>> 
>> 
>> 
>> 
>> 
>>   ** I need to data from 
>> this one.
>> 
>> 
>> 
>> 
>>
>> You can see there is nothing useful to use to get there.  Most of the 
>> useful tags in the these
>> tds are the same.
>>
>> I did try using the index and that didn't workout.
>> My Code:
>> thr = br.td(:index,1).div(:class,'middleCenterInner').trs
>>
>> Any help would be greatly appreciated.
>>
>> Thank you,
>> Joe
>>
>

-- 
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 on Windows XP Pro Sp3 doesn't work

2012-09-07 Thread Emanuele Mandaglio
Hi Everyone,
I've got a problem to run watir on a VM guest Windows XP Pro SP3.

I've try all the recent ruby windows packages, but I always receive the 
same error.

Here the details:

Ruby version: ruby 1.9.3p194 (2012-04-20) [i386-mingw32]

gem list:

*** LOCAL GEMS ***

addressable (2.3.2)
bigdecimal (1.1.0)
builder (3.0.0)
childprocess (0.3.5)
commonwatir (3.0.0)
ffi (1.1.5)
hoe (3.0.8)
io-console (0.3)
json (1.5.4)
libwebsocket (0.1.5)
mini_magick (3.2.1)
minitest (2.5.1)
multi_json (1.3.6)
nokogiri (1.5.5 x86-mingw32)
rake (0.9.2.2)
rautomation (0.7.2)
rdoc (3.9.4)
rubyzip (0.9.9)
s4t-utils (1.0.4)
selenium-webdriver (2.25.0)
subexec (0.0.4)
user-choices (1.1.6.1)
watir (3.0.0)
watir-classic (3.1.0)
watir-webdriver (0.6.1)
win32-api (1.4.8 x86-mingw32)
win32-process (0.7.0)
win32screenshot (1.0.7)
windows-api (0.4.2)
windows-pr (1.2.2)
xml-simple (1.1.1)
yajl-ruby (1.1.0 x86-mingw32)

The automation script:

require 'watir'

ENV['DT_AE_AGENTACTIVE'] = 'true'
ENV['DT_AE_SESSIONNAME'] = 'Watir Sample Test'
ENV['DT_AE_SERVERHOST'] = '127.0.0.1'
ENV['DT_AE_SERVERPORT'] = '9988'
ENV['DT_AE_CLEARCACHE'] = 'true'

browser = Watir::Browser.new
browser.goto('http://www.mysite.it')
browser.text_field(:id, "txt_userName").set("username")
browser.text_field(:id, "txt_passWord").set("password")
browser.image(:alt, "Enter").click

And here's the error:

C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/browser.rb:89:in
 
`eval': Function '_get_errno' not found in [msvcrt.dll] (FFI::NotFoundError)
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/win32-process-0.7.0/lib/win32/process/functions.rb:12:in
 
`attach_pfunc'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/win32-process-0.7.0/lib/win32/process/functions.rb:64:in
 
`'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/win32-process-0.7.0/lib/win32/process/functions.rb:8:in
 
`'
from 
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 
`require'
from 
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 
`require'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/win32-process-0.7.0/lib/win32/process.rb:1:in
 
`'
from 
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 
`require'
from 
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 
`require'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/ie-process.rb:1:in
 
`'
from 
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 
`require'
from 
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 
`require'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/ie.rb:4:in
 
`'
from (eval):1:in `klass'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/browser.rb:89:in
 
`eval'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/browser.rb:89:in
 
`klass'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/browser.rb:79:in
 
`set_options'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/browser.rb:142:in
 
`set_sub_options'
from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/browser.rb:64:in
 
`new'
from test.rb:10:in `'

thanks in advance to those who will help me!

Bye

-- 
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 to Click a Button that has OnClick attribute

2012-09-07 Thread Brickman
Hello All,

I have an issue configuring a script that will simply click on a button. 

Here is the HTML code 

I have been around the internet and looked at many forums to try different 
scripts, but nothing seems to work.

To me it seems to be with the onClick attribute, and I not super well 
rounded in HTML however that appears to be a java script element.  Any help 
is appreciated and if you need more code or information please let me know.


-- 
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: Using Watir to Click a Button that has OnClick attribute

2012-09-07 Thread orde
You should be able to use the fire_event method instead of the click 
method.  A generic example:

browser.button(:id => "foo").fire_event("onclick")

HIH.

orde

On Friday, September 7, 2012 11:05:55 AM UTC-7, Brickman wrote:
>
> Hello All,
>
> I have an issue configuring a script that will simply click on a button. 
>
> Here is the HTML code  onClick="parent.location='DefaultOrig.asp'" />
>
> I have been around the internet and looked at many forums to try different 
> scripts, but nothing seems to work.
>
> To me it seems to be with the onClick attribute, and I not super well 
> rounded in HTML however that appears to be a java script element.  Any help 
> is appreciated and if you need more code or information please let me know.
>
>
>

-- 
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 on Windows XP Pro Sp3 doesn't work

2012-09-07 Thread Željko Filipin
On Fri, Sep 7, 2012 at 5:15 PM, Emanuele Mandaglio 
wrote:
> ffi (1.1.5)
>
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/browser.rb:89:in
`eval': Function '_get_errno' not found in [msvcrt.dll] (FFI::NotFoundError)

This looks like a problem with ffi gem. We had problems with that gem
before. Try upgrading or downgrading the gem. Let us know if you do not
know how to do that.

Željko
--
filipin.eu

-- 
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 to Click a Button that has OnClick attribute

2012-09-07 Thread Željko Filipin
On Fri, Sep 7, 2012 at 8:05 PM, Brickman  wrote:
> Here is the HTML code 

Did you try something like this?

browser.button(:value => "Continue ...").click

What happens? What did you expect to happen?

This could also help:

http://stackoverflow.com/questions/3787555/how-to-find-out-which-javascript-events-fired

Željko
--
filipin.eu

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