[wtr-general] Re: Error while running Watir

2009-03-05 Thread amit kulkarni
Hi,

   When i tried for the first time then it didnt work,

   But after trying for 2-3 times it worked.I am using it on Vista platform.

   Try it out for 2-3 times..

   Also did u installed the jssh addon for firefox?

Thanks,

Amit

--~--~-~--~~~---~--~~
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: Browse an Image

2009-10-21 Thread Amit Kulkarni
Thanks a lot for the link.
Now i can upload  an image by using the following command
 Browser.file_field(:name, photo).set(path name i.e. C:\\abc\\abc.jpg)

Please dont forget to enter double slash.
:-)

On Thu, Oct 15, 2009 at 1:40 PM, Željko Filipin 
zeljko.fili...@wa-research.ch wrote:

 On Thu, Oct 15, 2009 at 10:07 AM, Amit amitkkulkarni...@gmail.com wrote:
  input id=product_photo class=file type=file size=20
  name=product[photo]/

 http://wiki.openqa.org/display/WTR/File+Uploads

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



[wtr-general] Re: Problem with radio button

2009-10-21 Thread Amit Kulkarni
Hi Zeljko,
I tried by using the above step but still no success :-(
It pops up a small window saying Please select an operation along with OK
button.
I still cant figure out whats is the problem.

On Wed, Oct 21, 2009 at 4:04 PM, Željko Filipin 
zeljko.fili...@wa-research.ch wrote:

 On Wed, Oct 21, 2009 at 10:50 AM, Željko Filipin 
 zeljko.fili...@wa-research.ch wrote:
  browser.button(:after?, browser.cell(:text, Test)).set

 My mistake. Try this:

 browser.radio(:after?, browser.cell(:text, Test)).click

 If that does not work, you can always try xpath:

 http://wiki.openqa.org/display/WTR/XPath


 Željko



 


--~--~-~--~~~---~--~~
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: Problem with radio button

2009-10-21 Thread Amit Kulkarni
No it does not flashed the radio button but again it is popping the window.
I dont know why it is getting popped up.


On Wed, Oct 21, 2009 at 4:25 PM, Željko Filipin 
zeljko.fili...@wa-research.ch wrote:

 On Wed, Oct 21, 2009 at 12:51 PM, Amit Kulkarni 
 amitkkulkarni...@gmail.com wrote:
  It pops up a small window saying Please select an operation along with OK
 button.

 Is the correct radio button flashed if you do this?

 browser.radio(:after?, browser.cell(:text, Test)).flash

 Maybe you have to fire some javascript event.


 Željko

 


--~--~-~--~~~---~--~~
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: Problem with Checkbox

2009-10-21 Thread Amit Kulkarni
I tried using command $Browser.checkbox(:id, /rating\[\d+\]/).set but i got
error which is as follows:
You have  nil object when you didn't expect it!
  The error occurred while evaluating nil.checkbox (NoMethodError)
  ./step_definitions/update_feature_steps.rb:23:in `/^i click on the
created rating$/'

I tried with the below codes
1:Browser.cell(:text, Ratingsanity1).flash
Nothing is getting flashed no error is displayed and next step is executed.

2:Browser.checkbox(:after?, Browser.span(:text, Ratingsanity1)).click
Here no check box is getting clicked but next step is executed.
I also tried using .set method but no success.

I am not getting what is wrong.Please suggest.


On Wed, Oct 21, 2009 at 4:36 PM, Željko Filipin 
zeljko.fili...@wa-research.ch wrote:

 On Wed, Oct 21, 2009 at 1:02 PM, Amit Kulkarni amitkkulkarni...@gmail.com
 wrote:
  I tried following code but still no success.
  1: Browser.checkbox(:after?, Browser.cell(:text, Ratingsanity1)).click

 And what is the error message, if any?

 Does this flash what you want?

 Browser.cell(:text, Ratingsanity1).flash

 Does this work?

 Browser.checkbox(:after?, Browser.span(:text, Ratingsanity1)).click

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



Fwd: [wtr-general] Re: Problem with radio button

2009-10-21 Thread Amit Kulkarni
-- Forwarded message --
From: Amit Kulkarni amitkkulkarni...@gmail.com
Date: Wed, Oct 21, 2009 at 4:40 PM
Subject: Re: [wtr-general] Re: Problem with radio button
To: watir-general@googlegroups.com


No it does not flashed the radio button but again it is popping the window.
I dont know why it is getting popped up.



Any suggestions??

On Wed, Oct 21, 2009 at 4:25 PM, Željko Filipin 
zeljko.fili...@wa-research.ch wrote:

 On Wed, Oct 21, 2009 at 12:51 PM, Amit Kulkarni 
 amitkkulkarni...@gmail.com wrote:
  It pops up a small window saying Please select an operation along with OK
 button.

 Is the correct radio button flashed if you do this?

 browser.radio(:after?, browser.cell(:text, Test)).flash

 Maybe you have to fire some javascript event.


 Željko

 


--~--~-~--~~~---~--~~
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: Problem with Checkbox

2009-10-21 Thread Amit Kulkarni
No,it does not flash up anything.
It also does not display any error and goes to next step

On Wed, Oct 21, 2009 at 5:39 PM, Željko Filipin 
zeljko.fili...@wa-research.ch wrote:

 Does this flash what you want?

 Browser.span(:text, Ratingsanity1).flash

 Željko


 


--~--~-~--~~~---~--~~
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] Accessing link method

2009-10-21 Thread Amit Kulkarni
Hello,

Consider this scenario:
I have list of images(which are non-clickable) and below that there is an
edit link
Now i want to click that edit link so that i can edit the description.

Html code is as follows:

div style=width: 150px; height: 150px;input id=attachment[218] type=
checkbox value=1 name=attachment[218]/
img title=Photogallerysanity src=
http://s3.amazonaws.com/staging-brandpotion-prints/images/63/large_thumb.jpg
 alt=Photogallerysanity/
a class=underline href=
/Nikes/photo_gallery/attachments/218/edit?media=printEdit/a
/div

Now i want to click on edit.I can do it by using href link but the no. i.e.
218 is not going to be same  for ever.I want to access that edit link using
the title i.e. Photogallerysanity.
Is it possible to do?
Please help...

--~--~-~--~~~---~--~~
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: Problem with Checkbox

2009-10-22 Thread Amit Kulkarni
Any suggestions on the above issue?
Please help

On Wed, Oct 21, 2009 at 5:49 PM, Amit Kulkarni
amitkkulkarni...@gmail.comwrote:

 No,it does not flash up anything.
 It also does not display any error and goes to next step


 On Wed, Oct 21, 2009 at 5:39 PM, Željko Filipin 
 zeljko.fili...@wa-research.ch wrote:

 Does this flash what you want?

 Browser.span(:text, Ratingsanity1).flash

 Željko


 



--~--~-~--~~~---~--~~
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: Problem with radio button

2009-10-22 Thread Amit Kulkarni
Help required on above issue
:-)

2009/10/21 Amit Kulkarni amitkkulkarni...@gmail.com



 -- Forwarded message --
 From: Amit Kulkarni amitkkulkarni...@gmail.com
 Date: Wed, Oct 21, 2009 at 4:40 PM
 Subject: Re: [wtr-general] Re: Problem with radio button
 To: watir-general@googlegroups.com


 No it does not flashed the radio button but again it is popping the window.
 I dont know why it is getting popped up.



 Any suggestions??

 On Wed, Oct 21, 2009 at 4:25 PM, Željko Filipin 
 zeljko.fili...@wa-research.ch wrote:

 On Wed, Oct 21, 2009 at 12:51 PM, Amit Kulkarni 
 amitkkulkarni...@gmail.com wrote:
  It pops up a small window saying Please select an operation along with
 OK button.

 Is the correct radio button flashed if you do this?

 browser.radio(:after?, browser.cell(:text, Test)).flash

 Maybe you have to fire some javascript event.


 Željko

 




--~--~-~--~~~---~--~~
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: Browse an Image

2009-10-22 Thread Amit Kulkarni
Thanks a lot Željko .

On Wed, Oct 21, 2009 at 1:43 PM, Željko Filipin 
zeljko.fili...@wa-research.ch wrote:

 On Wed, Oct 21, 2009 at 9:06 AM, Amit Kulkarni amitkkulkarni...@gmail.com
 wrote:
   Browser.file_field(:name, photo).set(path name i.e.
 C:\\abc\\abc.jpg)
  Please dont forget to enter double slash.

 If you use single quotes, I think you do not need double slash:

 browser.file_field(:name, photo).set('C:\abc.jpg')

 Željko


--~--~-~--~~~---~--~~
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] Help required regarding link method

2009-10-22 Thread Amit Kulkarni
Hello all,
Following is my scenario:
I have a list of images and below that image contains Edit link.
Now i want to click on that Edit so that i can Edit the Title and
Description.

Following is the html code:

div style=width: 150px; height: 150px;input id=attachment[218] type=
checkbox value=1 name=attachment[218]/
img title=Photogallerysanity src=
http://s3.amazonaws.com/staging-brandpotion-prints/images/63/large_thumb.jpg
 alt=Photogallerysanity/
a class=underline href=
/Nikes/photo_gallery/attachments/218/edit?media=printEdit/a
/div

From the above script my image title is Photogallerysanity.And below is Edit
link.
Now i can click on that Edit link using :href method but it will contain
the link /Nikes/photo_gallery/attachments/218/edit?media=print
Now the above link uses a no. to recognize.But i want to  recognize this
Edit link using the  image title.
Is it possible to do?
Please help...!

--~--~-~--~~~---~--~~
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: Help required regarding link method

2009-10-22 Thread Amit Kulkarni
Hi Željko,
I tried browser.link(:after?, browser.image(:title,
Photogallerysanity)).click but no success
I also tried using .flash method but it does not flash anything.
Can you please tell me what is going wrong?

On Thu, Oct 22, 2009 at 1:40 PM, Željko Filipin 
zeljko.fili...@wa-research.ch wrote:

 On Thu, Oct 22, 2009 at 10:05 AM, Amit Kulkarni 
 amitkkulkarni...@gmail.com wrote:
  i want to  recognize this Edit link using the  image title.

 browser.link(:after?, browser.image(:title, Photogallerysanity)).click

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



[wtr-general] Re: Help required regarding link method

2009-10-22 Thread Amit Kulkarni
Sorry for the trouble.
I got it that my queries are similar.
But i dont know why is it not working on my side.

No my application does not use frames.

Even i try to flash any object it does not.
Can you tell me what is the problem?

On Thu, Oct 22, 2009 at 4:17 PM, Željko Filipin 
zeljko.fili...@wa-research.ch wrote:

 On Thu, Oct 22, 2009 at 12:36 PM, Amit Kulkarni 
 amitkkulkarni...@gmail.com wrote:
  I tried browser.link(:after?, browser.image(:title,
 Photogallerysanity)).click but no success

 Amit,

 You have posted a few very similar questions in the last two days. Have you
 read the tutorial?

 http://wiki.openqa.org/display/WTR/Tutorial

 Does your application use frames? I tested the code I posted with html that
 you have provided, and it worked.

 Željko


 


--~--~-~--~~~---~--~~
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: Help required regarding link method

2009-10-22 Thread Amit Kulkarni
Sorry again,
Yes i read the tutorial.
I tried some stunts but no success.So posted my queries here.


On Thu, Oct 22, 2009 at 4:48 PM, Željko Filipin 
zeljko.fili...@wa-research.ch wrote:

 On Thu, Oct 22, 2009 at 12:47 PM, Željko Filipin 
 zeljko.fili...@wa-research.ch wrote:
  Have you read the tutorial?
  http://wiki.openqa.org/display/WTR/Tutorial

 You did not answer this.


 Željko

 


--~--~-~--~~~---~--~~
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: Help required regarding link method

2009-10-22 Thread Amit Kulkarni
I also tried to use using Xpath. i.e.
Browser.link(:xpath,//a...@href='/Nikes/photo_gallery/attachments/218/edit?media=print']/).text
# =  Edit

Still no success.Is there something wrong with the above code?


On Thu, Oct 22, 2009 at 4:55 PM, Amit Kulkarni
amitkkulkarni...@gmail.comwrote:

 Sorry again,
 Yes i read the tutorial.
 I tried some stunts but no success.So posted my queries here.



 On Thu, Oct 22, 2009 at 4:48 PM, Željko Filipin 
 zeljko.fili...@wa-research.ch wrote:

 On Thu, Oct 22, 2009 at 12:47 PM, Željko Filipin 
 zeljko.fili...@wa-research.ch wrote:
  Have you read the tutorial?
  http://wiki.openqa.org/display/WTR/Tutorial

 You did not answer this.


 Željko

 



--~--~-~--~~~---~--~~
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: Help required regarding link method

2009-10-22 Thread Amit Kulkarni
Hi Angrez,
I tried with the link you provided but it shows below error

Unable to locate element, using :xpath,
//i...@title='Photogallerysanity']/
(Watir::Exception::UnknownObjectException)
Same error appears when i use .click or .flash

On Thu, Oct 22, 2009 at 5:14 PM, Angrez Singh ang...@gmail.com wrote:

 can you try this?
 Browser.link(:xpath,//i...@title='Photogallerysanity']/a).flash() or
 click()

 - Angrez

 On Thu, Oct 22, 2009 at 5:03 PM, Amit Kulkarni amitkkulkarni...@gmail.com
  wrote:

 I also tried to use using Xpath. i.e.
 Browser.link(:xpath,//a...@href='/Nikes/photo_gallery/attachments/218/edit?media=print']/).text
 # =  Edit

 Still no success.Is there something wrong with the above code?



 On Thu, Oct 22, 2009 at 4:55 PM, Amit Kulkarni 
 amitkkulkarni...@gmail.com wrote:

 Sorry again,
 Yes i read the tutorial.
 I tried some stunts but no success.So posted my queries here.



 On Thu, Oct 22, 2009 at 4:48 PM, Željko Filipin 
 zeljko.fili...@wa-research.ch wrote:

 On Thu, Oct 22, 2009 at 12:47 PM, Željko Filipin 
 zeljko.fili...@wa-research.ch wrote:
  Have you read the tutorial?
  http://wiki.openqa.org/display/WTR/Tutorial

 You did not answer this.


 Željko








 


--~--~-~--~~~---~--~~
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: Problem with radio button

2009-10-22 Thread Amit Kulkarni
Thanks a lot.But the name act2[165] is not going to be same all the time.
I have my poll title as Test.So i want to set my focus on delete radio
button whose title is Test.
Is it possible to do this?

This is my html script
tr
tdTest/td
tdUnpublished/td
td class=actions
label for=Update
input id=act2_165_update type=radio value=update name=act2
[165]/
Update
/label
label for=del2
input id=act2_165_delete type=radio value=delete name=act2
[165]/
Delete
/label
/td

Now here tdTest/td is the title of the poll.
So i want to click on delete radio button which has a title named Test :-)
On Thu, Oct 22, 2009 at 6:51 PM, Super Kevy
kpe...@scholarshipamerica.orgwrote:


 Try something like this where value=delete or update
   ie.radio(:name,'act2[165]',value).focus
   ie.radio(:name,'act2[165]'',value).set


 


--~--~-~--~~~---~--~~
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: Help required regarding link method

2009-10-23 Thread Amit Kulkarni
Thanks for the help.
Following is the page source.

 body
div class=main !-- main --
div class=header-container !-- header --
div class=header
div class=actions
  welcome a href=/profile/nikeman alt=nikeman
class=underline onclick=window.open(this.href);return false;
title=nikemannikeman/a nbsp;nbsp;nbsp;
/div
 /div

/div !-- header close --
div class=content-container !-- content --

div class=content
h2 class=titleNikes Active features/h2
div class=tab-layout
li class=selectedspan class=Photogallery/span/li

/ul

   div class=tab-content
   strong class=alert/strong
form 
action=/Nikes/photo_gallery/attachments/delete_multiple
method=post
div class=dark-underlined-cont
 h3Photogallery/h3
 /div
div class=arrow-bar borded

div
input type=submit
class=submit ar-normal title=Delete selected value=Delete
selected onclick=if(!validate_delete('input'))  { alert('Please
select a photo'); return false;}  /
a
href=/Nikes/photo_gallery/attachments/new?media=print
class=ar-normal title=Add new photoAdd new photo/a/li
 /div
/div
div class=gallery
  *div style=width:150px;height:150px;
  input id=attachment[218]
name=attachment[218] type=checkbox value=1 /
  img
alt=Photogallerysanity1
src=http://s3.amazonaws.com/staging-brandpotion-prints/images/63/large_thumb.jpg;
title=Photogallerysanity1 /
*

*  a
href=/Nikes/photo_gallery/attachments/218/edit?media=print
class=underlineEdit/a *
   /div!-- just for hidden the
margin of the last element --   /div
/form !-- end form --
/div
div class=clear/div !-- clearing
content floats important! --


/div
/div !-- content close --

/div !-- main close --
/body
/html




2009/10/23 Wesley Chen cjq@gmail.com

 Your this question has taken so much time.
 I think you still have not described your question clearly enough.

 For the html code you provided, of course it is easy for us to help you to
 locate.

 Please give us the whole page source you failed to locate, and show the
 error message you got.


 Thanks.
 Wesley Chen.
 For life, the easier, the better.


 2009/10/22 Amit Kulkarni amitkkulkarni...@gmail.com

 Hi Angrez,
 I tried with the link you provided but it shows below error

 Unable to locate element, using :xpath,
 //i...@title='Photogallerysanity']/
 (Watir::Exception::UnknownObjectException)
 Same error appears when i use .click or .flash


 On Thu, Oct 22, 2009 at 5:14 PM, Angrez Singh ang...@gmail.com wrote:

 can you try this?
 Browser.link(:xpath,//i...@title='Photogallerysanity']/a).flash() or
 click()

 - Angrez

 On Thu, Oct 22, 2009 at 5:03 PM, Amit Kulkarni 
 amitkkulkarni...@gmail.com wrote:

 I also tried to use using Xpath. i.e.
 Browser.link(:xpath,//a...@href='/Nikes/photo_gallery/attachments/218/edit?media=print']/).text
 # =  Edit

 Still no success.Is there something wrong with the above code?



 On Thu, Oct 22, 2009 at 4:55 PM, Amit Kulkarni 
 amitkkulkarni...@gmail.com wrote:

 Sorry again,
 Yes i read the tutorial.
 I tried some stunts but no success.So posted my queries here.



 On Thu, Oct 22, 2009 at 4:48 PM, Željko Filipin 
 zeljko.fili...@wa-research.ch wrote:

 On Thu, Oct 22, 2009 at 12:47 PM, Željko Filipin 
 zeljko.fili...@wa-research.ch wrote:
  Have you read the tutorial?
  http://wiki.openqa.org/display/WTR/Tutorial

 You did not answer this.


 Željko














 


--~--~-~--~~~---~--~~
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: Help required regarding link method

2009-10-23 Thread Amit Kulkarni
Thanks Wesley,
I will try it out and let you know.
Thanks for thee help. :-)

2009/10/23 Wesley Chen cjq@gmail.com

 I tried all the methods below, they work:
 1. $ie.link(:after?, $ie.image(:title, Photogallerysanity1)).click
 2. $ie.link(:after?, $ie.image(:alt, Photogallerysanity1)).click
 3. $ie.link(:after?, $ie.image(:src, /s3.amazonaws.com
 \/staging-brandpotion-prints/)).click
 4. $ie.image(:alt, Photogallerysanity1).parent.link(:index, 1).click
 5. $ie.image(:alt, Photogallerysanity1).parent.link(:text, Edit).click
 6. $ie.image(:alt, Photogallerysanity1).parent.link(:class =
 underline, :index =1).click

 We don't need use Xpth here.


 Thanks.
 Wesley Chen.
 For life, the easier, the better.


 2009/10/23 Amit Kulkarni amitkkulkarni...@gmail.com

 Thanks for the help.
 Following is the page source.

  body
 div class=main !-- main --


 div class=header-container !-- header --
 div class=header


  div class=actions
   welcome a href=/profile/nikeman alt=nikeman class=underline 
 onclick=window.open(this.href);return false; title=nikemannikeman/a 
 nbsp;nbsp;nbsp;


  /div
   /div

 /div !-- header close --

 div class=content-container !-- content --


 div class=content
  h2 class=titleNikes Active features/h2


  div class=tab-layout
  li class=selectedspan class=Photogallery/span/li

  /ul

div class=tab-content

 strong class=alert/strong
  form 
 action=/Nikes/photo_gallery/attachments/delete_multiple method=post


  div class=dark-underlined-cont
   h3Photogallery/h3

   /div
 div class=arrow-bar borded

  div
 input type=submit class=submit 
 ar-normal title=Delete selected value=Delete selected 
 onclick=if(!validate_delete('input'))  { alert('Please select a photo'); 
 return false;}  /

 a 
 href=/Nikes/photo_gallery/attachments/new?media=print class=ar-normal 
 title=Add new photoAdd new photo/a/li


   /div
 /div
 div class=gallery

   *
 div style=width:150px;height:150px;

   input id=attachment[218] 
 name=attachment[218] type=checkbox value=1 /


   img alt=Photogallerysanity1 
 src=http://s3.amazonaws.com/staging-brandpotion-prints/images/63/large_thumb.jpg;
  title=Photogallerysanity1 /

 *

 *  a 
 href=/Nikes/photo_gallery/attachments/218/edit?media=print 
 class=underlineEdit/a *

/div!-- just for hidden the margin 
 of the last element --   /div


 /form !-- end form --
  /div
 div class=clear/div !-- clearing content 
 floats important! --



 /div
 /div !-- content close --

 /div !-- main close --
 /body

 /html




 2009/10/23 Wesley Chen cjq@gmail.com

 Your this question has taken so much time.
 I think you still have not described your question clearly enough.

 For the html code you provided, of course it is easy for us to help you
 to locate.

 Please give us the whole page source you failed to locate, and show the
 error message you got.


 Thanks.
 Wesley Chen.
 For life, the easier, the better.


 2009/10/22 Amit Kulkarni amitkkulkarni...@gmail.com

 Hi Angrez,
 I tried with the link you provided but it shows below error

 Unable to locate element, using :xpath,
 //i...@title='Photogallerysanity']/
 (Watir::Exception::UnknownObjectException)
 Same error appears when i use .click or .flash


 On Thu, Oct 22, 2009 at 5:14 PM, Angrez Singh ang...@gmail.com wrote:

 can you try this?
 Browser.link(:xpath,//i...@title='Photogallerysanity']/a).flash() or
 click()

 - Angrez

 On Thu, Oct 22, 2009 at 5:03 PM, Amit Kulkarni 
 amitkkulkarni...@gmail.com wrote:

 I also tried to use using Xpath. i.e.
 Browser.link(:xpath,//a...@href='/Nikes/photo_gallery/attachments/218/edit?media=print']/).text
 # =  Edit

 Still no success.Is there something wrong with the above code?



 On Thu, Oct 22, 2009 at 4:55 PM, Amit Kulkarni 
 amitkkulkarni...@gmail.com wrote:

 Sorry again,
 Yes i read the tutorial.
 I tried some stunts but no success.So posted my queries here.



 On Thu, Oct 22, 2009 at 4:48 PM, Željko Filipin 
 zeljko.fili...@wa-research.ch wrote:

 On Thu, Oct 22, 2009 at 12:47 PM, Željko Filipin 
 zeljko.fili...@wa-research.ch wrote:
  Have you read the tutorial?
  http

[wtr-general] Re: Problem with radio button

2009-10-23 Thread Amit Kulkarni
Hi Super,
I tried with using your code.
It didnt give me any error but it did not click on the desired button.
Also it did not print any value.

Also tell me one thing For this we have to run scripts compulsary in I.E or
is it ok to run in FireFox?

On Thu, Oct 22, 2009 at 8:31 PM, Super Kevy
kpe...@scholarshipamerica.orgwrote:


 Interesting... I'm assuming table matching is the ticket and dynamic
 variables being the pain...
 Try this snippet and modify to suit for page

 require 'watir'
 require 'watir/ie'
 require 'watir/dialog'
 require 'Win32API'

  ie = Watir::IE.new
  sURL='http://www.google.com'
  sURL='C:\Documents and Settings\kpetry\Desktop\t.html'
  ie.goto(sURL)
  ie.bring_to_front()
  myTable=ie.table(:index,1)
  # loop through the table by indexing the first variable if needed
 until a match
  pollText=myTable[1][1].text.upcase
  #Obvious Text matching here Then invoke this code stream
  theParse=myTable[1][3].attribute_value(InnerHTML)
  puts theParse
  iStart = theParse.rindex('id=')+3
  iEnd = theParse.rindex('type=radio')-1
  theId= theParse.slice!(iStart..iEnd).strip!
  puts iStart.to_s
  puts iEnd.to_s
  puts theId+'..'
  ie.radio(:id, theId ).flash
  ie.radio(:id, theId ).set


 On Oct 22, 8:31 am, Amit Kulkarni amitkkulkarni...@gmail.com wrote:
  Thanks a lot.But the name act2[165] is not going to be same all the
 time.
  I have my poll title as Test.So i want to set my focus on delete radio
  button whose title is Test.
  Is it possible to do this?
 
  This is my html script
  tr
  tdTest/td
  tdUnpublished/td
  td class=actions
  label for=Update
  input id=act2_165_update type=radio value=update name=act2
  [165]/
  Update
  /label
  label for=del2
  input id=act2_165_delete type=radio value=delete name=act2
  [165]/
  Delete
  /label
  /td
 
  Now here tdTest/td is the title of the poll.
  So i want to click on delete radio button which has a title named Test
 :-)
  On Thu, Oct 22, 2009 at 6:51 PM, Super Kevy
  kpe...@scholarshipamerica.orgwrote:
 
 
 
 
 
   Try something like this where value=delete or update
 ie.radio(:name,'act2[165]',value).focus
 ie.radio(:name,'act2[165]'',value).set- Hide quoted text -
 
  - Show quoted text -
 


--~--~-~--~~~---~--~~
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: Problem with radio button

2009-10-23 Thread Amit Kulkarni
Hey all,
What i have done is:
I got all the elements by
my_array = Browser.table(:class , 'admin-monochrome').to_a
Under my_array i got the string Test.
Now how should i click on Delete button?
Please help?

On Fri, Oct 23, 2009 at 1:55 PM, Amit Kulkarni
amitkkulkarni...@gmail.comwrote:

 Hi Super,
 I tried with using your code.
 It didnt give me any error but it did not click on the desired button.
 Also it did not print any value.

 Also tell me one thing For this we have to run scripts compulsary in I.E or
 is it ok to run in FireFox?


 On Thu, Oct 22, 2009 at 8:31 PM, Super Kevy kpe...@scholarshipamerica.org
  wrote:


 Interesting... I'm assuming table matching is the ticket and dynamic
 variables being the pain...
 Try this snippet and modify to suit for page

 require 'watir'
 require 'watir/ie'
 require 'watir/dialog'
 require 'Win32API'

  ie = Watir::IE.new
  sURL='http://www.google.com'
  sURL='C:\Documents and Settings\kpetry\Desktop\t.html'
  ie.goto(sURL)
  ie.bring_to_front()
  myTable=ie.table(:index,1)
  # loop through the table by indexing the first variable if needed
 until a match
  pollText=myTable[1][1].text.upcase
  #Obvious Text matching here Then invoke this code stream
  theParse=myTable[1][3].attribute_value(InnerHTML)
  puts theParse
  iStart = theParse.rindex('id=')+3
  iEnd = theParse.rindex('type=radio')-1
  theId= theParse.slice!(iStart..iEnd).strip!
  puts iStart.to_s
  puts iEnd.to_s
  puts theId+'..'
  ie.radio(:id, theId ).flash
  ie.radio(:id, theId ).set


 On Oct 22, 8:31 am, Amit Kulkarni amitkkulkarni...@gmail.com wrote:
  Thanks a lot.But the name act2[165] is not going to be same all the
 time.
  I have my poll title as Test.So i want to set my focus on delete radio
  button whose title is Test.
  Is it possible to do this?
 
  This is my html script
  tr
  tdTest/td
  tdUnpublished/td
  td class=actions
  label for=Update
  input id=act2_165_update type=radio value=update name=act2
  [165]/
  Update
  /label
  label for=del2
  input id=act2_165_delete type=radio value=delete name=act2
  [165]/
  Delete
  /label
  /td
 
  Now here tdTest/td is the title of the poll.
  So i want to click on delete radio button which has a title named Test
 :-)
  On Thu, Oct 22, 2009 at 6:51 PM, Super Kevy
  kpe...@scholarshipamerica.orgwrote:
 
 
 
 
 
   Try something like this where value=delete or update
 ie.radio(:name,'act2[165]',value).focus
 ie.radio(:name,'act2[165]'',value).set- Hide quoted text -
 
  - Show quoted text -
 



--~--~-~--~~~---~--~~
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] Javascript pop uo using firewatir

2010-11-17 Thread Amit Kulkarni
Hello all,
I am having a application in which user can be created,updated and deleted.
On delete action popup is there which onclick it shows a pop up box along
with two buttons i.e. Ok and Cancel

My scenario is:
User should be able to click on Destroy link and then click on OK in the
pop up box

But after inspecting the Destroy link following code is getting displayed
a onclick=if (confirm('Are you sure?')) { var f =
document.createElement('form'); f.style.display = 'none';
this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;var
m = document.createElement('input'); m.setAttribute('type', 'hidden');
m.setAttribute('name', '_method'); m.setAttribute('value', 'delete');
f.appendChild(m);var s = document.createElement('input');
s.setAttribute('type', 'hidden'); s.setAttribute('name',
'authenticity_token'); s.setAttribute('value',
'TUrgfZQeTtveBgV82E0NTafS1xf4f6g3scwZxeFvX5o=');
f.appendChild(s);f.submit(); };return false; href=/users/5Destroy/a

Following is the code i am trying but not getting success:

require 'rubygems'
require 'firewatir'
Watir::Browser.default = 'firefox'
Browser = Watir::Browser.new
Browser.goto(http://localhost:3000/users;)
Browser.link(:href,/users/5).click --  *This step should click the
Destroy link but it is not.*
Browser.execute_script(window.confirm = function() {return true})
#Browser.execute_script window.confirm = function() { return true; }
Browser.button(:value = 'OK').click

Does anybody knows how to overcome this problem?

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Re: Javascript pop uo using firewatir

2010-11-22 Thread Amit Kulkarni
Thanks a lot for the link.
But i tried every option but no success.
If you see carefully it uses a Ajax call.


require 'rubygems'
require 'firewatir'
Watir::Browser.default = 'firefox'
Browser = Watir::Browser.new
Browser.goto(http://localhost:3000/users;)
Browser.link(:href,/users/1).click
--error referring to this line
#Browser.execute_script(window.confirm = function() {return true})


def check_for_popups
autoit = WIN32OLE.new('AutoItX3.Control')
#
# Do forever - assumes popups could occur anywhere/anytime in your
application.
loop do
# Look for window with given title. Give up after 1 second.
ret = autoit.WinWait('Destroy', '', 1)
#
# If window found, send appropriate keystroke (e.g. {enter}, {Y},
{N}).
if (ret==1) then autoit.Send('{enter}') end
#
# Take a rest to avoid chewing up cycles and give another thread a
go.
# Then resume the loop.
sleep(3)
end
end

$popup = Thread.new { check_for_popups }  # start popup handler
at_exit { Thread.kill($popup) }

After running i get the following error

js_eval':  missing ; before statement (JsshSocket::JSSyntaxError)
from
/var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/jssh_socket.rb:27:in
`js_eval_method'
from
/var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/element.rb:936:in
`enabled?'
from
/var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/element.rb:922:in
`assert_enabled'
from
/var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/element.rb:1072:in
`click'
from user_destroy.rb:6



On Thu, Nov 18, 2010 at 2:36 PM, Željko Filipin 
zeljko.fili...@wa-research.ch wrote:

 On Thu, Nov 18, 2010 at 8:21 AM, Amit Kulkarni amitkkulkarni...@gmail.com
 wrote:
  On delete action popup is there which onclick it shows a pop up box along
 with two buttons i.e. Ok and Cancel

 Maybe something from here could help you:

 http://wiki.openqa.org/display/WTR/Pop+Ups
 http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups

 Željko
 --
 watir.com - community manager
 watirpodcast.com - host
 testingpodcast.com - audio podcasts on software testing. all of them

  --
 Before posting, please read http://watir.com/support. In short: search
 before you ask, be nice.

 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com


-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Re: Javascript pop uo using firewatir

2010-11-24 Thread Amit Kulkarni
Hi,
I tried the code using without the codes but it is showing an error.
syntax error, unexpected tINTEGER, expecting ')'
Browser.link(:href, /users/1).click

But if i put the codes then error is not displayed but the link is getting
clicked.



On Mon, Nov 22, 2010 at 7:16 PM, Prajakta Jadhav
jadhav.praja...@gmail.comwrote:

 Why does
 Browser.link(:href,/users/1).click
 have double quotes ( ) around :href?

 That is not required and I am not sure if that will work either.

 This is the syntax:
  a href=page.htm ie.link(:href, /page/).click

 Try removing those double quotes.
 Hope it works.



 2010/11/22 Amit Kulkarni amitkkulkarni...@gmail.com

 Thanks a lot for the link.
 But i tried every option but no success.
 If you see carefully it uses a Ajax call.


 require 'rubygems'
 require 'firewatir'
 Watir::Browser.default = 'firefox'
 Browser = Watir::Browser.new
 Browser.goto(http://localhost:3000/users;)
 Browser.link(:href,/users/1).click
 --error referring to this line
 #Browser.execute_script(window.confirm = function() {return true})


 def check_for_popups
 autoit = WIN32OLE.new('AutoItX3.Control')
 #
 # Do forever - assumes popups could occur anywhere/anytime in your
 application.
 loop do
 # Look for window with given title. Give up after 1 second.
 ret = autoit.WinWait('Destroy', '', 1)
 #
 # If window found, send appropriate keystroke (e.g. {enter}, {Y},
 {N}).
 if (ret==1) then autoit.Send('{enter}') end
 #
 # Take a rest to avoid chewing up cycles and give another thread a
 go.
 # Then resume the loop.
 sleep(3)
 end
 end

 $popup = Thread.new { check_for_popups }  # start popup handler
 at_exit { Thread.kill($popup) }

 After running i get the following error

 js_eval':  missing ; before statement (JsshSocket::JSSyntaxError)
 from
 /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/jssh_socket.rb:27:in
 `js_eval_method'
 from
 /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/element.rb:936:in
 `enabled?'
 from
 /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/element.rb:922:in
 `assert_enabled'
 from
 /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/element.rb:1072:in
 `click'
 from user_destroy.rb:6



 On Thu, Nov 18, 2010 at 2:36 PM, Željko Filipin 
 zeljko.fili...@wa-research.ch wrote:

 On Thu, Nov 18, 2010 at 8:21 AM, Amit Kulkarni 
 amitkkulkarni...@gmail.com wrote:
  On delete action popup is there which onclick it shows a pop up box
 along with two buttons i.e. Ok and Cancel

 Maybe something from here could help you:

 http://wiki.openqa.org/display/WTR/Pop+Ups
 http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups

 Željko
 --
 watir.com - community manager
 watirpodcast.com - host
 testingpodcast.com - audio podcasts on software testing. all of them

  --
 Before posting, please read http://watir.com/support. In short: search
 before you ask, be nice.

 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com


  --
 Before posting, please read http://watir.com/support. In short: search
 before you ask, be nice.

 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com


  --
 Before posting, please read http://watir.com/support. In short: search
 before you ask, be nice.

 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com


-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Re: Javascript pop uo using firewatir

2010-11-24 Thread Amit Kulkarni
Hi,
I tried the code but it gives me error as gem_original_require': no such
file to load -- win32ole (MissingSourceFile)
I am working on Ubuntu machine so could not install the windows gem.
How to solve this?

2010/11/23 Rajiv Nanduani rajivkumarnandv...@gmail.com

 try this

   $autoit = WIN32OLE.new(AutoItX3.Control)
   sleep(5)

   if @browserType == firefox

 Thread.start do
   @browser.link(:href, /page/).click
 end
 sleep(5)

   elsif @browserType == ie

 Thread.start do
   @browser.link(:href, /page/).focus
 end
 sleep(5)
 $autoit.Send({ENTER})

   else
 @@log.error(@browserType +  is NOT a valid Browser
 Type!!!)
 raise Exception.new(@browserType +  is NOT a valid
 Browser Type!)
   end

   sleep(5)
   $autoit.Send({ENTER})
   sleep(5)


 On Mon, Nov 22, 2010 at 8:46 AM, Prajakta Jadhav 
 jadhav.praja...@gmail.com wrote:

 Why does
 Browser.link(:href,/users/1).click
 have double quotes ( ) around :href?

 That is not required and I am not sure if that will work either.

 This is the syntax:
  a href=page.htm ie.link(:href, /page/).click

 Try removing those double quotes.
 Hope it works.



 2010/11/22 Amit Kulkarni amitkkulkarni...@gmail.com

 Thanks a lot for the link.
 But i tried every option but no success.
 If you see carefully it uses a Ajax call.


 require 'rubygems'
 require 'firewatir'
 Watir::Browser.default = 'firefox'
 Browser = Watir::Browser.new
 Browser.goto(http://localhost:3000/users;)
 Browser.link(:href,/users/1).click
 --error referring to this line
 #Browser.execute_script(window.confirm = function() {return true})


 def check_for_popups
 autoit = WIN32OLE.new('AutoItX3.Control')
 #
 # Do forever - assumes popups could occur anywhere/anytime in your
 application.
 loop do
 # Look for window with given title. Give up after 1 second.
 ret = autoit.WinWait('Destroy', '', 1)
 #
 # If window found, send appropriate keystroke (e.g. {enter}, {Y},
 {N}).
 if (ret==1) then autoit.Send('{enter}') end
 #
 # Take a rest to avoid chewing up cycles and give another thread
 a go.
 # Then resume the loop.
 sleep(3)
 end
 end

 $popup = Thread.new { check_for_popups }  # start popup handler
 at_exit { Thread.kill($popup) }

 After running i get the following error

 js_eval':  missing ; before statement (JsshSocket::JSSyntaxError)
 from
 /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/jssh_socket.rb:27:in
 `js_eval_method'
 from
 /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/element.rb:936:in
 `enabled?'
 from
 /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/element.rb:922:in
 `assert_enabled'
 from
 /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/element.rb:1072:in
 `click'
 from user_destroy.rb:6



 On Thu, Nov 18, 2010 at 2:36 PM, Željko Filipin 
 zeljko.fili...@wa-research.ch wrote:

 On Thu, Nov 18, 2010 at 8:21 AM, Amit Kulkarni 
 amitkkulkarni...@gmail.com wrote:
  On delete action popup is there which onclick it shows a pop up box
 along with two buttons i.e. Ok and Cancel

 Maybe something from here could help you:

 http://wiki.openqa.org/display/WTR/Pop+Ups
 http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups

 Željko
 --
 watir.com - community manager
 watirpodcast.com - host
 testingpodcast.com - audio podcasts on software testing. all of them

  --
 Before posting, please read http://watir.com/support. In short: search
 before you ask, be nice.

 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com


  --
 Before posting, please read http://watir.com/support. In short: search
 before you ask, be nice.

 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com


  --
 Before posting, please read http://watir.com/support. In short: search
 before you ask, be nice.

 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com




 --
 RAJIV KUMAR

 http://rajivkumarnandvani.wordpress.com/
 http://learnqtphelp.blogspot.com/



  --
 Before posting, please read http://watir.com/support. In short: search
 before you ask, be nice.

 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com


-- 
Before posting, please read

Re: [wtr-general] Re: Javascript pop uo using firewatir

2010-11-26 Thread Amit Kulkarni
Hello,
Is there any difference running watir popup scripts for Firewatir and in
Watir.
This is because i am using Firewatir for ubuntu machine.I am getting an
error undefined method `enabled_popup' for nil:NilClass (NoMethodError)

Below is my code :
require 'rubygems'
require 'firewatir'
#require 'watir/contrib/enabled_popup'

Watir::Browser.default = 'firefox'
Browser = Watir::Browser.new
Browser.goto(http://localhost:3002/users;)
Browser.link(:id, del_2).click_no_wait
#popup_clicker(OK, 3)
#Browser.button(:id, /someText/).click_no_wait


hwnd = $b.enabled_popup(50)
 if (hwnd)  #yeah! a popup
  popup = WinClicker.new
  popup.makeWindowActive(hwnd)
  if browsername == firefox
popup.clickWindowsButton(FireFox, OK, 30)
  else
popup.clickWindowsButton(The site at http://www.makemytrip.co.in  says:
, OK, 30)
  end
end

Now if i uncomment the 3rd line i.e. require 'watir/contrib/enabled_popup'
then it shows me an error gem_original_require': no such file to load --
firewatir/contrib/enabled_popup (MissingSourceFile)

My firewatir versions are firewatir (1.6.7, 1.6.5)

2010/11/25 Jari Bakken jari.bak...@gmail.com

 With watir-webdriver, instead of calling execute_script yourself you can
 use the helpers provided by the optional require:


 https://github.com/jarib/watir-webdriver/blob/master/lib/watir-webdriver/extensions/alerts.rb


 https://github.com/jarib/watir-webdriver/blob/master/lib/watir-webdriver/extensions/alerts.rb
 2010/11/24 Alister Scott alister.sc...@gmail.com

 I'd try Watir-Webdriver and see if the execute_script code works.


 Browser.execute_script(
 window.confirm = function() {return true})

 Cheers

 Alister Scott
 Brisbane, Australia
 Watir Web Master: http://watir.com
 Blog: http://watirmelon.com
 LinkedIn: http://www.linkedin.com/in/alisterscott

 There are two ways to get enough: One is to continue to accumulate more
 and more. The other is to desire less. *~ G. K. Chesterton*


 2010/11/24 Amit Kulkarni amitkkulkarni...@gmail.com

 Hi,
 I tried the code but it gives me error as gem_original_require': no such
 file to load -- win32ole (MissingSourceFile)
 I am working on Ubuntu machine so could not install the windows gem.
 How to solve this?

 2010/11/23 Rajiv Nanduani rajivkumarnandv...@gmail.com

 try this

   $autoit = WIN32OLE.new(AutoItX3.Control)
   sleep(5)

   if @browserType == firefox

 Thread.start do
   @browser.link(:href, /page/).click
 end
 sleep(5)

   elsif @browserType == ie

 Thread.start do
   @browser.link(:href, /page/).focus
 end
 sleep(5)
 $autoit.Send({ENTER})

   else
 @@log.error(@browserType +  is NOT a valid Browser
 Type!!!)
 raise Exception.new(@browserType +  is NOT a valid
 Browser Type!)
   end

   sleep(5)
   $autoit.Send({ENTER})
   sleep(5)


 On Mon, Nov 22, 2010 at 8:46 AM, Prajakta Jadhav 
 jadhav.praja...@gmail.com wrote:

 Why does
 Browser.link(:href,/users/1).click
 have double quotes ( ) around :href?

 That is not required and I am not sure if that will work either.

 This is the syntax:
  a href=page.htm ie.link(:href, /page/).click

 Try removing those double quotes.
 Hope it works.



 2010/11/22 Amit Kulkarni amitkkulkarni...@gmail.com

 Thanks a lot for the link.
 But i tried every option but no success.
 If you see carefully it uses a Ajax call.


 require 'rubygems'
 require 'firewatir'
 Watir::Browser.default = 'firefox'
 Browser = Watir::Browser.new
 Browser.goto(http://localhost:3000/users;)
 Browser.link(:href,/users/1).click
 --error referring to this 
 line
 #Browser.execute_script(window.confirm = function() {return true})


 def check_for_popups
 autoit = WIN32OLE.new('AutoItX3.Control')
 #
 # Do forever - assumes popups could occur anywhere/anytime in your
 application.
 loop do
 # Look for window with given title. Give up after 1 second.
 ret = autoit.WinWait('Destroy', '', 1)
 #
 # If window found, send appropriate keystroke (e.g. {enter},
 {Y}, {N}).
 if (ret==1) then autoit.Send('{enter}') end
 #
 # Take a rest to avoid chewing up cycles and give another
 thread a go.
 # Then resume the loop.
 sleep(3)
 end
 end

 $popup = Thread.new { check_for_popups }  # start popup handler
 at_exit { Thread.kill($popup) }

 After running i get the following error

 js_eval':  missing ; before statement (JsshSocket::JSSyntaxError)
 from
 /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/jssh_socket.rb:27:in
 `js_eval_method'
 from
 /var/lib/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/element.rb:936:in
 `enabled?'
 from

[wtr-general] Opening new browser window from existing one

2010-11-29 Thread Amit Kulkarni
Hello all,
Can we open a new browser window from the existing one using Firewatir for
Linux and for Watir for windows:
Following are my gem versions:

firewatir (1.6.7, 1.6.5)

Following is my code:
require 'rubygems'
require 'firewatir'
Watir::Browser.default = 'firefox'
Browser = Watir::Browser.new
Browser.goto(http://localhost:3000/users;)
sleep 5
*Browser.attach(:title, '/test123/')*
#Browser.link(:href, /users/new).click
Browser.text_field(:name, user[name]).set(amit)
Browser.text_field(:name, user[description]).set(Qa Engineer)
Browser.select_list(:name, user[role]).select(Hr)
Browser.radio(:id, user_category_hr).set
Browser.button(:value, Create).click
Browser.link(:href, /users).click

The line which is bold is what i am doing for opening the link in new
window.Actually this is a link which you can see in the next line which is
commented.
Now if i click on the link then it opens in the same window.What i want is
when i click on the link it should open in new window.
I have added the *title property* for the link as well

In the Firefox-Edit-Preferences-tab i have unchecked the tab Open new
windows in new tab instead

But when i run the script it error is displayed as
/usr/lib/ruby/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/firefox.rb:272:in
`attach': Unable to locate window, using title and
/test123/(Watir::Exception::NoMatchingWindowFoundException)
from user_create.rb:9

When i inspect the link following code is displayed a title=test123
href=/users/newNew user/a

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Opening new browser window from existing one

2010-11-29 Thread Amit Kulkarni
Hi,
Thanks for the reply.
I checked page code and this is what is inside the title tag

a href=/users/new view-source:http://localhost:3000/users/new
title=test123New user/a

This is also what i have written in the code.



On Mon, Nov 29, 2010 at 9:49 PM, Željko Filipin 
zeljko.fili...@wa-research.ch wrote:

 On Mon, Nov 29, 2010 at 5:13 PM, Amit Kulkarni amitkkulkarni...@gmail.com
 wrote:
  Browser.attach(:title, '/test123/')

  a title=test123 href=/users/newNew user/a

 If a link has title test123, it does not mean that the page that it leads
 to will have the same title. Inspect the page code and take a look what is
 inside title tag.

 Željko
 --
 watir.com - community manager
 watirpodcast.com - host
 testingpodcast.com - audio podcasts on software testing. all of them

  --
 Before posting, please read http://watir.com/support. In short: search
 before you ask, be nice.

 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com


-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Opening new browser window from existing one

2010-11-29 Thread Amit Kulkarni
Hi,
The page which is going to open has the following in the title tag.

titleUsers: new/title

I changed the title tag which is currently present on the page from where i
am going to click.
So following is displayed under title tag:

titleUsers: index/title    on the top

AND

a href=/users/new view-source:http://localhost:3000/users/new
title=Users: newNew user/a --- This is the link which i am going
to click..

So in the code i have changed which looks like as follows :

*Browser.attach(:title, '/Users: new/')*

Even changing the code i am getting the same error.

On Mon, Nov 29, 2010 at 10:19 PM, Željko Filipin 
zeljko.fili...@wa-research.ch wrote:

 This line does not care what is on the current page:

 Browser.attach(:title, '/test123/')

 it cares what is on the page that will be opened.

 So, open the page that will open after clicking the link manually, and take
 a look what it inside it's title tag (in header).

 Željko

  --
 Before posting, please read http://watir.com/support. In short: search
 before you ask, be nice.

 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com


-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Opening new browser window from existing one

2010-11-29 Thread Amit Kulkarni
Hi,
Currently i am using FireWatir on Linux.So i am just thinking is there any
problem in the code running on Linux and running it on windows.

On Tue, Nov 30, 2010 at 11:54 AM, Amit Kulkarni
amitkkulkarni...@gmail.comwrote:

 Hi,
 The page which is going to open has the following in the title tag.

 titleUsers: new/title

 I changed the title tag which is currently present on the page from where i
 am going to click.
 So following is displayed under title tag:

 titleUsers: index/title    on the top

 AND

 a href=/users/new title=Users: newNew user/a --- This is the link 
 which i am going to click..

 So in the code i have changed which looks like as follows :

 *Browser.attach(:title, '/Users: new/')*

 Even changing the code i am getting the same error.


 On Mon, Nov 29, 2010 at 10:19 PM, Željko Filipin 
 zeljko.fili...@wa-research.ch wrote:

 This line does not care what is on the current page:

 Browser.attach(:title, '/test123/')

 it cares what is on the page that will be opened.

 So, open the page that will open after clicking the link manually, and
 take a look what it inside it's title tag (in header).

 Željko

  --
 Before posting, please read http://watir.com/support. In short: search
 before you ask, be nice.

 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com




-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Opening new browser window from existing one

2010-11-30 Thread Amit Kulkarni
Hi,
This is my code:

require 'rubygems'
require 'firewatir'
Watir::Browser.default = 'firefox'
Browser = Watir::Browser.new
Browser.goto(http://localhost:3000/users;)   This goes to the
application
B = Browser.title.each { |d| puts d.to_s }  here i am checking if
that page(above) contains any title.The ans is true and i am getting
Users:

a = Browser.link(:title, Users:).exist?
puts a
sleep 5
Browser.attach(:title, '/Users:/') On this i get an error i.e.
`attach': Unable to locate window, using title and /Users:/
(Watir::Exception::NoMatchingWindowFoundException)

Now if i try
Browser.attach(:title, Users:)  --- No error is displayed and link is not
clicked.

--
Now the title on clicking the link is Users: which is same which i have
mentioned

I hope now the confusion is clear :)
Please let me know if you require any more info.



2010/11/30 Željko Filipin zeljko.fili...@wa-research.ch

 On Tue, Nov 30, 2010 at 7:24 AM, Amit Kulkarni amitkkulkarni...@gmail.com
 wrote:
  titleUsers: new/title

  titleUsers: index/title  on the top
  Browser.attach(:title, '/Users: new/')

 I am now completely confused what is the title of the page that you want to
 attach to. One of these could work:

 Browser.attach(:title = Users: new/)
 Browser.attach(:title = Users: index/)
 Browser.attach(:title = /Users: new/)
 Browser.attach(:title = /Users: index/)
 Browser.attach(:title = /Users/)

 More information:

 http://wiki.openqa.org/display/WTR/New+Browser+Windows


 Željko

 --
 Before posting, please read http://watir.com/support. In short: search
 before you ask, be nice.

 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com


-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Re: Opening new browser window from existing one

2010-11-30 Thread Amit Kulkarni
Hi Chandu,
I checked the attach code i have written is when the application is
opened.And if i try Browser.attach(:title, '/Users: new/')  then it gives me
error.

On Tue, Nov 30, 2010 at 7:00 PM, chandu.tennety chandu.tenn...@gmail.comwrote:

 From the original post, it looked like you were trying to attach the
 new window *before* clicking on the link that would open the window.
 Try clicking on the link first, then attach to the new window:

 Browser.link(:href, /users/new).click# = new window opens
 Browser.attach(:title, '/Users: new/')   # = attach to the new
 window

 Chandu

 On Nov 30, 4:08 am, Željko Filipin zeljko.fili...@wa-research.ch
 wrote:
  On Tue, Nov 30, 2010 at 7:24 AM, Amit Kulkarni 
 amitkkulkarni...@gmail.com
  wrote:
 
   titleUsers: new/title
   titleUsers: index/title  on the top
   Browser.attach(:title, '/Users: new/')
 
  I am now completely confused what is the title of the page that you want
 to
  attach to. One of these could work:
 
  Browser.attach(:title = Users: new/)
  Browser.attach(:title = Users: index/)
  Browser.attach(:title = /Users: new/)
  Browser.attach(:title = /Users: index/)
  Browser.attach(:title = /Users/)
 
  More information:
 
  http://wiki.openqa.org/display/WTR/New+Browser+Windows
 
  Željko

 --
 Before posting, please read http://watir.com/support. In short: search
 before you ask, be nice.

 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.comhttp://groups.google.com/group/watir-general%0awatir-general+unsubscr...@googlegroups.com


-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Opening new browser window from existing one

2010-12-01 Thread Amit Kulkarni
Hi Vishavdeep,
I got my problem solved.yes my app does not have the code to open in new
window.
Actually i totaly misunderstood the attach method.
Now got the concept and problem is solved

Thanks a lot for notifying me.

On Wed, Dec 1, 2010 at 1:20 PM, Sharma Vishav sharma.vis...@gmail.comwrote:

 Hi Amit,

 does your application code has code to open a new window when you click on
 the link. e.g. use target attribute of href tag.

 When you click link manually do you get a new window opened ?  why do you
 want to open a new window from your watir script ?

 cheers
 Vishavdeep

 On Tue, Nov 30, 2010 at 5:13 AM, Amit Kulkarni amitkkulkarni...@gmail.com
  wrote:

 Hello all,
 Can we open a new browser window from the existing one using Firewatir for
 Linux and for Watir for windows:
 Following are my gem versions:

 firewatir (1.6.7, 1.6.5)

 Following is my code:
 require 'rubygems'
 require 'firewatir'
 Watir::Browser.default = 'firefox'
 Browser = Watir::Browser.new
 Browser.goto(http://localhost:3000/users;)
 sleep 5
 *Browser.attach(:title, '/test123/')*
 #Browser.link(:href, /users/new).click
 Browser.text_field(:name, user[name]).set(amit)
 Browser.text_field(:name, user[description]).set(Qa Engineer)
 Browser.select_list(:name, user[role]).select(Hr)
 Browser.radio(:id, user_category_hr).set
 Browser.button(:value, Create).click
 Browser.link(:href, /users).click

 The line which is bold is what i am doing for opening the link in new
 window.Actually this is a link which you can see in the next line which is
 commented.
 Now if i click on the link then it opens in the same window.What i want is
 when i click on the link it should open in new window.
 I have added the *title property* for the link as well

 In the Firefox-Edit-Preferences-tab i have unchecked the tab Open new
 windows in new tab instead

 But when i run the script it error is displayed as
 /usr/lib/ruby/gems/1.8/gems/firewatir-1.6.7/lib/firewatir/firefox.rb:272:in
 `attach': Unable to locate window, using title and
 /test123/(Watir::Exception::NoMatchingWindowFoundException)
 from user_create.rb:9

 When i inspect the link following code is displayed a title=test123
 href=/users/newNew user/a


  --
 Before posting, please read http://watir.com/support. In short: search
 before you ask, be nice.

 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com


  --
 Before posting, please read http://watir.com/support. In short: search
 before you ask, be nice.

 watir-general@googlegroups.com
 http://groups.google.com/group/watir-general
 watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com


-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com