Hie,
The solution provided was helpful in tracing the element of the
filename that was saved in filename.php.html(web page complete)
On running the same code on the original .php file it gave me the
following error.

C:\Documents and Settings\tcsadmin\Desktop>imageclicker.rb
name:
C:/Ruby186/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/
element.rb:907:in `assert_exists':
Unable to locate element, using :xpath, "/html/body/div/div/div[6]/div/
fieldset/table[2]/tbody/tr[3]/td[8]/
input" (Watir::Exception::UnknownObjectException)
from C:/Ruby186/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/
element.rb:894:in `attribute_value'
from C:/Documents and Settings/tcsadmin/Desktop/imageclicker.rb:18
from C:/Documents and Settings/tcsadmin/Desktop/imageclicker.rb:16:in
`each'
        from C:/Documents and Settings/tcsadmin/Desktop/
imageclicker.rb:16

Please help :-(

On Feb 18, 10:29 pm, Сергей Демьянчук <sergeydemjanc...@gmail.com>
wrote:
> Ok, I use IE via watir, so
>
> using given xpath you may locate element (not image, i call this input text
> as element, cuz in fact it is an watir element: Watir::TextField) and, for
> example, extract desired attributes:
>
> attributes_array = ['name', 'src', 'alt', 'title']
> *
> attributes_array.each do |attr|
> puts "#{attr}:"
> puts ie.text_field(:xpath,
> "/html/body/div/div/div[6]/div/fieldset/table[2]/tbody/tr[3]/td[8]/input").attribute_value("#{attr}")
> end*
>
> My output:
> => ["name", "src", "alt", "title"]
>
> name:
> SDP_0_1
> src:
> file:///H:/WebPlayer/main1.php_files/play-icon-%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20big.png
> alt:
> Open SDP file
> title:
> Open SDP file
> => ["name", "src", "alt", "title"]
> irb(main):115:0>
>
> Thanks,
> Sergii
>
> 2011/2/18 Ashu <ashay.n...@gmail.com>
>
> > Well let me recorrect the path
> > as it is
> > /html/body/div/div/div[6]/div/fieldset/table[2]/tbody/tr[3]/td[8]/
> > input
>
> > the input contains
> > <input type="image" halign="right" valign="middle" title="Open SDP
> > file" alt="Open SDP file" src="main.php_files/play-icon-big.png"
> > name="SDP_0_0">
>
> > On Feb 18, 3:33 pm, Сергей Демьянчук <sergeydemjanc...@gmail.com>
> > wrote:
> > > Hi, Ashu,
>
> > > You wrote before that you use Firebug, could you please give xpath from
> > > firebug for desired element ?
>
> > > 2011/2/18 Chuck van der Linden <sqa...@gmail.com>
>
> > > > are there Frames on the page perhaps?
>
> > > > On Feb 17, 11:41 pm, Ashu <ashay.n...@gmail.com> wrote:
> > > > > On trying the above line of code
> > > > > irb displays
> > > > > irb(main):045:0> ie.image(:alt, 'Open SDP file').wait_until_present
> > > > > Watir::Exception::UnknownObjectException: Unable to locate element,
> > > > > using :alt,"Open SDP file"
> > > > >         from C:/Ruby186/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/
> > > > > firewatir/element.rb:907:in `assert_exists'
> > > > >         from C:/Ruby186/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/
> > > > > firewatir/element.rb:1266:in `method_missing'
> > > > >         from (irb):45
> > > > >         from :0
> > > > > :-(
> > > > > On Feb 17, 2:00 pm, Alastair Montgomery <doodl...@gmail.com> wrote:
>
> > > > > > Is it possible that you are trying to access the element before it
> > has
> > > > had
> > > > > > time to render?
> > > > > > We use jQuery and its elements sometime take a while to render
> > fully.
>
> > > > > > Try putting a line of *ie.image(:alt, 'Open SDP
> > > > file').wait_until_present* before
> > > > > > you attempt to click on it.- Hide quoted text -
>
> > > > > - Show quoted text -
>
> > > > --
> > > > Before posting, please readhttp://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...>
>
> > --
> > Before posting, please readhttp://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...>

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

Reply via email to