Re: [Wtr-general] hidden control..

2007-07-10 Thread mihai
exist method does not work, because the control exist but its hidden, and there 
is not a hidden? methodthat the reason for what ive asked if how i can find 
out that a control is hidden or not..
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] hidden control..

2007-07-09 Thread mihai
i have this html code: input type=hidden

how can i find out with watir if it is hidden or not?
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] hidden control..

2007-07-09 Thread mihai
no...i want something like : ie.button(..).exist? but ie.button().hidden?
i want to tell me if the control is hidden or not because that button and other 
control appear if i press the Show Advanced option button and hides if i press 
the Hide Advanced option and i want to test if the show.. button is pressed and 
the controls are not hidden or if the hide.. buttond is pressed and they are 
hidden
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] $ie.button replacing with $ie.b?

2007-07-07 Thread mihai
cand i do something like this, and how:

b=button
puts $ie.b(:index,1) 

instead of puts $ie.button(:index,1)
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] $ie.button replacing with $ie.b?

2007-07-07 Thread mihai
i want to do something like this:

def check_elements(ie,elements,btn,lnk)

for i in 1 .. elem[1,0]
   if (  ie.elements[0,0](:index,btn[i-1,0]).exist? and 
ie.elements[0,0](:value,btn[i-1,1])   and ie.elements[0,0](:name,btn[i-1,2])  )
then
write(The button with value: + btn[i-1,2] +  exist and 
not disabled,1)
else
  write(The button with value: + btn[i-1,2] +  does not 
exist ,0) # write is a def with file.puts...
  end # if exist

   end # for i 

end #def

elements=Matrix[ 
 [button,link,select_list...]
 [2,6,1] #number of buttons,links etc
]

buttons=Matrix[
[1,,Web Search],  # index, name and value
[2,,Go],
]

links=Matrix

check_elements(ie,elements,buttons,links)


I want to verify all elements just by calling check_elements procedure and 
editing an txt file where the buttons, links ..indexes, values and names are
This is just a simple example; the check_elements procedure it will be more 
complex, at least that i want.
Tnx for help
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] click with autoit on OK button

2007-07-05 Thread mihai
i have this code:

 $ie1.radios.each do |chk| 
chk.focus 
if $ie1.button(:index,2).exist?
then
  $autoit.BlockInput(1)
 $ie1.button(:index,2).click
  $autoit.Send({Enter})
$autoit.BlockInput(0)
   end

button(:index,2) is a remove button and it shoul remove the selected radio; the 
problem is that when i want to remove that radio a small window appears with 
title Microsoft Internet Explorer and with 2 buttons OK and CANCEL for remove 
item; the OK button is selected so all i have to do is to send ENTER key with 
autoit, but that small window blocks my script (wont execute the next command 
SEND({ENTER})) untill a button will be pressed.

Also i cant work with the main window unless the small window is closed.

How can i press  the OK button? How can the script execute SEND command and not 
pause untill the small window will be close?
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] display errors without exiting the script?

2007-06-22 Thread mihai
tnx it works; 
i have another problem, please help
i have this error: 

c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1192/./watir.rb:1787:in 
`method_missing': unknown property or method `document' (WIN32OLERuntimeError)
HRESULT error code:0x80010108
  The object invoked has disconnected from its clients. from 
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1192/./watir.rb:1787:in `document'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1192/./watir.rb:1254:in 
`show_frames'
from administration.rb:345

How can i keep running the script if this errors apears? i want to skip this 
error and execute the next test
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] display errors without exiting the script?

2007-06-20 Thread mihai
i have a link in $ie wich opens me a new window 
i attach that window to a variable $ie1 like that: $ie1=IE.attach(:title, /bla 
bla bla/) and i must verify if that window really exist or not
how do i do that because if that window exist is ok, but if is not exist the 
script is interrupted and stoped and i dont want that: 
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1192/./watir.rb:1642:in 
`attach_browser_window': Unable to locate a window with title of (?-mix:bla bla 
bla) (Watir::Exception::NoMatchingWindowFoundException)
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] control existing IE window?

2007-06-18 Thread mihai
how can i control a already IE opened window
for example if i have www.google.com window open but not with watir can i 
associate a variable $ie to that window an then click links etc using that 
variable?
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] control existing IE window?

2007-06-18 Thread mihai
tnx a lot
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] $ie show/hide?

2007-06-12 Thread mihai
can i hide my IE page while its being test?
something like:

$ie.hide
#test command
$ie.show
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] $ie.text.include? problem

2007-06-12 Thread mihai
i have this code:

testSite = 'http://www.google.com'
$ie = IE.new
$ie.goto(testSite)

if $ie.text.include?(Programs)  
then puts OK
  else puts CRAP
  end
  
  
end

and the output: 
OK
OK
OK

why does 3 OK appears? how can i do that only one OK appear and how can i write 
the code for, example,: 

if strings Microsoft and Programs and OK are in $ie.text puts OK
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] $ie.text.include? problem

2007-06-12 Thread mihai
but i need watir 1.5 because i'm working with some java scripts
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] sintax error

2007-06-09 Thread mihai
i search with a script all buttons on a page; if the name of a button is btnG 
then it must puts OK else NO
the code is: 
$ie.buttons.each do |bbtns|
  puts bbtns.name
  if bbtns.name.equal?('btnG')
then puts 'OK'
else puts 'NO'
  end
  puts bbtns.value
  puts
  $i=$i+1
end


but the output is:

btnG
NO
Google Search

btnI
NO
I'm Feeling Lucky


NO
Download Google Toolbar

what im doing wrong?
tnx
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] click link in iframe?

2007-06-08 Thread mihai
no ideea?
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] click link in iframe?

2007-06-08 Thread mihai
tnx, i had a problem with ie.show_frames...it didn't display the frame..now 
that it works i've solve my problem too just like u said with 
ie.frame(:index,xx).frame(:index,yy)... and so on
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] mouse right click?

2007-06-08 Thread mihai
can i send to a control mouse right click without using autoit?
..fireevent(rightclick) doesn't simulate right click on a html page
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] run a javascript in html?

2007-06-07 Thread mihai
nobody can help me?
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] click link in iframe?

2007-06-07 Thread mihai
i have this html code:

table border=0 cellpadding=0 cellspacing=0 width=100%  
  tr
td colspan=2  class=PContent   style=background-color: #FF; 
  IFRAME src = 
/blz/bzaShowLibrary.do?caller=Librarymodules=StandardAnalyticsmodules=CustomAnalyticsmodules=MyWorkspacemodules=Subscriptions
 width = 100% height = 546 scrolling = no frameborder = 0 /IFRAME
/td
  /tr
  /table

this is a meniu with submenius links: Standard Analytics, Custom Analytics, My 
Workspace...

and can i click Standard Analytics for example in watir?
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] run a javascript in html?

2007-06-07 Thread mihai
that doesn't work
Error: undefined method `area' for #Watir::IE:0x2e02304 (NoMethodError)



watir code:
require 'watir'

#includes
include Watir

ie = IE.new

ie.goto( 'http://www.squarebox.co.uk/scalc.html' )
sleep(5)
ie.area(:href, /digit\(4\)/).click
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] run a javascript in html?

2007-06-06 Thread mihai
i have a scientific calculator made in java in a html;
how do i test the buttons? when i want to press 5 it runs a javascript 
function digit(5)
how do i call that function in watir?
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] run a javascript in html?

2007-06-06 Thread mihai
this is the page i want to test:  
[http://www.squarebox.co.uk/scalc.html|http://www.squarebox.co.uk/scalc.html]
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general