[wtr-general] Re: Need a sample code to import test data from Excel sheet

2009-08-11 Thread Smruti Ranjan Kar
require 'win32ole'

$application = WIN32OLE.new('Excel.Application')
generalworksheet=$application.Workbooks.Open(Dir.getwd+\\Testdata\\testdata.xls).Worksheets(General)
generalworksheet.Activate
$test_site=generalworksheet.Cells(6,2).value

On Tue, Aug 11, 2009 at 1:14 PM, zakir hussain zaki...@gmail.com wrote:

 Hi,

 I wud like to post in this group. Kindly add me in this chain


 Thanks

 zakir


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Issue with a PopUP and Click_No_Wait

2009-08-09 Thread Smruti Ranjan Kar
Hi Pallavi,

That click_no_wait worked fine for me.
Just check your Ruby version. (click_no_wait does not work with
ruby186-27_rc2: known defect)

I am using Ruby186-26_Watir1.6.2

On Sun, Aug 9, 2009 at 1:28 PM, Pallavi Sharma write2pall...@gmail.comwrote:

 Hi

 Need some urgent help:

 Go to link:
 https://www.kaplanprofessional.edu.au/smartforms/courseonline.asp

 1. Click on New Student
 2. Fill in Mandatory details
 3. Click Next
 4. Chose Financial Planning
 5. Click Next
 6. Chose first option in both select lists
 7. Select radio button Distance Eductaion
 8. Click on Add Subject
 9. Click Next and a popup will appear.


 Now, when i use click_no_wait  with the NEXT button it doesn't shows
 the Pop UP

 When i use Click with the NEXT button it holds coz now the pop up
 appears.


 Can anyone here please tell me how to proceed with the scenario.

 Thanks

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: How to judge the button or link exists in the page?

2009-08-07 Thread Smruti Ranjan Kar
assert($browser.link(:text,Signout)exists?),The sign-out link is absent)

On Fri, Aug 7, 2009 at 2:25 PM, yuping zhong littlezhong...@gmail.comwrote:

 Dear all,
 Right now, I want to use the watir to check the button or link if exists in
 the page. Who can help me?

 Such as, I write the watir code to login the gmail. In order to make sure I
 login successfully, I try to check whether the Sign Out link is exists in
 the page.
 If the Sign Out link is exists,puts login successfully,else puts login
 failure.

 But how to write the code? It is easy If check the TEXT in the page, what
 should I do about the LINK or BUTTON?

 Thanks for anyone replys.

 Best Wishes!

 -Zhong

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: How to judge the button or link exists in the page?

2009-08-07 Thread Smruti Ranjan Kar
And what you need will be:

assert($browser.link(:text,Signout)exists?),login failure)
puts Login was successful

On Fri, Aug 7, 2009 at 2:29 PM, Smruti Ranjan Kar 
smrutiranjan@gmail.com wrote:

 assert($browser.link(:text,Signout)exists?),The sign-out link is
 absent)


 On Fri, Aug 7, 2009 at 2:25 PM, yuping zhong littlezhong...@gmail.comwrote:

 Dear all,
 Right now, I want to use the watir to check the button or link if exists
 in the page. Who can help me?

 Such as, I write the watir code to login the gmail. In order to make sure
 I login successfully, I try to check whether the Sign Out link is exists
 in the page.
 If the Sign Out link is exists,puts login successfully,else puts
 login failure.

 But how to write the code? It is easy If check the TEXT in the page, what
 should I do about the LINK or BUTTON?

 Thanks for anyone replys.

 Best Wishes!

 -Zhong

 



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: undefined method `{ENTER}' for #Watir::IE:0x3ee7b9c

2009-08-07 Thread Smruti Ranjan Kar
use
$ie.send_keys({ENTER})

On Fri, Aug 7, 2009 at 2:33 PM, Marlon marlonmoja...@gmail.com wrote:


 Can anyone help me with this error? I'm trying to press ENTER key
 focused on a text box.

 code:
 $ie.send({ENTER})
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: clicking ok on popups

2009-08-04 Thread Smruti Ranjan Kar
If I'm getting you, is this the requirement ?

- You click 'Proceed', Popup A appears
- Click 'OK', Popup B appears
- Click 'OK', New browser opens with a popup
- Click 'OK'
- Click 'Save'
- Click 'OK' on the confirmation

And what are the type of pop-ups at different steps ? i.e: modal, JS, new
browser
On Tue, Aug 4, 2009 at 5:15 PM, rs77 rishaind...@gmail.com wrote:


 I am new to Watir
 1. I have an HTML page with fields,
 2. When I click Proceed button
 3. I get 2 consecutive alert popups with OK button
 4. after clicking 'OK' on both of them another IE browser window pops
 up
 5. with another alert popup, which I click OK
 6. Click Save button on the newly opened browser window
 7. another confirmation Browser window is opened, which has a form in
 it and OK button,

 and trying to automate clicking the ok buttons using the methods
 described at
 http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups

 successfully click OK butto at step 5 only!!!

 Could anybody help with how can i accomplish clicking ok buttons on
 step 4 and step 7?

 Thanks
 RS

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: concurrent problems in pop ups

2009-08-04 Thread Smruti Ranjan Kar
Either use

require 'watir/contrib/enabled_popup'
and
hwnd1 = browser.enabled_popup(5)

Or use AutoITand WinGetHandle method


On Tue, Aug 4, 2009 at 7:55 PM, Vale vsant...@gmail.com wrote:


 Hello everyone Im new at ruby/watir and im trying to do a performance
 test.
 To do this I have to run a lot of script concurrently.
 My problem is:
 when I do
 ie.link(:url,the url).click
 this opens a pop up, but how do I now which pop up has open this
 instance?

 if I do

 iePopUp = Watir::IE.attach(:title,titulo de la pagina)

 then iePopUp is attached to any of the pages opened concurrently and
 sometimes two or more attach to the same!!

 I've seen that I can use attach with hwnd, but how can  I know the
 hwnd of the
 ie.link(:url,the url).click ?

 thanks a lot in advice!
 valeria santini
 Uruguay

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: concurrent problems in pop ups

2009-08-04 Thread Smruti Ranjan Kar
Try click_no_wait instead of click.

On Tue, Aug 4, 2009 at 9:17 PM, Valeria vsant...@gmail.com wrote:

 May be its important to say that the windows are not modal

 2009/8/4 Valeria vsant...@gmail.com

 Thanks a lot Smruti but I try use:

 require 'watir/contrib/enabled_popup'

 
hwnd1 = $ie.enabled_popup(10)
 $ie.link(:url, the url).click
   

 and I get this error message:

 Timed out after 10.5 seconds

 what can i do?
 thks
 valeria

 pd.:  same error if I put:
 $ie.link(:url, the url).click
 hwnd1 = $ie.enabled_popup(10)



 2009/8/4 Smruti Ranjan Kar smrutiranjan@gmail.com

 Either use

 require 'watir/contrib/enabled_popup'


 and
 hwnd1 = browser.enabled_popup(5)

 Or use AutoITand WinGetHandle method


 On Tue, Aug 4, 2009 at 7:55 PM, Vale vsant...@gmail.com wrote:


 Hello everyone Im new at ruby/watir and im trying to do a performance
 test.
 To do this I have to run a lot of script concurrently.
 My problem is:
 when I do
 ie.link(:url,the url).click
 this opens a pop up, but how do I now which pop up has open this
 instance?

 if I do

 iePopUp = Watir::IE.attach(:title,titulo de la pagina)

 then iePopUp is attached to any of the pages opened concurrently and
 sometimes two or more attach to the same!!

 I've seen that I can use attach with hwnd, but how can  I know the
 hwnd of the
 ie.link(:url,the url).click ?

 thanks a lot in advice!
 valeria santini
 Uruguay








 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: concurrent problems in pop ups

2009-08-04 Thread Smruti Ranjan Kar
Can you elaborate the problem a little more, may be some screenshots, so
that I can have an idea about what you are trying to do.

On Tue, Aug 4, 2009 at 11:05 PM, Valeria vsant...@gmail.com wrote:

 I tried it, but I got same result :(
 I dont know what else can i do...


 2009/8/4 Smruti Ranjan Kar smrutiranjan@gmail.com

 Try click_no_wait instead of click.

 On Tue, Aug 4, 2009 at 9:17 PM, Valeria vsant...@gmail.com wrote:

 May be its important to say that the windows are not modal

 2009/8/4 Valeria vsant...@gmail.com

 Thanks a lot Smruti but I try use:

 require 'watir/contrib/enabled_popup'

 
hwnd1 = $ie.enabled_popup(10)
 $ie.link(:url, the url).click
   

 and I get this error message:

 Timed out after 10.5 seconds

 what can i do?
 thks
 valeria

 pd.:  same error if I put:
 $ie.link(:url, the url).click
 hwnd1 = $ie.enabled_popup(10)



 2009/8/4 Smruti Ranjan Kar smrutiranjan@gmail.com

 Either use

 require 'watir/contrib/enabled_popup'




 and
 hwnd1 = browser.enabled_popup(5)

 Or use AutoITand WinGetHandle method


 On Tue, Aug 4, 2009 at 7:55 PM, Vale vsant...@gmail.com wrote:


 Hello everyone Im new at ruby/watir and im trying to do a performance
 test.
 To do this I have to run a lot of script concurrently.
 My problem is:
 when I do
 ie.link(:url,the url).click
 this opens a pop up, but how do I now which pop up has open this
 instance?

 if I do

 iePopUp = Watir::IE.attach(:title,titulo de la pagina)

 then iePopUp is attached to any of the pages opened concurrently and
 sometimes two or more attach to the same!!

 I've seen that I can use attach with hwnd, but how can  I know the
 hwnd of the
 ie.link(:url,the url).click ?

 thanks a lot in advice!
 valeria santini
 Uruguay














 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Java Script pop-ups handling in WATIR

2009-07-17 Thread Smruti Ranjan Kar
Thank you all. I installed Ruby 1.8.6-26. And that solved my problem. My
method works fine now.

On Thu, Jul 16, 2009 at 10:34 PM, Dylan mej...@gmail.com wrote:


 Yeah, I had this exact problem and I got it working when I down-graded
 to 1.8.6-26 (http://rubyforge.org/frs/download.php/29263/
 ruby186-26.exehttp://rubyforge.org/frs/download.php/29263/%0Aruby186-26.exe
 )

 Here's the code I used to always check for a popup anywhere in my
 script:

 #Function to Close Javascript Popups When they Occur
 def jsClicker( button=OK, waitTime=0)
  loop do
begin
  hwnd = $win.enabled_popup(waitTime)
  if (hwnd)  # yes there is a popup
w = WinClicker.new
w.clickWindowsButton_hwnd( hwnd, #{button} )
w=nil
$popup = true
  end
rescue
end
  end
 end

 def popup_check(results)
  if($popup)
$popup = false
return Javascript Popup occurred during test
  else
return Javascript Popup did not occur during test
  end
 end

 I use that global variable to keep track of them when they showed up
 and automatically click OK, and called popup_check() at the end of
 every test so I could pass/fail it based on whether or not I expected
 a popup. I created a thread at the beginning of the program that just
 went off and did its thing:
 $sc = Thread.new{jsClicker(OK,0)}
 $popup = false

 Then you just need to make sure all your clicks that you think might
 have a popup are click_no_waits. Also, I found that something I was
 defining as a button and using click on, I had to redefine as an image
 (it was an image, but I could call it a button and click would work)
 for click_no_wait to fire correctly on it.

 If you want to not have it run continuously, then take out the loop in
 jsClicker() and just call it with a wait time of a few seconds after
 your click_no_wait call.

 Hope this helps!

 -Dylan

 On Jul 16, 8:19 am, Smruti Ranjan Kar smrutiranjan@gmail.com
 wrote:
  Hi Charley,
 
  I'm using ruby186-27_rc2
 
  C:\Documents and Settings\userruby -v
  ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]
 
  On Thu, Jul 16, 2009 at 7:58 PM, Charley Baker charley.ba...@gmail.com
 wrote:
 
   Try click! instead of click_no_wait, which specific version of Ruby are
 you
   using, the latest one click 1.8.6rc2? What does ruby -v give you? There
 is a
   problem with that installer if that's the one you used where command
 line
   arguments don't get quoted correctly.
 
   Charley Baker
   blog:http://blog.charleybaker.org/
   Lead Developer, Watir,http://wtr.rubyforge.org
   QA Architect, Gap Inc Direct
 
   On Thu, Jul 16, 2009 at 10:20 AM, Smruti smrutiranjan@gmail.com
 wrote:
 
   Hello,
 
   I have been trying to automate a requirement, that is like
 
   - When I click on a link on the page, a popup should open up
   - I have to verify if the pop up opened and if the text in the pop up
   is correct
   - Click 'OK' on the pop up and move on.
 
   I have tried the suggestions at
  http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups
   , but they did not work. I tried with AutoIt as well as watir/contrib/
   enabled_popup.
 
   My observations are
   1. If I click the button using, 'click', the pop up remains open and
   the script does not move forward. So, the script written after do not
   get executed. But if I run from IRB it works fine.
   2. If I click the button using 'click_no_wait', the pop up gets closed
   immediately and the following scripts do not find the pop up.
 
   XP SP2
   Ruby 1.8
   Watir 1.6.2
   IE
 
   Please, suggest.
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Java Script pop-ups handling in WATIR

2009-07-16 Thread Smruti Ranjan Kar
Hi Charley,

I'm using ruby186-27_rc2

C:\Documents and Settings\userruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]


On Thu, Jul 16, 2009 at 7:58 PM, Charley Baker charley.ba...@gmail.comwrote:

 Try click! instead of click_no_wait, which specific version of Ruby are you
 using, the latest one click 1.8.6rc2? What does ruby -v give you? There is a
 problem with that installer if that's the one you used where command line
 arguments don't get quoted correctly.


 Charley Baker
 blog: http://blog.charleybaker.org/
 Lead Developer, Watir, http://wtr.rubyforge.org
 QA Architect, Gap Inc Direct



 On Thu, Jul 16, 2009 at 10:20 AM, Smruti smrutiranjan@gmail.comwrote:


 Hello,

 I have been trying to automate a requirement, that is like

 - When I click on a link on the page, a popup should open up
 - I have to verify if the pop up opened and if the text in the pop up
 is correct
 - Click 'OK' on the pop up and move on.

 I have tried the suggestions at
 http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups
 , but they did not work. I tried with AutoIt as well as watir/contrib/
 enabled_popup.

 My observations are
 1. If I click the button using, 'click', the pop up remains open and
 the script does not move forward. So, the script written after do not
 get executed. But if I run from IRB it works fine.
 2. If I click the button using 'click_no_wait', the pop up gets closed
 immediately and the following scripts do not find the pop up.

 XP SP2
 Ruby 1.8
 Watir 1.6.2
 IE

 Please, suggest.





 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Time to learn Watir

2009-07-10 Thread Smruti Ranjan Kar
I also started using it since last couple of months. I did have automation
knowledge in QTP for 6 months, but then this thing fascinated me more. I am
still learning, but I can suggest a start

- Install Ruby and learn basics. Practice in irb (brush up your OOP
concepts)
- Then focus on learning WATIR. It is easy to understand.

Even you can use WATIR without knowing Ruby well, but your script quality
will depend on your Ruby knowledge. So, After a quick start with Ruby basics
and Watir, keep learning Ruby side by side.

On Fri, Jul 10, 2009 at 1:43 PM, Željko Filipin 
zeljko.fili...@wa-research.ch wrote:

 On Fri, Jul 10, 2009 at 8:32 AM, Swap swapnal.sa...@gmail.com wrote:
  Can you please tell me how much time the learner will need to
  understand and learn Watir?

 If you have any programming experience, I think you will be surprised by
 how much you can do in just a day. I remember that I was able to install
 Watir and make log in test for our web application in a few hours. At the
 time Watir had a great tutorial that taught me all I needed to know in no
 time.

 Now, the tutorial is even better. :)

 My suggestions (with estimates):

 - browse http://watir.com/ (15 minutes)
 - read http://wiki.openqa.org/display/WTR/Quick+Start (60 minutes,
 installation included)
 - read http://wiki.openqa.org/display/WTR/Tutorial (a few hours)

 After you are done, you will be able to do almost everything you need. If
 you are stuck, ask here.

 If you like to listen to people talk, you can grab a few episodes of Watir
 Podcast (start with episode 1) where I talk with Watir users and developers
 about Watir. You can listen to that on your computer by downloading mp3
 files (web site even has flash player so you can listed directly from the
 site), or you can listen to it on your iPod (the podcast is in iTunes) or
 similar mp3 player.

 The only problem could be if you have not programming and/or HTML
 knowledge, because the tutorial assumes that you have. That could slow you
 down a lot.

 Željko
 --
 http://watirpodcast.com/


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---