Hi Linden,
*I am pasting my script code below*
require 'watir'
require 'oci8'
require 'dbi'
ie = Watir::IE.new
ie.goto("http://localhost:3333/venus")
#ie.bring_to_front;
#ie.maximize;
ie.textField(:id, "login:username").set("admin");
ie.textField(:id, "login:password").set("admin");
ie.button(:name, "login:loginButton").click;
ie.link(:id,"globalForm:customfieldCategoriesLink").click;
puts 'Customfields Categories link clicked'
ie.goto("http://localhost:3333/venus/admin/customfield-categories.seam")
ie.button(:id, "globalForm:cfCatagCreateButton").click;
puts 'Customfields Categories New button clicked'
ie.goto("http://localhost:3333/venus/admin/customfield-category.seam")
cName =ie.textField(:id, "globalForm:categoryName").set("naresh");
desc= ie.textField(:id, "globalForm:description").set("desc");
query = "insert into CUSTFIELD_CATEGORIES values('"+cName+"','"+desc+"')"
connection = OCI8.new('venus', 'venus', '//localhost:1521/devcms')
connection.exec(query)
connection.logof
puts "Record inserted successfully"
* I am getting exception below*
Customfields Categories link clicked
Customfields Categories New button clicked
(eval):3:in `invoke': unknown property or method `readOnly'
(WIN32OLERuntimeErro
r)
HRESULT error code:0x80020006
Unknown name. from (eval):3:in `readonly?'
from
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/input_elements
.rb:240:in `assert_not_readonly'
from
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/input_elements
.rb:328:in `set'
from Venus-Admin-Insert.rb:22
On 18 June 2010 10:16, Chuck van der Linden <[email protected]> wrote:
> On Jun 16, 11:07 pm, naresh <[email protected]> wrote:
> > Hi All,
> >
> > I want to automate data insertion through watir script.
> > I want to take data from text field and create insert query.
> > If anyone have done already, please guide me.
> >
> > I tried to set value though set method textField, but when i tried to
> > retrieve, i got exception read only in set.
> >
> > Thanks,
> > Naresh
>
> There are examples in the Watir Wiki
> http://wiki.openqa.org/display/WTR/Examples
> that deal with reading from files, or excel files etc.
>
> In terms of the specific problem you are having with the text field,
> can you post a small sample of the code that's working or not working,
> and what error you are getting. That's generally the best way to
> enable folks to help you.
>
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> You received this message because you are subscribed to
> http://groups.google.com/group/watir-general
> To post: [email protected]
> To unsubscribe:
> [email protected]<watir-general%[email protected]>
>
--
Warm Regards,
Naresh Vatsal
9052293000
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
You received this message because you are subscribed to
http://groups.google.com/group/watir-general
To post: [email protected]
To unsubscribe: [email protected]