Re: [Wtr-general] test/unit argument error

2007-06-26 Thread Manish Sapariya
Jeff Fry wrote:
 Happily, setup and teardown are also optional methods for those of us 
 using Watir. If you don't want something to happen automatically at 
 the beginning of every run, don't put it in setup. Likewise with 
 teardown. For functional automation I often don't include these 
 methods at all.
Thanks Jeff.
How about the case when I want to setup some environment, but that needs 
to be done only once for a set of test cases.

Regards,
Manish
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] test/unit argument error

2007-06-25 Thread Manish Sapariya
Bret Pettichord wrote:
 Depending on what the rest of your code looks like, this might work, though:

 require 'watir'
 require 'test/unit'

 class Login  Test::Unit::TestCase

def setup
 @site=$site
 @user_name=$user_name
 @passwd=$passwd
 end
 end
   
I ran into same problem and it worked. I had one question though? setup 
and teardown is
called for every test in given test class. I don't understand the 
reasoning behind this usage
model. The second thing, if I want to run more than one test case after 
setting the system
in particular state, how can I achieve that?

Thanks and Regards,
Manish
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] A novel use of Watir

2007-06-24 Thread Manish Sapariya
Quite interesting, but I didn't understand few things.

Bret Pettichord wrote:
 Using JRuby, we solved the problem in a novel way, by leveraging our
 existing WATIR codebase that was used for functional tests. We
 grafted a new backend onto WATIR (easier than it sounds, actually)
 that talks not to IE but to the Apache Commons HTTPClient (Java) and
 uses the NekoHTML parser (Java) to generate an XML DOM tree (Java).
 We have a Ruby layer that emulates enough of the IE DOM on top of
 that to allow WATIR to work just fine. 
So here we need Apache httpclient, NekoHTML and some Ruby component.
Does this Ruby component expose IEBrowser?
If yes, Does not it conflict with existing IE object? Do one need to change
watir lib to get this working, without conflicting with existing IE Object?

Thanks and Regards,
Manish
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] OT: Is cruisecontrol.rb by thoughworks is withdrawn

2007-06-18 Thread Manish Sapariya
I am trying to access following url for last two days,
but no success.

http://cruisecontrolrb.thoughtworks.com/

Is anybody out here facing same problem.

Thanks,
Manish

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] OT: Is cruisecontrol.rb by thoughworks is withdrawn

2007-06-18 Thread Manish Sapariya
Owen Rogers wrote:
 try now. the server needed a reboot.
 cheers,
 owen.
   

Thanks all.
-Manish
___
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 Manish Sapariya
mihai wrote:
 nobody can help me?
   
Did you try solution posted by me?

reproduced here---

This should work.

ie.area(:href, /digit\(4\)/).click
For accessing the operators you will have to change the regexp and you 
are done.
---

-Manish


___
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 Manish Sapariya
This should work.

ie.area(:href, /digit\(4\)/).click
For accessing the operators you will have to change the regexp and you 
are done.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] forum do not get the postings made using the mailing list

2007-06-07 Thread Manish Sapariya
Hi All,
This particular mail is targeted to the admin of watir-general
forum on openqa.org. This may be known issue, but I observed that the 
postings
done using mailing list mail id, does not get reflected in the
forum and many user's are using just forum for discussing the
queries.

Is there any way to make sure that the postings do get copied
to forum?

Thanks and Regards,
Manish

___
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 Manish Sapariya
I think watir 1.4 does not support map and area element.
Try watir 1.5.
___
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 Manish Sapariya
mihai wrote:
 this is the page i want to test:  
 [http://www.squarebox.co.uk/scalc.html|http://www.squarebox.co.uk/scalc.html]
   
This should work.

ie.area(:href, /digit\(4\)/).click
For accessing the operators you will have to change the regexp and you 
are done.

Question to the list:
On given page, when I do ie.show_links, it shows all the javascript 
hrefs. However
when I do ie.links() or check the existence of these links using

ie.link(:href,/digit/)

it returns false?

Are there any known limitations on accessibility of map and area elements?

Thanks and Regards,
Manish


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Gmail Automation: Repeated execution fails to send mails, set values fails

2007-06-01 Thread Manish Sapariya
devya wrote:
  But this case
 fails after few iteration with following exception

 c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1819:in 
 `method_missing': unknown property or method `readyState' 
 (WIN32OLERuntimeError)
 HRESULT error code:0x80070005
   Access is denied.   from 
 c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1819:in `wait'
   from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:224:in 
 `wait'
   from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:2575:in 
 `click'
   from try.rb:53:in `SendMailGmail'
   from try.rb:70
   from try.rb:69:in `each'
   from try.rb:69
   
Updating the to the latest gem, watir-1.5.1.1192,  fixes this problem.

Regards,
Manish

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Gmail Automation: Repeated execution fails to send mails, set values fails

2007-06-01 Thread Manish Sapariya
devya wrote:
 Case 2: Fails to set value for the to,subject and mailbody fields after few 
 iteration.

 login
 for 1 to 50
 sendmail
 logout

 In this case after sending the first, few mails, it shows the 
 to,subject,mailbody fields. The exists? test passes for these controls. 

 However setting the values on these controls does not reflect the 
 value in ie. Also, flash method does not flash it. When I read the 
 value from these controls, I can read them. 

 One interesting thing that I noted is, if I set
 the value in ie directly and then read the control, I dont get
 the new value, but what I get is the old value.

 Have I found a bug? Isn't watir refreshing the new DOM tree after
 sending the mail? 
   
No, there isn't any bug in watir. However, its typical behavior of 
gmail. I am not sure why, but
this is what I observed after playing with gmail.

Every time you compose a mail, gmail puts mail compose control in either 
of the v1,v2,v3 or v4
frame. I have not been able to figure out exactly when it uses a given 
frame though. One thing
I noticed is that sometimes two frames contain the same controls for 
compose mail and hence
the above mentioned behavior. I modified the SendMailGmail() as follows 
and it worked for 50
iterations.

There are chances that the following code may not work in the case, when 
exists? check is
done on elements which are not displayed. I did not face this problem in 
first run.

However, the question is, is there any way to figure out if the controls 
are the one which are visible
in the ie? Can I use Z-Index attribute?

Regards,
Manish


def SendMailGmail(mailTo, mailSubject, mailBody)
  puts In SendMailGmail function
  @ie.send_keys(c)
  while(([EMAIL PROTECTED](:name, main).frame(:id, v1).text_field(:id, 
to_compose).exists?)  ([EMAIL PROTECTED](:name, main).frame(:id, 
v2).text_field(:id, to_compose).exists?)  ([EMAIL PROTECTED](:name, 
main).frame(:id, v3).text_field(:id, to_compose).exists?)  
([EMAIL PROTECTED](:name, main).frame(:id, v4).text_field(:id, 
to_compose).exists?) )
p waiting for compose window to appear
sleep(2)
  end
  if ( @ie.frame(:name, main).frame(:id, v1).text_field(:id, 
to_compose).exists? )
frame=v1
  elsif ( @ie.frame(:name, main).frame(:id, v2).text_field(:id, 
to_compose).exists? )
frame=v2
elsif ( @ie.frame(:name, main).frame(:id, v3).text_field(:id, 
to_compose).exists? )
frame=v3
else
  frame = v4
end
  puts chosen frame is #{frame}\n
 # sleep(2)
  #if (@ie.frame(:name, main).frame(:id, v2).text_field(:id, 
to_compose).exists?())
puts Mail To Address - #{mailTo}
@ie.frame(:name, main).frame(:id, frame).text_field(:id, 
to_compose).set(mailTo)
  #end 
  #if (@ie.frame(:name, main).frame(:id, v2).text_field(:name, 
subject).exists?())
puts Mail Subject - #{mailSubject}
@ie.frame(:name, main).frame(:id, frame).text_field(:name, 
subject).set(mailSubject)
  #end
  #if (@ie.frame(:name, main).frame(:id, v2).div(:id, 
hc_compose).exists?())
puts Mail Body - #{mailBody}
@ie.frame(:name, main).frame(:id, frame).div(:id, 
hc_compose).document.innerHTML=mailBody
  #end
  @ie.frame(:name, main).frame(:id, frame).button(:id, snd).click c
  @ie.frame(:name, main).wait()
  sleep(3)
end # end function SendMail
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] How click on save button in file download

2007-05-31 Thread Manish Sapariya
You need to invoke following two code snippets in two different 
thread/process.
i.e. You spawn new thread/process and invoke the click handler code and 
then in
the main thread execute the click code.

===click code===

 ie.button(:value, Download File).click

   
click handler code=
 autoit = WIN32OLE.new(AutoItX3.Control)
 autoit.WinWait(File Download, , 5)
 autoit.ControlClick(File Download, , Save)
 autoit.WinWait(Save As, Save in, 5)
 autoit.ControlSetText(Save As, Save in, Edit1, path\filename.ext)
 autoit.ControlClick(Save As, Save in, Save)
   
Look at the javascript dialog handling tests in the watir unit-tests 
sample  and WindowHelper.rb
in the watir source, to figure out how exactly this code works.
Hope this helps.
Regards,
Manish

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Automating gmail: nor click on Compose Mail, neither fire_event works

2007-05-29 Thread Manish Sapariya
Manish Sapariya wrote:
 Hi All,
 I am trying to automate sending mail using gmail. I could
 locate the Compose Mail div and make it flash using,


 irb(main):100:0 ie.frame(:name, 
 main).frame(:name,v1).span(:text,Compose M
 ail).flash

 However,
 the click() or fire_event(onclick) does not seem to be working.
   
I have work around, which I think would be helpful to document in form 
of reply.

After playing around the app bit more, I have figured out a way to click 
on Compose Mail
You can enable the key board shortcuts and use send_keys(c) for 
compose mail.

About the events though, I am clueless as to why fire_event() did not 
help in this case.
I think following link have clue to the problem, however I dont think I 
quite understand it.

http://ajaxcookbook.org/event-handling-memory-leaks/

What I understand from here is that gmail is registering the event 
handlers dynamically
and I have to figure out, how the registration javascript is invoked. I 
thought mousemove/mouseover
action might invoke this code, but then realize that there are no 
handler for these event themselves,
in the first place.

So event registration for gmail control, which uses addEventListener is 
still mistery to me,
I am on my way to completion using keyboard shortcut though.

I hope I will have enough keyboard shortcut's defined to automate other 
functionality, or else
I will have to start the hunt for finding out the answer to 
addEventListner code invocation.

This brings another question:
Is it possible to dump all javascript code snippets using watir?
I could not find the code for event registration anywhere, though I 
could see lots of SCRIPT
object it was painful to go through them all manually using devtool bar.

Thanks for any help.
Regards,
Manish

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Automating gmail: nor click on Compose Mail, neither fire_event works

2007-05-29 Thread Manish Sapariya
Željko Filipin wrote:
 Are you working for Google, or are you automating Gmail for some other 
 reason. I am asking because, if you work for Google, you could ask 
 developers how to click Compose Mail link. I am really interested to 
 know the answer. Another workaround would be to switch to basic HTML 
 view, I guess there is no magic there.

No, I dont work for google, and I don't have access to the internals, 
and thats what
I am trying to understand. As I mentioned in my mail, I have work around 
even in the
Ajax'ed gmail, but I am sure there will be something else coming up in 
my way. I need
to drive the Ajax'ed gmail and hence all the effort.

Anyways, thanks for all the pointers. I shall keep the list updated.
Regards,
Manish

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] test, please ignore

2007-05-28 Thread Manish Sapariya

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Automating gmail: nor click on Compose Mail, neither fire_event works

2007-05-28 Thread Manish Sapariya
Hi All,
I am trying to automate sending mail using gmail. I could
locate the Compose Mail div and make it flash using,


irb(main):100:0 ie.frame(:name, 
main).frame(:name,v1).span(:text,Compose M
ail).flash

However,
the click() or fire_event(onclick) does not seem to be working.

irb(main):109:0 ie.frame(:name, 
main).frame(:name,v1).span(:text,Compose M
ail).flash
= nil
irb(main):110:0 ie.frame(:name, 
main).frame(:name,v1).span(:text,Compose M
ail).fire_event(onmousedown)
= 
irb(main):111:0
irb(main):111:0 ie.frame(:name, 
main).frame(:name,v1).span(:text,Compose M
ail).click
= 0.5
irb(main):112:0

After playing a while with firebug extension on firefox and gmail, I 
could figure
out that it is sending out onmousedown event. However I noted that the 
firebug
reports that the it sends out the X-Y co-ordinates of the click as well. 
I tried
simple onmousedown event as shown above, however it did not help. I am 
not sure if
need to the X-Y co-ordinate as well, for it to work? And How is the 
question?

Any ideas?

Thanks,
Manish
P.S. : Firebug on firefox was an excellent help to understand the 
events? Is there
any equivalent for IE?
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Automating gmail: nor click on Compose Mail, neither fire_event works

2007-05-28 Thread Manish Sapariya
Željko Filipin wrote:
 Take a look at Internet Explorer Developer Toolbar ( 
 http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038displaylang=en
  
 http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038displaylang=en).

 Zeljko

Hi Zelko,
I am actively using dev toolbar. However I needed to know what kind of 
events
are generated when I actually click on Compose Mail. I didnot find any 
way to
do achieve this in dev tool bar, if I am not missing anything obvious.

Using Firebug I can select a element and select to log all events for 
that element.
This was great help to figure out what goes under the hood when I access 
the page.

Thanks anyways.
Regards,
Manish

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] 'method_missing': document (WIN32OLERuntimeError)

2007-04-13 Thread Manish Sapariya
Hi,
I am facing same problem in 1.5, not sure if its the same. I had
sent query regarding this on list, but had no replies. It happens
always when I do

goto (www.hotmail.com)

Is there any known bug in 1.5 latest gem?
Any directions so that I can give more inputs to debug problem.

Watir Version: watir-1.5.1.1158.


Thanks and Regards,
Manish


Bret Pettichord wrote:
 aidy lewis wrote:
   
 I am getting this error:

 'method_missing': document (WIN32OLERuntimeError)

 that lies @ie.document

 I am using 1.4.1.

 Here is my code

 snip

 require 'watir'
 include Watir
 require 'test\unit'

 $ie = Watir::IE.new
 def browser;$ie;end

 module Login
   USERNAME = browser.text_field(:name, 'user_name')
   PASSWORD = browser.text_field(:name, 'password')
   REMEMBER_ME = browser.checkbox(:name, 'remember_me')
   SIGN_IN = browser.button(:value, 'Sign in')
 end

 module Mission
   LOG_OUT = browser.link(:text, /Log-out/)
 end

 class TC_Mission  Test::Unit::TestCase
   include Login


   def setup
 browser.goto('www.something.com')
   
 
 Right here add:
   browser.wait

 This bug is fixed in 1.5.

   
 browser.bring_to_front
 browser.maximize
   end
   
 

 ___
 Wtr-general mailing list
 [EMAIL PROTECTED]
 http://rubyforge.org/mailman/listinfo/wtr-general

   

___
Wtr-general mailing list
[EMAIL PROTECTED]
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] 'method_missing': document (WIN32OLERuntimeError)

2007-04-13 Thread Manish Sapariya
Hi,
Thanks it works. :-)
However I noted that even the site says ver 1.5.1.1165,
the actual gem file is 1164. Neverthless, it works as expected.
Thanks,
Manish

Charley Baker wrote:
 Hi Manish,

   Try using the latest gem on the watir site, 1165. There's a bit of a 
 work around for this issue in place until we get around to a longer 
 term fix. It's the same cross site scripting frame issue which has 
 been discussed on this list previously.

 -Charley

 On 4/13/07, *Manish Sapariya* [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:

 Hi,
 I am facing same problem in 1.5, not sure if its the same. I had
 sent query regarding this on list, but had no replies. It happens
 always when I do

 goto (www.hotmail.com http://www.hotmail.com)

 Is there any known bug in 1.5 latest gem?
 Any directions so that I can give more inputs to debug problem.

 Watir Version: watir-1.5.1.1158.


 Thanks and Regards,
 Manish


 Bret Pettichord wrote:
  aidy lewis wrote:
 
  I am getting this error:
 
  'method_missing': document (WIN32OLERuntimeError)
 
  that lies @ie.document
 
  I am using 1.4.1.
 
  Here is my code
 
  snip
 
  require 'watir'
  include Watir
  require 'test\unit'
 
  $ie = Watir:: IE.new
  def browser;$ie;end
 
  module Login
USERNAME = browser.text_field(:name, 'user_name')
PASSWORD = browser.text_field(:name, 'password')
REMEMBER_ME = browser.checkbox(:name, 'remember_me')
SIGN_IN = browser.button(:value, 'Sign in')
  end
 
  module Mission
LOG_OUT = browser.link (:text, /Log-out/)
  end
 
  class TC_Mission  Test::Unit::TestCase
include Login
 
 
def setup
  browser.goto(' www.something.com http://www.something.com')
 
 
  Right here add:
browser.wait
 
  This bug is fixed in 1.5.
 
 
  browser.bring_to_front
  browser.maximize
end
 
 
 
  ___
  Wtr-general mailing list
  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
  http://rubyforge.org/mailman/listinfo/wtr-general
 
 

 ___
 Wtr-general mailing list
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
 http://rubyforge.org/mailman/listinfo/wtr-general



 -- 
 This message has been scanned for viruses and
 dangerous content by *MailScanner* http://www.mailscanner.info/, and is
 believed to be clean.
 

 ___
 Wtr-general mailing list
 [EMAIL PROTECTED]
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
[EMAIL PROTECTED]
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] method missing: document while accessing hotmail.com

2007-04-12 Thread Manish Sapariya
Hi,
I tried searching archives but did not see any issue.
If run this code snippet

---
#includes
require 'watir'   # the controller
include Watir

#test::unit includes
require 'test/unit'
require 'test/unit/ui/console/testrunner'
  #
  # test case that shows basic WATIR functionality:
  #   * enter text in a field
  #   * click a button
  #
 
   #variables
   test_site = 'http://www.hotmail.com'


gives error


 ruby hotmail.rb
## Beginning of test: google search
 
Step 1: go to the google site: www.google.com
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1830:in 
`method_missing': document (WIN32OLERuntimeError)
OLE error code:80070005 in Unknown
  Access is denied.


HRESULT error code:0x80020009
  Exception occurred.from 
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1830:in `wait'
from 
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1829:in `times'
from 
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1829:in `wait'
from 
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1693:in `goto'
from hotmail.rb:24
 Exit code: 1


Has anybody seen such issue?
Is this known issue in watir-1.5.1.1158.

Thanks and Regards,
Manish
___
Wtr-general mailing list
[EMAIL PROTECTED]
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] click() in infinite loop while working with orkut

2007-01-03 Thread Manish Sapariya

Hi,

Please find attached a script to extract scrap information from orkut
user. What I am seeing is that when I do click on submit button, the
click call never returns. The tracing of the calls reveals that click
function call is spinning because @ie.busy status never becoming false.

I think the problem is in the OLE interface of ie which goes havoc when
dealing with orkut. I would appreciate any pointers about how can I go
step further in debugging.

I have a workaround now by using timeout but this is very naive solution.
I would also appreciate if I can have some patch in watir code so that
I need not have timeout around every click call. (The attached script has
work around code commented.)

If needed I can send out my analysis using tracing.

Environment: Watir 1.5

Thanks and Regards,
Manish


require 'watir'   # the watir controller
require 'timeout'
include Watir

   # set a variable
   test_site = 
'https://www.google.com/accounts/ServiceLoginBox?continue=https%3A%2F%2Fwww.orkut.com%2FRedirLogin.aspx%3Fmsg%3D0%26page%3Dhttp%253A%252F%252Fwww.orkut.com%252Ffollowup=https%3A%2F%2Fwww.orkut.com%2FGLogin.aspxservice=orkutnui=2uilel=1skipvpage=truehl=en-US'
  
   # open the IE browser
   ie = Watir::IE.new

   # print some comments
   puts ## Beginning of test: Orkut Scraps
   puts   


#Login
puts Step 1: go to the test site:  + test_site
   ie.goto(test_site)
   
puts Step 2: Enter the username
ie.text_field(:name, Email).set(talent.capture) #Login

puts Step 3: Enter the password
ie.text_field(:name, Passwd).set(recruitment) #Password

puts Step 4: Clear remember me checkbox
ie.checkbox(:name, PersistentCookie).clear #Clear Remember me on this 
computer

#begin
#status = Timeout::timeout(20) {
puts Step 5: Submit
ie.button(:value, Sign in).click #Submit
 # }
  #rescue TimeoutError
   #  puts Looks like this is working ...I am on my way :-)\n
  #end

puts Now on Home page
#ie = Watir::IE.attach(:url, http://www.orkut.com/Home.aspx;)
while ! ie.contains_text(talent) do 
 p waiting for page to load
 sleep 0.1; 
 end

a = ie.contains_text(talent.capture)
if !a
  puts Test failed! Page didn't contain text: Reached test verification point.
else

#  begin
#status = Timeout::timeout(20) {
  puts Click on scrapbook
 ie.link(:text, scrapbook).click
 # }
 # rescue TimeoutError
  #   puts Looks like this is working ...I am on my way :-)\n
 # end
end
exit
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] click() in infinite loop while working with orkut

2007-01-03 Thread Manish Sapariya
Thanks Bret.
It worked.

I would be glad if you can me point to anything that can explain
the root cause of the problem and whats the solution.
Thanks again.
-Manish


Bret Pettichord wrote:
  Manish Sapariya wrote:
  Please find attached a script to extract scrap information from orkut
  user. What I am seeing is that when I do click on submit button, the
  click call never returns. The tracing of the calls reveals that click
  function call is spinning because @ie.busy status never becoming false.
  Try calling the click! or click_no_wait methods instead.
  ___
  Wtr-general mailing list
  Wtr-general@rubyforge.org
  http://rubyforge.org/mailman/listinfo/wtr-general
 

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Watir on Linux

2006-09-12 Thread Manish Sapariya
Hi Ryan,
There is no official build for Linux.
However, few people have ported and changed necessary file to make it 
work on MacOS and Linux.
I have modified copy of FireWatir which kind of works on Linux with 
prototype code for supporting
clicking on javascript dialogs.

Please let me know if you need the changed source or any other help 
getting it working on Linux.
Regards,
Manish

Ryan wrote:
 Does anyone know when this will be available on linux, and if there is an ad 
 hoc way i can execute watir scripts on linux at this current point in time?
 -
 Posted via Jive Forums
 http://forums.openqa.org/thread.jspa?threadID=4133messageID=11354#11354
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general
   

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] oo design question for desigining domain specific library using watir

2006-08-25 Thread Manish Sapariya
Hi,
I am trying to automate web management console of our appliance.
I am trying to write a class library using watir which will kind of provide
all functionality which a user can perform using this GUI.
Going step forward I am wrapping this library in unit test to build my 
regression tests.

Problem I am facing is, where do I store ie handle returned by 
Watir::IE.new.
Currently I am creating this instance in my test routine and passing it 
to IGuard.new
call.

If I create this object in the IGuard class itself, I dont know how do I get
access to this ie object in my test class for executing various asserts.

I am facing hard time designing this library in OO way.

Any pointers or samples will really help.
Thanks and Regards,
Manish

--
class IGaurd
include Search
include Policy

def initialize (ie, machine=, domain=lab.reconnex.net)
@ie = ie
@searchList=[]
@userList=[]
@machine=machine
@domain=domain
@igurl = https://+machine+.+domain+/analyst;
if @machine !=  then
gotoIGuard(@igurl)
end
end

def gotoIGuard(url)
t = Thread.new {
#sleep 1
clicker = GUIHelper.new
clicker.push_security_alert_yes()
}
@ie.goto(url)
#sleep 1
#sleep 1
t.join
end

def setIG(machine, domain=lab.reconnex.net)
@machine = machine
@domain = domain
@igurl = https://[EMAIL PROTECTED].+domain+/analyst
gotoIGuard(@igurl)
end
 
def adminLogin(passwd=analyst)
#$ie.text_field(:name, domain).set(ldapdomain)
@ie.text_field(:name, name).set(admin)
@ie.text_field(:name, value).set(passwd)
@ie.button(:value, Login).click
end
 
def userLogin(user, passwd=analyst, ldapdomain=)
if ldapdomain !=  then
@ie.text_field(:name, domain).set(ldapdomain)
end
@ie.text_field(:name, name).set(user)
@ie.text_field(:name, value).set(passwd)
@ie.button(:value, Login).click
end

def logout
@ie.frame(topbarFrame).link(:href, /logout/i).click
end

 
def exit
self.logout
@ie.close
sleep 1
end

end
--
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] ruby test unit, recovering from failure

2006-08-19 Thread Manish Sapariya
Hi,
Is there any way to keep on running my testsuite if one of my test raises
exceptions which is not handled by the application under test gracefully.

What if i catch all exception in my testing code?
Will test unit report failure for those test cases?

Thanks,
Manish

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] ruby test unit, recovering from failure

2006-08-19 Thread Manish Sapariya
If I enclose my test code in

begin
rescue
end

the test suite does not report any exception as failure?
Any ideas?
Regards,
Manish


Manish Sapariya wrote:
 Hi,
 Is there any way to keep on running my testsuite if one of my test raises
 exceptions which is not handled by the application under test gracefully.

 What if i catch all exception in my testing code?
 Will test unit report failure for those test cases?

 Thanks,
 Manish

 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general
   

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] contains_text not giving match when the requested tags are in frames instead of main html body

2006-08-19 Thread Manish Sapariya
Hi I have following HTML in one of my frames on my html page.

-
div id=menurightmenu
   div align=CENTERAccount name: strongadmin/strong |nbsp;a 
href=/analyst/ReLogout.do target=_parentLogout/a/div
/div
--

ie.contains_text(admin) returns me nil.

Does watir support contains_text within frame as well?

Thanks,
Manish
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] not exactly watir but a ruby question

2006-08-11 Thread Manish Sapariya
Hi,
How do break out of x.times loop.

10.times do
  findWindowLike(nil, /^Microsoft Internet Explorer$/, //) {|win|
  puts #{win.getClassName}\t#{win.getWindowText}
  #p win.getWindowRect
  #p win
 
  if(win.getParent().hwnd == $ie.hwnd) then
#p $ie.hwnd, win.getParent().hwnd
popupwin=win
p Found appropriate parent...Breaking
break
  end
}
p Waiting for one sec for diaog to show up
sleep 1
end

My break in the if condition, when I find if the child is indeed the
child of my ie window, is not working as expected.

Is this correct ruby usage?
Can anyone suggest any other way to retry my waiting mechanism or the
child dialog to appear which is spawned by my IE browser.

Thanks and Regards,
Manish

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Wtr-general Digest, Vol 33, Issue 19

2006-08-11 Thread Manish Sapariya
Thanks,
It did work.
Regards,
Manish



Jeff Wood wrote:
 Or, you could use a simple throw-catch pair.

 % irb
 irb(main):001:0 catch :done do
 irb(main):002:1*
 irb(main):003:1*   10.times do |x|
 irb(main):004:2*
 irb(main):005:2*  [1,2,3].each do |y|
 irb(main):006:3*throw :done if x == 4  y == 2
 irb(main):007:3puts #{ x } : #{ y }
 irb(main):008:3break if y == 2
 irb(main):009:3  end
 irb(main):010:2
 irb(main):011:2*   end
 irb(main):012:1
 irb(main):013:1* end
 0 : 1
 0 : 2
 1 : 1
 1 : 2
 2 : 1
 2 : 2
 3 : 1
 3 : 2
 4 : 1
 = nil
 irb(main):014:0


 ... so yeah, I didn't see the internal block the first time ... it will
 only stop the most internal iterator ...

 A throw-catch will bail to whatever level you define.

 jd

 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general
   

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Clicking on the java script dialog box when IE window is not in focus

2006-08-10 Thread Manish Sapariya
Hi,
Last few days I have been investigating this and tried all the
dialog related tests in the current watir (1.5) code. None of
the test I tried works if the IE windows is not in focus.

I started digging about how this could be achieved and I came
across few win32 api (getting window handle, sending
messages to applications) and I got one proof of concept vb
code build, which can click on IE javascript dialog when not in focus.
My next task was to put it in ruby using win32 api. When doing this
I came across guitest tool in ruby and one of the post by Bret
mentioning this tool. He mentioned that guitest
needed to compiled in cygwin. Nevertheless I gave it a try
and to my surprise using nmake I can make the guitest.so
libarary which works like charm.

I have rewritten the javascript_test.rb using the *click_no_wait*
and the guitest and it works like charm. With guitest library
my IE window need not be focus when it needs to click on
javascript dialog.

While investigating I checked out watir code in more
details and came across some things which I cant explain to
myself. I would appreciate any clarification.

1. WinClicker has almost the code needed to do what I have done.
But I could not find any test which does the clicking when IE window
is not focused.
Question : What was the basic purpose of writing winclicker?

2. Autoit is used to simulate key strokes? Why does Autoit poses the
requirement that the windows that it works on needs to be focused.
Can't autoit script work on window that it has handle of?

3. What are other features in watir that we can use guitest to enhance?

4. I could not exactly figure out the need for IEDialog as well.

5. My current implementation works by searching for the window with title
Microsoft Internet Explorer. Ideally I would like to search for child 
windows
of IE, of which I have handle in ie.hwnd. However for some reason windows
does not recognize the javascript dialog as the child window of IE. 
Surprisingly
when I try to find the parent window of dialog it is shown correctly IE 
as the
parent window of javascript dialog box?
Any ideas?


If anybody wants to checkout this code I can send out the instructions to
build guitest.so (or can send the binary itself) and other test code 
that I have.

Thanks and Regards,
Manish

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] FireWatir performance and watir on linux

2006-08-10 Thread Manish Sapariya
Hi,
I have proof of concept for clicking on javascript dialog boxes in 
firefox on linux using
at-spi library. However before I proceed ahead with some more 
experiments, I wanted
to investigate the reason of slowness of FireWatir.

1. Is it because of inherent approach of driving firefox using javascript?
2. Is it because of the jssh server plugin?
3. Is it because of the way jssh plugin being used?

Has anybody worked on making it faster if not as fast as IE?

For me the speed of FireWatir was one of turn off when it
comes using it on linux/firefox.

Any inputs will be of great help for moving forward.

Thanks and Regards,
Manish
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] porting Watir to Selenium

2006-08-02 Thread Manish Sapariya
Hi,
I have not used selenium, but was wondering how is the
javascript dialog support in selenium.
Does watir have upper hand there?
Thanks and Regards,
Manish


On 08/02/2006 01:14 AM, Chris McMahon wrote:
 Jason Huggins is a very smart guy:  http://www.jrandolph.com/blog/?p=44
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general
   

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] why win32ole needed to be patched or modified

2006-07-14 Thread Manish Sapariya
Hi Bret,
I was trying to understand in general how Ruby provides access to 
win32ole library.
If I want to drive my custom application, do I need to patch win32ole 
binding in
such a way.

I think I will have to do my homework better about ole and ruby ole binding.

I didnt understand the need for patch quite exactly, but more 
understanding of ruby
ole binding will make picture clear.

Thanks anyways.
Regards,
Manish


Bret Pettichord wrote:
 On 7/7/06, *Manish Sapariya* [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:

 Hi,
 Bret mentioned in one of the posts that in order for watir to be
 working,
 win32ole ruby bindings needed to be patched.

 I was wondering for what kind of patch this was?
 If I want my own app to be driven using ole, what kind of patch I
 might
 require to add?

 I would appreciate pointers to the right forum if this is not the one.
 Thanks and Regards,
 Manish


 I'm not quite sure what the basis for your question is. So i'll say 
 some things and i hope you will find them useful. If not, please 
 provide more details about what you are looking for.

 Please don't take this personally, but since it seems like this is not 
 clear to everyone on the list, i feel like i need to say that you 
 should not feel insulted by my response and if you do, it would be 
 better to say so than respond rudely yourself.

 Now for your question.

 The WIN32OLE patch was needed for our support for modal dialogs -- 
 which are an IE-only feature. Specifically, we wrote a DLL that 
 returned a reference to the DOM in the modal dialog. We needed a way 
 to cast this into a WIN32OLE object. We patched the WIN32OLE library 
 to provide this casting ability. The WIN32OLE patch is included in 
 the Watir source so you can look at it yourself, if that helps.

 Does this help?

 Bret
 

 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Watir ran on Linux Fedora Core 5

2006-07-10 Thread Manish Sapariya
Hi All,

Dave provided me following xpi for jssh and FireWatir worked as expected on
- Fedora  Core
- Firefox 1.5.0.1.

http://people.mozilla.com/~davel/jssh/jssh-Linux-1.5.0.x.xpi

Thanks to Dave for providing me the xpi.
Currently I could only run links_xpath_test.rb.
I haven't tried any other test though.
Next step for me to get the javascript_test.rb working which
involves clicking on the dialog boxes.

Current solution I am planning to implement is to click on the
dialog boxes using external process using dogtail testscripts,
like watir 1.4.

Dogtail is in python. I googled around to search for something
ruby, but in vain.
Any suggestion will be of great help.
Thanks and Regards,
Manish


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] why win32ole needed to be patched or modified

2006-07-07 Thread Manish Sapariya
Hi,
Bret mentioned in one of the posts that in order for watir to be working,
win32ole ruby bindings needed to be patched.

I was wondering for what kind of patch this was?
If I want my own app to be driven using ole, what kind of patch I might
require to add?

I would appreciate pointers to the right forum if this is not the one.
Thanks and Regards,
Manish

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] FireWatir on linux

2006-07-07 Thread Manish Sapariya
Hi,
Has anyone tried running firewatir on linux?
I went through the code and looks like it wont
run under linux because references to win32ole
and autoit libraries.

Is it expected run under linux by any chance?
What will it take to make it run under linux?

Thanks and Regards,
Manish

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] using autoit functions from inside watir scripts

2006-06-20 Thread Manish Sapariya
Hi Lonny,
thanks for the help. I could run IE with mutliple
user. Can I invoke autoit functions directly from watir script.
I dont want to install autoit, just because I want to use
two apis:

RunAsSet
Run

Thanks and Regards,
Manish



___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Understanding WATIR

2006-06-16 Thread Manish Sapariya

Hi David,
Yes, you are right. it gave me access to all elements in page, as I was 
expecting.


However when the page has multiple frames, I have to qualify frames 
explicitly,

in order to access all the elements. e.g.
$ie.frame(:name, 'mainFrame').text_fields.length

There is one more exception, I am not sure whether this is know issues 
or not,
but I had to explicitly address the element I wanted to click on. Again 
its the pages

with multiple frames.
Please find attached the zip containing html pages.

Following is my ruby session with comments:
---
$ie.goto(file://E:/Me/Work/Temp/build/ReLogin.do.htm)
2.093
$ie.frame(:name, 'mainFrame').divs.length
15
$ie.frame(:name, 'mainFrame').div(:text, Add DHCP Server).exists?
true
##exists? says the element is presetn, but clicking it does not help
$ie.frame(:name, 'mainFrame').div(:text, Add DHCP Server).click
##neither it can flash it..just in case I thought it might...
$ie.frame(:name, 'mainFrame').div(:text, Add DHCP Server).flash


##However following method access the expected element correctly
$ie.frame(:name, mainFrame).table(:id, /tblMain/i).cells[1].div(:id, 
'addusers').div(:text, Add DHCP Server).click

Cannot find server or DNS Error
$ie.frame(:name, mainFrame).table(:id, /tblMain/i).cells[1].div(:id, 
'addusers').div(:text, Add DHCP Server).flash

-
I have the work around, but I was expecting following to work.
$ie.frame(:name, mainFrame).div(:text, Add DHCP Server).flash

Thanks and Regards,
Manish

David Schmidt wrote:
Actually, that *is* supported.  However, if you look a sample HTML 
INPUT element from a page I'm scraping you'll find a clue why that 
particular example didn't work:


INPUT  id=SSNEntry_txtSpouseSSN style=\WIDTH: 95px\ value=999 
name=SSNEntry:txtSpouseSSN


For text_fields, the current text in the field is contained in the 
value attribute.  Thus:


ie.text_field( :value, 'xyz' )

Should work for you.

David

  




build.rar
Description: Binary data
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

[Wtr-general] Understanding WATIR

2006-06-14 Thread Manish Sapariya
Hi,
I was wondering how watir maintains and creates the list of controls it 
sees on a page.
I am not sure whether this functionality is directly provided by the 
WebBrowser
control or watir does some magic to get the lists of various controls. 
To illustrate

when I say

ie.tables.each { |t|
do something with each table
}

Does watir create the list of tables and other control when it is 
finished loading a page
or WebBrowser control itself exposes this functionality (I actually 
doubt it?). If WebBrowser
does not expose this functionality, where in watir.rb is the code to 
construct this lists?

I am new to ruby and not very proficient with many ruby features and 
syntax. So please bear with me
if its very obvious in the code.

Thanks and Regards,
Manish

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] watir and html source does not concur

2006-06-12 Thread Manish Sapariya
Hi,
One more question related to this html.

How do I distinguish between the two Add buttons?
Thanks,
Manish


Manish Sapariya wrote:
 Hi,
 Here is one more html.

 --
 $ie.frame(mainFrame).table(:id, /tblMain/i).cells.each { |l|
if l.text_field(:name, hostName).exists? then
puts Flashing input box\n
   l.text_field(:name, hostName).flash
   end
 }
 Flashing input box
 Flashing input box
 Flashing input box
 Flashing input box
 Flashing input box
 0
 -

 irb says it found the field five times, but the html source has it listed
 only once. It however flashesh the same input field.

 Can somebody explain.
 Thanks,
 Manish

 





 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
 htmlhead
 meta http-equiv=Content-Type content=text/html; 
 charset=iso-8859-1titleiManager/title

 link href=styles/c1.css rel=stylesheet type=text/css
 link href=styles/css.css rel=stylesheet type=text/css
 link href=styles/c01.css rel=stylesheet type=text/css
 link href=styles/ddmenu.css rel=stylesheet type=text/css
 link href=styles/temp.css rel=stylesheet type=text/css
 style type=text/css
 .dTree * IMG { border:0; }
 .exampleFormat { color:#003399; }
 .errorFormat { color:#cc; }
 #alias_type_format TT SPAN { background-color:#ECF0F4; padding:0 3px }
 /style
 !-- css styles end --

 script language=javascript var imageUrl =images/; /script
 !-- include js begin --

 script language=javascript src=js/ddmenu/script!-- calendar code ---
 script language=javascript src=js/popcalendar/script
 script language=javascript src=js/listcopyitems.js/script
 script language=javascript src=js/temp.js/script
 script language=javascript src=js/treejs.js/script
 script language=javascript src=js/retreef.js/script
 script language=javascript src=js/dtree.js/script
 script language=javascript
 /*
   label= (match pattern) ^^ [+|-] ^^ (example format)
   + = replace all whitespaces 
 with line break
   - = replace all spaces with 
 single space, keep the linebreaks
 */

 var formatUserInputBox = true;

 function getSelectedItemType(o)
 {
   var selectedIndex = -1;
   var selected = false;
   for(var i=0; io.options.length;i++)
   {
   if(o.options[i].selected) {
   var s = o.options[i];
   
 document.getElementById('alias_selected_item_type').innerHTML = 
 s.value.substring(s.value.indexOf(:)+1).replace(/_/g, );
   break;
   }
   }
   
 }

 function Trim(str)
 {
   var singleSpacing = (Trim.arguments.length==2);
   if(typeof(str)=='object')
   {
if(!str.value) return;
   if(singleSpacing)
   str.value = str.value.replace(/^\s+/g, 
 '').replace(/\s+$/g, '');
   else
   str.value = str.value.replace(/^\s+/g, 
 '').replace(/\s+$/g, '').replace(/ {2,}/g, ' ');
   }
   else
   {
   if(singleSpacing)
   return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
   else
   {
   return str.replace(/^\s+/g, '').replace(/\s+$/g, 
 '').replace(/ {2,}/g, ' ');
   }
   }
 }

 function resetFormatStyle()
 {
   document.getElementById('alias_type_format').className='exampleFormat';
   showFormat(document.getElementById('SELECT_ALIAS_ITEM_TYPE'));
 }

 function testContent(v)
 {
   if (v==null || v.length=='undefined') return false;
   //window.status = v.length;
   var aliastype = document.getElementById(SELECT_ALIAS_ITEM_TYPE);
   var aliastypeInd = aliastype.selectedIndex;
   var ptn = aliastype.options[aliastypeInd].label;
   var ptn = ptn.substring(0, ptn.indexOf( ^^ ));
   var re = new RegExp(ptn, g);

   v = Trim(v);

   if(!v.match(re))
   {
   document.getElementById(alias_type_format).className = 
 errorFormat;
   return false;
   }
   
   return true;
 }

 function showFormat(o)
 {
   var i = o.selectedIndex;
   var s = o.options[i].label;
   var t = s.substring(s.lastIndexOf( ^^ )+4);
   document.getElementById(alias_type_format).innerHTML = 
 example:brtt + unescape(t) + /tt;
   document.forms[0].INPUT_ALIAS_ITEM_LIST.focus();
 }

 function transformAll(strTmp, trans)
 {
   var arr = trans.split(~);
   var evalStr = ;
   for(var i=0; iarr.length; i++)
   {
   evalStr = strTmp=strTmp.replace(+arr[i]+);
   eval(evalStr);
   }
   return strTmp;
 }

 function transformSpaces(str, trans)
 {
   var pattern = ;
   var strTmp = ;
   if(typeof(str)=='object')
   {
   if (str.value) strTmp = str.value;
   }
   else
   strTmp = str;
   var x

[Wtr-general] running multiple ie session with diff user id for same server

2006-06-09 Thread Manish Sapariya
Hi,
Is there any workaround or trick know to run multiple
ie to the same server with different user ids?

I need to run same test simultaneously but with different
user credentials. But when I tried to do it expires one
of the users session.

Thanks and Regards,
Manish

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] frame error in waitreadyState

2006-05-20 Thread Manish Sapariya
This is intermittent problem and not reproducible always. By defaulting 
function I mean

CreateAndScheduleImageSearch function does fail always. I run this function
in loop with multiple arguments. But when I run it again with the single
argument it works fine.

The only change that I make is to run it with single argument for loop.

As it is intermittent problem, could you please suggest if I can turn on
some debugging or something that might help in postmortem.

THanks and Regards,
Manish



On 05/20/2006 11:41 AM, David Schmidt wrote:

Manish,

It's a bit hard to tell exactly what's occurring without seeing the HTML 
or the Watir script involved, but I've seen this type of error before.  
It's a COM error trying to send a command to IE, and from the trace I'd 
guess it was a wait command.  Since it was right after a click I'm 
guessing that perhaps the wait executed at a time when the object state 
wasn't stable.

Could you give us an idea what you were clicking?  Was it in a frame or 
in a popup or just a normal web page?

I'm also not sure what you mean by defaulting function below.  Could 
you explain in more detail what changes you make betwen this working and 
not working?

David

Manish Sapariya wrote:
  

I get following error when I run my script. However when I run script with
the defaulting function alone, it works fine.
Any ideas? Has anyone run into this kind of issue.
Please let me know if you need more details to help.

---
W, [19-May-2005 16:15:24#3268]  WARN -- : frame error in waitreadyState
OLE error code:0 in Unknown
  No Description
HRESULT error code:0x80070005
  Access is denied.
c:/program 
files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.980/./watir.rb:1518:in 
`method_missing'
c:/program 
files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.980/./watir.rb:1518:in `wait'
c:/program 
files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.980/./watir.rb:1517:in `upto'
c:/program 
files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.980/./watir.rb:1517:in `wait'
c:/program 
files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.980/./watir.rb:293:in `wait'
c:/program 
files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.980/./watir.rb:2302:in `click'
iManager.rb:151:in `CreateImageSearch'
iManager.rb:346:in `CreateAndScheduleImageSearch'
iManager.rb:343:in `each'
iManager.rb:343:in `CreateAndScheduleImageSearch'
iManager.rb:750
c:/program 
files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.980/./watir.rb:2156:in 
`assert_exists': Unable to locate object, using text and Images 
(Watir::Exception::UnknownObjectException)
from c:/program 
files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.980/./watir.rb:2297:in `click'
from iManager.rb:152:in `CreateImageSearch'
from iManager.rb:346:in `CreateAndScheduleImageSearch'
from iManager.rb:343:in `each'
from iManager.rb:343:in `CreateAndScheduleImageSearch'
from iManager.rb:750
 Exit code: 1


Thanks and Regards,
Manish
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
  




___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
  


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] frame error in waitreadyState

2006-05-20 Thread Manish Sapariya
I will try latest code from svn. I am seeing some other intermitten 
failures as well,
which I am not sure is in my script or watir code. Will keep eye on it.
Are there any tools that I can use to keep eye on such intermittent 
problems.

Thanks and Regards,
Manish

On 05/20/2006 12:01 PM, Bret Pettichord wrote:

 On 5/20/06, *Manish Sapariya* [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:

 W, [19-May-2005 16:15:24#3268]  WARN -- : frame error in
 waitreadyState
OLE error code:0 in Unknown
  No Description
HRESULT error code:0x80070005
  Access is denied.
 c:/program
 files/ruby/lib/ruby/gems/1.8
 /gems/watir-1.5.0.980/./watir.rb:1518:in
 `method_missing'
 c:/program
 files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.980/./watir.rb:1518:in
 `wait'
 c:/program
 files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.980/./watir.rb:1517:in
 `upto'
 c:/program
 files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.980/./watir.rb:1517:in
 `wait'
 c:/program
 files/ruby/lib/ruby/gems/1.8/gems/watir-
 1.5.0.980/./watir.rb:293:in `wait'


 It's possible that this is an error that was fixed just the other day.
 http://svn.openqa.org/fisheye/changelog/~br=trunk/watir?cs=1002 
 http://svn.openqa.org/fisheye/changelog/%7Ebr=trunk/watir?cs=1002



___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] need help clicking on one of the links with same name

2006-05-19 Thread Manish Sapariya
Hi Mark,
Thanks for the help.
But I am curious why my solution did not work.
Why watir saw what even IEs developement toolbar can't show me.

Thanks any way.
Regards,
Manish


On 05/18/2006 11:41 PM, Cain, Mark wrote:

 This should work for you as long as ‘searchName’ is whatever is listed 
 in the column name Search Name from your html file you sent.

 The html you sent didn’t have a ‘mainFrame’ in it so I hope you full 
 page does otherwise you will need to remove it from the script below.

 This script will loop through all rows, and walk all cells for that 
 row—‘i’—and try and match ‘searchName’ to each respective cell value 
 in that row. If it finds a match then the ‘schedule’ link is clicked 
 for that row an away you go.

 i = 1

 row_count = $ie.frame(mainFrame).table(:id, 'ruleTbl').row_count

 while i = row_count

 $ie.frame(mainFrame).table(:id, /ruleTbl/i)[i].cells.each { |l|

 puts *\n

 puts \n#{l.to_s} = #{i}\n

 puts *\n

 if l.to_s =~ /#{searchName}/ then

 # this if line is not needed

 # if l.to_s =~ /schedule/ then

 puts ###\n

 print l.to_s

 puts \n#{i}i\n

 puts ###\n

 $ie.frame(mainFrame).table(:id, 'ruleTbl')[i][7].link(:text, 
 /schedule/i).click

 break;

 # end

 End

 }

 i = i + 1

 end

 Hope this helps,

 --Mark

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Manish Sapariya
 Sent: Thursday, May 18, 2006 4:58 AM
 To: wtr-general@rubyforge.org
 Subject: [Wtr-general] need help clicking on one of the links with 
 same name

 Hi,

 Please find attached the html which I need help with.

 It has table of searches which has actions like edit,view,schedule

 attached with them.

 I want to write a method which takes search name and schedules it.

 The logic I have used is:

 ---

 $ie.frame(mainFrame).cells.each { |l|

 i = i +1

 puts *\n

 puts \n#{l.to_s} = #{i}\n

 puts *\n

 if l.to_s =~ /#{searchName}/ then

 if l.to_s =~ /schedule/ then

 puts ###\n

 print l.to_s

 puts \n#{i}i\n

 puts ###\n

 $ie.frame(mainFrame).cell(:index, i).click

 break;

 end

 end

 }

 -

 Travel each cell. When I encounter search name I am looking for,

 I click the schedule link which is encountered next.

 However, one the element that I encounter, I get a element which

 is like concatenation of value elements in all the cells. Hence my test

 condition

 of matching search name hits and I end up clicking wrong element. I dont

 understand why this happens. When I see in the DOM tree using IE Dev 
 toolbar

 is that particular element is having is kind of null value.

 Is there a problem in way my html is formed, or a problem with watir.

 What I expected is each cell element will have text set to value what

 is visible in browser and it will be matter of locating that particular

 element.

 Any ideas.

 Please let me know if you need more info.

 Thanks and Regards,

 Manish



___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general




___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] frame error in waitreadyState

2006-05-19 Thread Manish Sapariya
I get following error when I run my script. However when I run script with
the defaulting function alone, it works fine.
Any ideas? Has anyone run into this kind of issue.
Please let me know if you need more details to help.

---
W, [19-May-2005 16:15:24#3268]  WARN -- : frame error in waitreadyState
OLE error code:0 in Unknown
  No Description
HRESULT error code:0x80070005
  Access is denied.
c:/program 
files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.980/./watir.rb:1518:in 
`method_missing'
c:/program 
files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.980/./watir.rb:1518:in `wait'
c:/program 
files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.980/./watir.rb:1517:in `upto'
c:/program 
files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.980/./watir.rb:1517:in `wait'
c:/program 
files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.980/./watir.rb:293:in `wait'
c:/program 
files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.980/./watir.rb:2302:in `click'
iManager.rb:151:in `CreateImageSearch'
iManager.rb:346:in `CreateAndScheduleImageSearch'
iManager.rb:343:in `each'
iManager.rb:343:in `CreateAndScheduleImageSearch'
iManager.rb:750
c:/program 
files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.980/./watir.rb:2156:in 
`assert_exists': Unable to locate object, using text and Images 
(Watir::Exception::UnknownObjectException)
from c:/program 
files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.0.980/./watir.rb:2297:in `click'
from iManager.rb:152:in `CreateImageSearch'
from iManager.rb:346:in `CreateAndScheduleImageSearch'
from iManager.rb:343:in `each'
from iManager.rb:343:in `CreateAndScheduleImageSearch'
from iManager.rb:750
 Exit code: 1


Thanks and Regards,
Manish
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] need help clicking on one of the links with same name

2006-05-18 Thread Manish Sapariya

Hi,
Please find attached the html which I need help with.
It has table of searches which has actions like edit,view,schedule
attached with them.

I want to write a method which takes search name and schedules it.

The logic I have used is:
---

$ie.frame(mainFrame).cells.each { |l| 
   i = i +1

   puts *\n
   puts \n#{l.to_s} = #{i}\n
   puts *\n
   if l.to_s =~ /#{searchName}/ then
   if l.to_s =~ /schedule/ then
   puts ###\n
   print l.to_s 
   puts \n#{i}i\n

   puts ###\n
   $ie.frame(mainFrame).cell(:index, i).click
   break;
   end
   end
   }
-
Travel each cell. When I encounter search name I am looking for,
I click the schedule link which is encountered next.

However, one the element that I encounter, I get a element which
is like concatenation of value elements in all the cells. Hence my test 
condition

of matching search name hits and I end up clicking wrong element. I dont
understand why this happens. When I see in the DOM tree using IE Dev toolbar
is that particular element is having is kind of null value.

Is there a problem in way my html is formed, or a problem with watir.
What I expected is each cell element will have text set to value what
is visible in browser and it will be matter of locating that particular
element.

Any ideas.
Please let me know if you need more info.
Thanks and Regards,
Manish










html

head
titleSaved Search Policies/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1

link href=/rpm/styles/c1.css rel=stylesheet type=text/css
link href=/rpm/styles/css.css rel=stylesheet type=text/css
link href=/rpm/styles/c01.css rel=stylesheet type=text/css
link href=/rpm/styles/ddmenu.css rel=stylesheet type=text/css
!-- css styles end --

script language=javascript var imageUrl =/rpm/images/; /script
!-- include js begin --
script language=javascript src=/rpm/js/ddmenu/script!-- calendar code 
---
script language=javascript src=/rpm/js/popcalendar/script
script language=javascript src=/rpm/js/listcopyitems.js/script
script language=javascript src=/rpm/js/toggleTable.js/script
script language=JavaScript src=/rpm/js/global.js/script
script language=JavaScript src=/rpm/js/shy.js/script
script language=javascript

window.onLoad = function () {
doShyTags();
shyreflow();
}

window.onResize = function () {
shyreflow();
}


/script
style type=text/css
#mcontent
{
position:absolute;
top:0px;
left:1px;
width:auto;
margin:0;
padding:0;
border:0;
z-index: 0;

}

.newPolicyLink
{

font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:11px;
font-weight:bold;
line-height:20px;
padding:0 8px;
white-space: nowrap;
cursor:pointer;
color:#043A6B;
   text-decoration: underline
}



.lstllbdrw
{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
padding:6px;
vertical-align:middle;

}

.rdata 
{

color:blue;font-size:12px;font-family: Verdana, Arial, Helvetica, 
Sans-serif;
font-weight:bold;
vertical-align:middle;

}

.rc-ul
{
   text-decoration:none;
   color:#00;
   font-size:12px;
   vertical-align:bottom;
}


/style
/head
body onload=javascript:initPage();setRows('topTbl');

div id=mcontent
  div class=navbg style=padding-left:15pxstrongConfigure Policies 
/strong/div
   divnbsp;/div
  !--  BEGIN : CREATE NEW POLICY/RULE LINKS SECTION ***--
   table  width=100%  border=0 cellspacing=0 cellpadding=0
  tr
td width=100% valign=top id=mCol
table width=100%  border=0 cellpadding=0 cellspacing=0
 tr
  
  td width=15% class=newPolicyLink 
onClick=location.href='/rpm/RePreCreateSearchPolicy.do?methodToCall=preCreateSearchPolicy'Create
 New Policy/td
  
 
  td width=15% class=newPolicyLink 
onClick=location.href='/rpm/ReCreateSearchDoc.do'Create New Rule/td
 
 tdnbsp;/td
   /tr
 /table
 !--  END : CREATE NEW POLICY/RULE LINKS SECTION ***--
 


 table width=100%  border=0 cellspacing=10 cellpadding=0 id=topTbl
trtd id=mainspacediv class=navbg style=margin:25px 10px 
6px 0img src=/rpm/images/togglecollapse.gif 
onClick=collapseAll(this,'TD','imgtblcollapse');doShyTags();shyreflow(); 
align=absmiddle width=20 height=20 style=border:1px solid #ccc 
nbsp;nbsp;nbsp; strongView All Policies/strong/div
!--  **  BEGIN : Policy/Rules DISPLAY *** --

   
  !-- **  BEGIN :POLICY NAME / OWNER / EDIT /SCHEDULE ***  
--
  div id=groupedtbls
   div class=rc-ul style=margin:25px 10px 6px 

[Wtr-general] Clicking on the link in table

2006-05-17 Thread Manish Sapariya

Hi,
In the attached html code, I have two tables in 2nd Frame.

There is a link in first table Create New Policy. I cannot
click on this link by

$ie.frame(mainFrame).link(:text,Create New Policy).click.

However, the link in 2nd table can be clicked when I say

$ie.frame(mainFrame).link(:text, edit).click

I am not a web-developer, but only difference I noticed that
the second link is enclosed in a /a tag, whereas the first
one is not.

Any ideas?

Thanks and Regards,
Manish











html

head
titleSaved Search Policies/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1

link href=/rpm/styles/c1.css rel=stylesheet type=text/css
link href=/rpm/styles/css.css rel=stylesheet type=text/css
link href=/rpm/styles/c01.css rel=stylesheet type=text/css
link href=/rpm/styles/ddmenu.css rel=stylesheet type=text/css
!-- css styles end --

script language=javascript var imageUrl =/rpm/images/; /script
!-- include js begin --
script language=javascript src=/rpm/js/ddmenu/script!-- calendar code 
---
script language=javascript src=/rpm/js/popcalendar/script
script language=javascript src=/rpm/js/listcopyitems.js/script
script language=javascript src=/rpm/js/toggleTable.js/script
script language=JavaScript src=/rpm/js/global.js/script
script language=JavaScript src=/rpm/js/shy.js/script
script language=javascript

window.onLoad = function () {
doShyTags();
shyreflow();
}

window.onResize = function () {
shyreflow();
}


/script
style type=text/css
#mcontent
{
position:absolute;
top:0px;
left:1px;
width:auto;
margin:0;
padding:0;
border:0;
z-index: 0;

}

.newPolicyLink
{

font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:11px;
font-weight:bold;
line-height:20px;
padding:0 8px;
white-space: nowrap;
cursor:pointer;
color:#043A6B;
   text-decoration: underline
}



.lstllbdrw
{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
padding:6px;
vertical-align:middle;

}

.rdata 
{

color:blue;font-size:12px;font-family: Verdana, Arial, Helvetica, 
Sans-serif;
font-weight:bold;
vertical-align:middle;

}

.rc-ul
{
   text-decoration:none;
   color:#00;
   font-size:12px;
   vertical-align:bottom;
}


/style
/head
body onload=javascript:initPage();setRows('topTbl');

div id=mcontent
  div class=navbg style=padding-left:15pxstrongConfigure Policies 
/strong/div
   divnbsp;/div
  !--  BEGIN : CREATE NEW POLICY/RULE LINKS SECTION ***--
   table  width=100%  border=0 cellspacing=0 cellpadding=0
  tr
td width=100% valign=top id=mCol
table width=100%  border=0 cellpadding=0 cellspacing=0
 tr
  
  td width=15% class=newPolicyLink 
onClick=location.href='/rpm/RePreCreateSearchPolicy.do?methodToCall=preCreateSearchPolicy'Create
 New Policy/td
  
 
  td width=15% class=newPolicyLink 
onClick=location.href='/rpm/ReCreateSearchDoc.do'Create New Rule/td
 
 tdnbsp;/td
   /tr
 /table
 !--  END : CREATE NEW POLICY/RULE LINKS SECTION ***--
 


 table width=100%  border=0 cellspacing=10 cellpadding=0 id=topTbl
trtd id=mainspacediv class=navbg style=margin:25px 10px 
6px 0img src=/rpm/images/togglecollapse.gif 
onClick=collapseAll(this,'TD','imgtblcollapse');doShyTags();shyreflow(); 
align=absmiddle width=20 height=20 style=border:1px solid #ccc 
nbsp;nbsp;nbsp; strongView All Policies/strong/div
!--  **  BEGIN : Policy/Rules DISPLAY *** --

   
  !-- **  BEGIN :POLICY NAME / OWNER / EDIT /SCHEDULE ***  
--
  div id=groupedtbls
   div class=rc-ul style=margin:25px 10px 6px 0img 
 id=imgtblcollapse src=/rpm/images/arrow-right.gif 
srcExpanded=/rpm/images/arrow-down.gif 
srcCollapsed=/rpm/images/arrow-right.gif 
 width=19 height=19 align=absmiddle 
onClick=hideTables(this, 
true);doShyTags();shyreflow();strongManishnbsp;nbsp;/stronga 
href=/rpm/RePreModifySearchPolicy.do?methodToCall=preModifySearchPolicyamp;policyName=admin%5CManish
 style=color:blue; 
class=rdataedit/absmallnbsp;nbsp;nbsp;Owner:nbsp;adminnbsp;/smallnbsp;
   /b

  
 

   a 
href=/rpm/RePolicySchedule.do?methodToCall=schedulePolicyreadonly=falseamp;policyName=admin%5CManish
 style=color:blue; class=rdataschedule/a

 
/div
   !-- **  END :POLICY NAME / OWNER / EDIT /SCHEDULE ***  --
   
table id=ruleTbl width=100%  border=0 cellpadding=0 
cellspacing=0 bgcolor=#B8C7D1 

Re: [Wtr-general] Clicking on the link in table

2006-05-17 Thread Manish Sapariya



Hi Bret,
Thanks it worked fine.
Regards,
Manish



From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Bret 
PettichordSent: Wednesday, May 17, 2006 7:50 PMTo: 
wtr-general@rubyforge.orgSubject: Re: [Wtr-general] Clicking on the 
link in table
Manish,You are correct, the a/a tags are what 
make it a link.Using Watir 1.5, this will work: 
$ie.frame("mainFrame").cell(:text,"Create New Policy).clickBret
On 5/17/06, Manish 
Sapariya [EMAIL PROTECTED] wrote:
Hi,In 
  the attached html code, I have two tables in 2nd Frame.There is a link 
  in first table "Create New Policy". I cannotclick on this link 
  by$ie.frame("mainFrame").link(:text,"Create New Policy).click. 
  However, the link in 2nd table can be clicked when I 
  say$ie.frame("mainFrame").link(:text, "edit").clickI am not a 
  web-developer, but only difference I noticed thatthe second link is 
  enclosed in a /a tag, whereas the first one is 
  not.Any ideas?Thanks and 
  Regards,ManishhtmlheadtitleSaved 
  Search 
  Policies/titlemeta 
  http-equiv="Content-Type" content="text/html; 
  charset=iso-8859-1"link href="" 
  rel="stylesheet" type="text/css"link href="" 
  rel="stylesheet" type="text/css" link href="" 
  rel="stylesheet" type="text/css"link href="" 
  rel="stylesheet" type="text/css"!-- css styles end -- 
  script language="_javascript_" var imageUrl ="/rpm/images/"; 
  /script!-- include js begin --script 
  language="_javascript_" src=""/script!-- calendar 
  code --- script language="_javascript_" 
  src=""/scriptscript 
  language="_javascript_" 
  src=""/scriptscript 
  language="_javascript_" src=""/script 
  script language="_javascript_" 
  src=""/scriptscript language="_javascript_" 
  src=""/scriptscript 
  language="_javascript_" window. () 
  {doShyTags();shyreflow();}window. () 
  {shyreflow();}/scriptstyle 
  type="text/css" 
  #mcontent{position:absolute;top:0px;left:1px;width:auto;margin:0;padding:0;border:0;z-index: 
  0;}.newPolicyLink 
  {font-family:Verdana, 
  Arial, Helvetica, 
  sans-serif;font-size:11px;font-weight:bold;line-height:20px;padding:0 
  8px;white-space: 
  nowrap;cursor:pointer; 
  color:#043A6B; 
  text-decoration: 
  underline}.lstllbdrw{font-family:Verdana, 
  Arial, Helvetica, 
  sans-serif;font-size:10px;padding:6px;vertical-align:middle; 
  }.rdata{color:blue;font-size:12px;font-family: 
  Verdana, Arial, Helvetica, 
  Sans-serif;font-weight:bold;vertical-align:middle;}.rc-ul{ 
  text-decoration:none;  color:#00; 
  font-size:12px; 
  vertical-align:bottom;}/style/headbody 
  div 
  id="mcontent" div class="navbg" 
  style="padding-left:15px"strongConfigure Policies 
  /strong/div 
  divnbsp;/div!--  BEGIN : CREATE 
  NEW POLICY/RULE LINKS SECTION ***--  
  tablewidth="100%"border="0" cellspacing="0" 
  cellpadding="0"trtd 
  width="100%" valign="top" id="mCol" 
  table 
  width="100%"border="0" cellpadding="0" 
  cellspacing="0" 
  trtd 
  width="15%" class="newPolicyLink" Create 
  New 
  Policy/tdtd 
  width="15%" class="newPolicyLink" 
  Create New 
  Rule/td 
  tdnbsp;/td 
  /tr/table!--  END : CREATE NEW POLICY/RULE 
  LINKS SECTION ***--table 
  width="100%"border="0" cellspacing="10" cellpadding="0" 
  id="topTbl" 
  trtd 
  id="mainspace"div class="navbg" style="margin:25px 10px 6px 
  0"img src="" 
   
  align="absmiddle" width="20" height="20" style="border:1px solid #ccc" 
  nbsp;nbsp;nbsp; strongView All 
  Policies/strong/div 
  !--**BEGIN 
  : Policy/Rules DISPLAY *** 
  --!-- 
  **BEGIN :POLICY NAME / OWNER / EDIT /SCHEDULE 
  ***--div 
  id="groupedtbls" 
   
  div class="rc-ul" style="margin:25px 10px 6px 
  0"img 
  id="imgtblcollapse" src="" 
  srcExpanded="/rpm/images/arrow- down.gif" 
  srcCollapsed="/rpm/images/arrow-right.gif" 
  width="19" height="19" align="absmiddle" strongManishnbsp;nbsp;/stronga 
  href="" 
  style="color:blue;" 
  class="rdata"edit/absmallnbsp;nbsp;nbsp;Owner:nbsp;adminnbsp;/smallnbsp; 
   
  /b 
  a 
  href="" 
  style="color:blue;" class="rdata"schedule/a 
  /div 
  !-- **END :POLICY NAME / OWNER / EDIT /SCHEDULE 
  ***--table 
  id="ruleTbl" width="100%"bord

[Wtr-general] running ruby developement branch code when 1.4.1 is also installed

2006-03-27 Thread Manish Sapariya
There was thread but I cant find it in archives...
Could somebody please tell me how do I run code checkout
from SVN
I am not sure what Path varibale i need to change...

Thanks,
Manish


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] multiple mails for a post

2006-02-24 Thread Manish Sapariya
No, I use thunderbird.
Its just last two days I started recieving multiple mails.
Regards,
Manish


On 02/24/2006 01:23 PM, Zeljko Filipin wrote:

No. Are you using Outlook?
On 2/24/06, Manish Sapariya [EMAIL PROTECTED] wrote: Is everybody getting 
multiple mails for one post like me? Thanks, Manish 
___ Wtr-general mailing list 
Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general

--http://www.testingreflections.com/blog/3071http://iskusivac.blog.hr/
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

  


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] multiple mails for a post

2006-02-24 Thread Manish Sapariya
I believe its not filter issue, may be my mail server posting me multiple
copies. But for all other mails I am receving only single mails. Thats
why I thought something wrong with the list server.

Thanks anywas for the help.
Regards,
Manish

On 02/24/2006 04:07 PM, Zeljko Filipin wrote:

I do not know for thunderbird, but I had similar problem with outlook.I made 
some rules for sorting e-mails in folders, and by mistakedoubled one, so I 
started receiving double mails. I fixed it - deletedall rules (and started 
using gmail). I do not know if this helps, orif thunderbird even has rules for 
sorting.
On 2/24/06, Manish Sapariya [EMAIL PROTECTED] wrote: No, I use 
thunderbird. Its just last two days I started recieving multiple mails. 
Regards, Manish
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

  


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] multiple mails for a post

2006-02-23 Thread Manish Sapariya
Is everybody getting multiple mails for one post like me?
Thanks,
Manish

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] how to access links in table cells

2006-02-18 Thread Manish Sapariya

Hi,
Please find attached html and my watir code.
I could get the flash working on the link, but
when i click the link it actually deletes other entries.

Is there a better way than what I am doing?

Thanks and Regards,
Manish


On 02/17/2006 10:10 AM, Bret Pettichord wrote:


Please provide html and code.

On 2/16/06, *Manish Sapariya* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


Hi,
I have a table, which has few columns with simple
text and few columns with links.

I want to do a search on text columns, and click in
the link for one of the column for a given row.

I can search the row successfully using text, but
I can't click on that row.

When I check the class of the row[i].class, it
shows as TableCell.
How do I click link object in that particular
cell.

THanks for help.
REgards,
Manish

___
Wtr-general mailing list
Wtr-general@rubyforge.org mailto:Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general




___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general



Title: Saved Searches















while (true)

if($ie.frame(mainFrame).table(:id, 
'nav-menu').exists? )
puts I found the table
end
searchExists=0
i=3
t = $ie.frame(mainFrame).table(:id, 'nav-menu')
t.each do |row|
puts iterating #{i} row
#puts search Name = #{searchName}
#puts 11th Column = #{row[11].text}
#puts 3rd Column = #{row[3].text}

puts 8th Column = #{row[8].text}

if (row[8].text == deschedule )
  puts This is scheduled
 # i = i + 1
end
i = i + 4
if (row[3].text =~ /#{searchName}/ )
searchExist=1
puts Search Name = 
#{row[3].text}
puts 11th Column = 
#{row[11].text}
p row[11].class
p row[11].methods
row[11].click

$ie.frame(mainFrame).link(:index, i).flash

$ie.frame(mainFrame).link(:index, i).flash

$ie.frame(mainFrame).link(:index, i).click
break;
end
end

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

[Wtr-general] watir: windows and unix

2006-01-31 Thread Manish Sapariya
Hi List,
I need to login to unix box and carry out some task before proceding
with my test.

I could find rexpect module but it seems that works only on
*nix and not on windows.

I am not sure whether rexpect can work on windows. Can somebody
confirm? If rexpect is not the way, what would be solution
for login on to unix box and run some scripts there?

I also tried using cygwin on windows, but I am not sure how can
I run my watir scripts on cygwin along with rexpect?

Is this possible?

Any help in this regard will be appreciated.
Thanks and Regards,
Manish
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] HTML Results Reports for Watir

2005-11-25 Thread Manish Sapariya
I tried installing and running damagecontrol, but it crashes. I am no
Ruby expert and could not figure out whats exactly wrong?

Anywasy,
Is project alive?
The project does n't have active mailing list. No messages since April.

Has anybody working installation, I wanted to try out to see how
I can automate our build process. From the documents it looks very
promising.

Thanks and Regards,
Manish

On 11/24/2005 09:51 PM, Owen Rogers wrote:

On 24/11/05, Jose Papo [EMAIL PROTECTED] wrote:
  

 The problem with this is the need to run .NET Framework and install
another tool for it to work. Do you or someone else know how to do it only
with Watir and an open source CI Tool ?



you might want to try out damagecontrol: http://hieraki.lavalamp.ca/read/book/3
it's a ruby-based open source CI tool.  i don't know if it supports
watir directly, but i imagine that it would be pretty straightforward
to add it.
cheers,
owen.
--
Owen Rogers | http://dotnetjunkies.com/weblog/exortech |
CruiseControl.NET - http://ccnet.thoughtworks.com

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

  


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Can watir be used to drive gmail....

2005-11-17 Thread Manish Sapariya
Could you please more info on this.
How does exactly mouse over event will be generated.
I dont see any of the links seen in view source file.
When I do show_all_objects it hardly gives me any object info.
What are other javascript event?

Thanks for all help.
Manish


On 11/16/2005 09:36 PM, Jeff Wood wrote:

 It works, you just have to learn how to get around ... alot of ajax 
 stuff gets initialized when a mouse over or other javascript event 
 happens.

 j.

 On 11/16/05, *Zeljko Filipin* [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:

 http://googleblog.blogspot.com/2005/10/guess-what-just-turned-34.html

 More about gmail.

 Zeljko

 -Original Message-
 From: [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]] On Behalf Of smanish
 Sent: Wednesday, November 16, 2005 10:32 AM
 To: wtr-general@rubyforge.org mailto:wtr-general@rubyforge.org
 Subject: Re: [Wtr-general] Can watir be used to drive gmail

 Hey thanks for the solution.
 It works. But why it does not work with default gmail interface?

 Regards,
 Manish


 On 11/16/2005 02:34 PM, Zeljko Filipin wrote:

 I just tried it too, and it really does not work.
 Solution: log in, go to http://mail.google.com/mail/h/ and you
 will be
 switched to basic HTML and watir will work.
 
 Zeljko
 
 -Original Message-
 From: [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]] On Behalf Of smanish
 Sent: Wednesday, November 16, 2005 7:54 AM
 To: wtr-general@rubyforge.org mailto:wtr-general@rubyforge.org
 Subject: [Wtr-general] Can watir be used to drive gmail
 
 I tried and after logging in...
 I was simply lost
 
 Any clues??
 Has any one used watir successfully to drive gmail?
 
 Thanks and Regards,
 Manish
 
 
 
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org mailto:Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general
 
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org mailto:Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general
 http://rubyforge.org/mailman/listinfo/wtr-general
 
 
 

 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org mailto:Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org mailto:Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general




 -- 
 Remember. Understand. Believe. Yield! - http://ruby-lang.org;

 Jeff Wood



___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
  


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] watir exception...

2005-11-16 Thread Manish Sapariya
Nope,
I still get the same error.
Note that script runs fine.only at the end it throws this error.
Regards,
Manish


On 11/16/2005 03:21 PM, Sathya Shankar wrote:

Hi 

[a href=/ym/Logout?YY=77101YY=77101 target=_topSign Out/a,

Here the , seems to be causing the problem.  So in your script you can 
either use the , in your script or the regular expressions
Then the script would look like 
ie=IE.attach(:title, /.*Yahoo.*/)
ie.link(:text, /.*Sign Out.*/).click
ie.close()
The above script worked for me.



smanish wrote:

  

Hi,
I have following simple scriptbut at the end of executiong..
I get exception as bellow

W, [16-Nov-2005 12:40:52#7832]  WARN -- : frame error in waitdocument
   OLE error code:80070005 in Unknown
 Access is denied.
   HRESULT error code:0x80020009
 Exception occurred.
c:/program files/ruby/lib/ruby/site_ruby/1.8/watir.rb:1405:in 
`method_missing'
c:/program files/ruby/lib/ruby/site_ruby/1.8/watir.rb:1405:in `wait'
c:/program files/ruby/lib/ruby/site_ruby/1.8/watir.rb:1404:in `upto'
c:/program files/ruby/lib/ruby/site_ruby/1.8/watir.rb:1404:in `wait'
c:/program files/ruby/lib/ruby/site_ruby/1.8/watir.rb:2014:in `click'
yahoomail.rb:10
c:/program files/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in 
`assert_exists': Unable to locate object, using text and Sign out 
(Watir::Exception::UnknownObjectException)
   from c:/program 
files/ruby/lib/ruby/site_ruby/1.8/watir.rb:2009:in `click'
   from yahoomail.rb:13
 



Exit code: 1
   

  

-
require 'watir'   # the watir controller
# open the IE browser
$ie = Watir::IE.new
$ie.set_fast_speed()
test_site=http://mail.yahoo.com/;
$ie.goto(test_site)
$ie.text_field(:name, login).set(abc)   
$ie.text_field(:id, passwd).set(xyz)
$ie.button(:value, Sign In).click
$ie.show_all_objects
$ie.link(:text, Sign out).click
$ie.close

Any ideas??
Thanks,
Manish

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
 





  


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Security Popup Windows

2005-10-28 Thread Manish Sapariya
Here is how got read of my dialog box

Main script-
# set a variable
def execute_and_click_dialog(extra_file, block)
Thread.new { system(rubyw 
\#{$mydir}\\#{extra_file}.rb\) }
block.call
end

$ie=Watir::IE.new
..
..
..
execute_and_click_dialog('DialogPressHelper'){ 
$ie.frame(mainFrame).link(:index,i).click}
..
..
..
-Main script ends--
Helper script follows...this is nothing bug copy of is just renamed 
jscriptExtraAlert.rb
to make my script more redable...
-DialogPressHelper.rb-
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__

require 'watir/WindowHelper'

helper = WindowHelper.new
helper.push_alert_button()
--DialogPressHelper.rbends--


Check out push_security_alert_yes() in WindowsHelper.rb in Watir
sources for exact solution to you problem.

Hope this helps.

Regards,
Manish



On 10/29/2005 04:44 AM, Dale Herrig wrote:

 Forum,
  
 I have a scenario where a security alert dialog box pops up and I need 
 to select the yes button. I have not been able to figure out a way to 
 select these the buttons in these security alert dialogs. Does anybody 
 now how this might be accomplished.
  
 Thanks
  
  




___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] clicking on link with same name

2005-10-25 Thread Manish Sapariya
Hi list,

I have a app which has multiple links on same page with same
name. However each of this link is associated with one more
link which identifies them uniquely. To be very specific its
the page has list of records which I can edit or delete. The
links for edit/delete have same name, but they are assciated
with record name.

Currently I have hacked way as following.
So I delete the record its name is/or like manish.


---
i = 0
ie.frame(mainFrame).links.each { |l|
i = i +1
if l.to_s =~ /manish/ then
if l.to_s =~ /delete/ then
print l.to_s
puts \n#{i}i\n
ie.frame(mainFrame).link(:index, i).click
break;
end


end
}
---

Is there a cleaner solution?

Thanks and Regards,
Manish
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Handling popup window

2005-10-25 Thread Manish Sapariya
I couldn't get away with the dialog box popped up by my application.

I tried autoit but could not get it working. Even tried simple send_keys()
function but was not sure whether it was sending the key event to right 
window.

The dialog box is not javascript dialog. Developer says it is dialog
popped up by IE using confirm() as shown below.


---HTML Source--

span class=pageNums onMouseOver=this.className='pageNumsSel' 
onMouseOut=this.className='pageNums'
a 
href=/analyst/ReShowSearchList.do?methodToCall=removeSearchamp;searchName=admin%5Cmanish_SMTP
 
onclick=return confirm('Delete this saved search?');delete/a
/span
---HTML Source--

Any suggestions??
Thanks,
Manish
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general