# Embed tag with watir

**URL:** <https://www.ruby-forum.com/t/embed-tag-with-watir/172273>\
**Category:** Ruby\
**Created:** [July 18, 2009, 8:49am UTC](https://www.ruby-forum.com/t/embed-tag-with-watir/172273 "2009-07-18T08:49:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jazzezravi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/71e660/32.png) [@jazzezravi](https://www.ruby-forum.com/u/jazzezravi)\
**Post date:** [July 18, 2009, 8:49am UTC](https://www.ruby-forum.com/t/embed-tag-with-watir/172273/1 "2009-07-18T08:49:40Z")

</div>

1. One OBJECT is available.

2. The source code for the OBJECT is

1. I need to click the OBJECT.

I have tried:

$ie.element\_by\_xpath(“//embed[@id=‘uploaderapi\_swf’]”)  
==\>  
main.rb:18: undefined method `click’ for nil:NilClass (NoMethodError)

THE FULL CODE is :

require ‘rubygems’  
require ‘watir’  
$ie=Watir::IE.new

#$ie.maximize()  
$ie.goto(“[http://www.youtube.com/](http://www.youtube.com/)”)  
sleep(2)  
$ie.link(:text, ‘Sign In’).click  
sleep(2)  
$ie.form(:id, ‘gaia\_loginform’).text\_field(:id,  
‘Email’).set(‘jazzezravi’)  
$ie.form(:id, ‘gaia\_loginform’).text\_field(:id, ‘Passwd’).set(‘jazzez’)  
$ie.button(:name, ‘signIn’).click  
sleep(2)  
$ie.link(:text, ‘Upload Video File’).click  
sleep(2)

#Here i am struggling to click the object “upload video”

$ie.element\_by\_xpath(“//embed[@id=‘uploaderapi\_swf’]”) #==\> NEED HELP  
HERE

Please help to do this
