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

> 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  > 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 "> href="/users/new">New user"
>>
>>
>>  --
>> 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
>>
>
>  --
> 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
>

-- 
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-12-01 Thread Amit Kulkarni
Hi Chuck,
Thanks a lot for explaining.I got the problem solved.
Actually there was no code written in the app to open in the window.So it
was not recognizing.
Also my attach concept was opposite to what it does.i.e. i thought attach
method opens a new browser which is wrong
Firstly there should be a code which opens in the new window then we need to
call attach method.

Sorry for troubling all of you who have helped solving the problem :)


2010/11/30 Chuck van der Linden 

> You are still trying to attach to the page before it is opened.
>
> 1) Do not confuse the The Title TAG which is part of the page header
> and sets the title of the webpage (which is usually displayed as the
> title of the browser window)  with a 'title' Attribute, which can be
> set for any number of different tags within a page.. such 'title'
> attributes apply only to the tag(s) within which they are defined, and
> with respect to links have ZERO effect on the title of the page that
> is loaded after the link is clicked.  If you click a link and a new
> page opens, that page will get its title from the title TAG in the
> page header.  Also link's need not have a title attribute defined, so
> often it's not the best way to identify a link.
>
> 2) Attach does not click links, it does ONE thing and one thing only,
> it attaches a browser object in your code to an active browser window
> on the system.  Period.  For that to work the window has to exist,
> FIRST before you invoke the attach function.
>
> 3) The code you provided below NEVER clicks a link, so no new page or
> browser window is going to get loaded/created.  All it does is check
> for the presence of a link with a specific title attribute, it never
> clicks that link.
>
> 4) Minor detail.. when writing in the Ruby language, most folks
> reserve names like 'Browser' when defining a class, and use a
> lowercase variable name 'browser' when creating an instance of the
> class.  I recommend observing that convention as it will make your
> code less confusing to other folks who are used to seeing things done
> that way.
>
> SO in summary:
>
>  FIRST click the link, e.g.
>
> browser.link(:text. 'New user').click
>
> THEN after the clicking of that link has opened a new window, Attach
> to the window e.g.
>
> browser.attach(:title, '/Users: new/')
>
> If it takes a bit of time for the new window to open, you might want
> to put a short sleep between the two commands.   (in general, the way
> to know if that's needed is if it works fine done manually from an IRB
> session, but fails when running your script.)
>
> Try revising the code below to the above into account.  If you are
> still getting an error, provide the specific text of the error in
> order to assist others in troubleshooting the problem with your code.
>
>
>
> On Nov 30, 6:45 am, Amit Kulkarni  wrote:
> > 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 
> >
> >
> >
> > > On Tue, Nov 30, 2010 at 7:24 AM, Amit Kulkarni <
> amitkkulkarni...@gmail.com>
> > > wrote:
> > > > Users: new
> >
> > > > Users: index  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 => &q

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

> 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 
> wrote:
> > On Tue, Nov 30, 2010 at 7:24 AM, Amit Kulkarni <
> amitkkulkarni...@gmail.com>
> > wrote:
> >
> > > Users: new
> > > Users: index  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.com<http://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-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 

> On Tue, Nov 30, 2010 at 7:24 AM, Amit Kulkarni 
> wrote:
> > Users: new
>
> > Users: index  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.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
wrote:

> Hi,
> The page which is going to open has the following in the title tag.
>
> Users: new
>
> 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:
>
> Users: index    on the top
>
> AND
>
> New user --- 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.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.

Users: new

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:

Users: index    on the top

AND

http://localhost:3000/users/new>"
title="Users: new">New user --- 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.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,
Thanks for the reply.
I checked page code and this is what is inside the title tag

http://localhost:3000/users/new>"
title="test123">New user

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 
> wrote:
> > Browser.attach(:title, '/test123/')
>
> > New user"
>
> 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.com
>

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

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


[wtr-general] 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 "New user"

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

> 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 
>
> 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 
>>
>> 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 
>>>
>>> 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:
>>>>>   ie.link(:href, /page/).click
>>>>>
>>>>> Try removing those double quotes.
>>>>> Hope it works.
>>>>>
>>>>>
>>>>>
>>>>> 2010/11/22 Amit Kulkarni 
>>>>>
>>>>> Thanks a lot for the link.
>>>>&

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 

> 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:
>>   ie.link(:href, /page/).click
>>
>> Try removing those double quotes.
>> Hope it works.
>>
>>
>>
>> 2010/11/22 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

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
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:
>   ie.link(:href, /page/).click
>
> Try removing those double quotes.
> Hope it works.
>
>
>
> 2010/11/22 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.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
>>
>
>  --
> 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
>

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

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

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


[wtr-general] 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
Destroy

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


[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
wrote:

> 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  > 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  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
>> > 
>> > Test
>> > Unpublished
>> > 
>> > 
>> > 
>> > Update
>> > 
>> > 
>> > input id="act2_165_delete" type="radio" value="delete" name="act2
>> > [165]"/>
>> > Delete
>> > 
>> > 
>> >
>> > Now here Test 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
>> > wrote:
>> >
>> >
>> >
>> >
>> >
>> > > 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
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
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  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
> > 
> > Test
> > Unpublished
> > 
> > 
> > 
> > Update
> > 
> > 
> > input id="act2_165_delete" type="radio" value="delete" name="act2
> > [165]"/>
> > Delete
> > 
> > 
> >
> > Now here Test 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
> > wrote:
> >
> >
> >
> >
> >
> > > 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: 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 

> 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 
>
> Thanks for the help.
>> Following is the page source.
>>
>>  
>>  
>>
>>
>>  
>> 
>>
>>
>>  
>>   welcome > onclick="window.open(this.href);return false;" title="nikeman">nikeman 
>>    
>>
>>
>>  
>>   
>>
>>  
>>
>>  
>>
>>
>> 
>>  Nikes Active features
>>
>>
>>  
>>  Photogallery
>>
>>  
>>
>>
>>
>> 
>>  > action="/Nikes/photo_gallery/attachments/delete_multiple" method="post">
>>
>>
>>  
>>   Photogallery
>>
>>   
>> 
>>
>>  
>> > onclick="if(!validate_delete('input'))  { alert('Please select a photo'); 
>> return false;} " />
>>
>> > href="/Nikes/photo_gallery/attachments/new?media=print" class="ar-normal" 
>> title="Add new photo">Add new photo
>>
>>
>>   
>> 
>> 
>>
>>   *
>> 
>>
>>   > name="attachment[218]" type="checkbox" value="1" />
>>
>>
>>   > src="http://s3.amazonaws.com/staging-brandpotion-prints/images/63/large_thumb.jpg";
>>  title="Photogallerysanity1" />
>>
>> *
>>
>> *  > href="/Nikes/photo_gallery/attachments/218/edit?media=print" 
>> class="underline">Edit *
>>
>>   
>>
>>
>>  
>>  
>>  
>>
>>
>>
>> 
>>  
>>
>>  
>> 
>>
>> 
>>
>>
>>
>>
>> 2009/10/23 Wesley Chen 
>>
>> 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 
>>>
>>> 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  wrote:
>>>>
>>>>> can you try this?
>>>>> Browser.link(:xpath,"//i...@title='Photogallerysanity']/a").flash() or
>>>>> click()
>>>>>
>>>>> - Angrez
>

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

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

 
 
 


  welcome nikeman    

 

 
 


Nikes Active features

Photogallery



   
   


 Photogallery
 




Add new photo
 


  *
  
  http://s3.amazonaws.com/staging-brandpotion-prints/images/63/large_thumb.jpg";
title="Photogallerysanity1" />
*

*  Edit *
  
 

 



 

 






2009/10/23 Wesley Chen 

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

Test
Unpublished



Update


input id="act2_165_delete" type="radio" value="delete" name="act2
[165]"/>
Delete



Now here Test 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
wrote:

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


http://s3.amazonaws.com/staging-brandpotion-prints/images/63/large_thumb.jpg
" alt="Photogallerysanity"/>
Edit


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

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

2009/10/21 Amit Kulkarni 

>
>
> -- Forwarded message --
> From: Amit Kulkarni 
> 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-22 Thread Amit Kulkarni
Any suggestions on the above issue?
Please help

On Wed, Oct 21, 2009 at 5:49 PM, Amit Kulkarni
wrote:

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


http://s3.amazonaws.com/staging-brandpotion-prints/images/63/large_thumb.jpg
" alt="Photogallerysanity"/>
Edit


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



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

2009-10-21 Thread Amit Kulkarni
-- Forwarded message --
From: Amit Kulkarni 
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
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 
> 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
-~--~~~~--~~--~--~---



[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] Problem with Checkbox

2009-10-21 Thread Amit Kulkarni
Hello,
I have this html script.



Ratingsanity1




The scenario is i want to click on the checkbox which has title
"Ratingsanity1".
Now here i can tick the checkbox by using the name method but the no. isn't
going to be same all the time.
I tried following code but still no success.
Please help.
1: Browser.checkbox(:after?, Browser.cell(:text, "Ratingsanity1")).click

--~--~-~--~~~---~--~~
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: 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  wrote:
> >  > 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: 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
-~--~~~~--~~--~--~---