Re: [wtr-general] `assert_exists': Unable to locate element

2010-08-13 Thread Željko Filipin
On Fri, Aug 13, 2010 at 1:21 PM, cyril.gonsal...@mastek.com 
cyril.gonsal...@mastek.com wrote:
 if yes then how to access objects e.g textfield in the browser i.e.
 opened by clicking the link in another browser

You want to attach to another browser window?

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

Željko
--
watir.com - community manager
watirpodcast.com - host
testingpodcast.com - audio podcasts on software testing. all of them
vidipodkast.com - pričamo o hardveru, softveru i časopisu Vidi

-- 
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: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


RE: [wtr-general] `assert_exists': Unable to locate element

2010-08-13 Thread Cyril A. Gonsalves
Gr8 work dude……

Really helpful
MASTEK LTD.
In the US, we're called MAJESCOMASTEK

~~
Opinions expressed in this e-mail are those of the individual and not that of 
Mastek Limited, unless specifically indicated to that effect. Mastek Limited 
does not accept any responsibility or liability for it. This e-mail and 
attachments (if any) transmitted with it are confidential and/or privileged and 
solely for the use of the intended person or entity to which it is addressed. 
Any review, re-transmission, dissemination or other use of or taking of any 
action in reliance upon this information by persons or entities other than the 
intended recipient is prohibited. This e-mail and its attachments have been 
scanned for the presence of computer viruses. It is the responsibility of the 
recipient to run the virus check on e-mails and attachments before opening 
them. If you have received this e-mail in error, kindly delete this e-mail from 
desktop and server.
~~

-- 
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: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] `assert_exists': Unable to locate element

2010-08-13 Thread arihan sinha
you have to attach that new windows, do the activities and then close that
and come back to your original browser.

in my ruby+watir framework I use the below if any new window opens where i
need to do anything

if attach_url(/url in reg exp/) then

enter_text_into_text_field_text(Enter the value in text field, entry,
abc)

# do what ever you want to do in this new window
# then close this new window
end

the attach_url and enter_text_into_text_field are called from testbase.rb

def enter_text_into_text_field_text(title, name, value)
  startAction title, type ' + value + ' in ' + name + ' text field

  if no_fatal_error then
   begin
  $ie.text_field(:name, name).set(value)
  logPass
  rescue = e
   handleFail e
  end
  end
 end

def attach_url(urlName)
  startAction opening new IE instance, urlName.to_s
  if no_fatal_error then
  begin
  new_ie = Watir::IE.attach(:url, urlName)
  new_ie.set_fast_speed
  @stored_ie = $ie
  $ie = new_ie
  logPass
  return true
  rescue = e
  @fatal_error=true
   handleFail e
  end
  end

  return false
end

On Fri, Aug 13, 2010 at 12:21 PM, cyril.gonsal...@mastek.com 
cyril.gonsal...@mastek.com wrote:

 Hi,

 I am writing script for a testcase below.

 1. Open Link abc.htm
 2. Click link chat me on abc.htm
 3. Enter text in the testfield on the newly opened page
 4. Click submit button

 While written script for above like this


 # Reuired libraries

  require 'watir'

  site_text = http://localhost:8080/XXX/a.htm;
  ie = Watir::IE.new
  ie.goto(site_text)
  ie.link(:text,Chat me).click

 ie.text_field(:name,entry).set abc # text field on the opened link


 I get below error messge :

 `assert_exists': Unable to locate element, using :name,
 entry (Watir::Exception::UnknownObjectException)
from
 C:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
 288:in `enabled?'
from
 C:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
 60:in `assert_enabled'
from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
 input_elements.rb:327:in `set'
from D:/Ruby/rbC1.tmp:15
 Complete(1)


 The problem could be because of the new browser window.

 if yes then how to access objects e.g textfield in the browser i.e.
 opened by clicking the link in another browser

 --
 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: watir-general@googlegroups.com
 To unsubscribe: 
 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.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


RE: [wtr-general] `assert_exists': Unable to locate element

2010-08-13 Thread Cyril A. Gonsalves
Thanks a lot for useful info...
MASTEK LTD.
In the US, we're called MAJESCOMASTEK

~~
Opinions expressed in this e-mail are those of the individual and not that of 
Mastek Limited, unless specifically indicated to that effect. Mastek Limited 
does not accept any responsibility or liability for it. This e-mail and 
attachments (if any) transmitted with it are confidential and/or privileged and 
solely for the use of the intended person or entity to which it is addressed. 
Any review, re-transmission, dissemination or other use of or taking of any 
action in reliance upon this information by persons or entities other than the 
intended recipient is prohibited. This e-mail and its attachments have been 
scanned for the presence of computer viruses. It is the responsibility of the 
recipient to run the virus check on e-mails and attachments before opening 
them. If you have received this e-mail in error, kindly delete this e-mail from 
desktop and server.
~~

-- 
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: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com