I am automating Idit application using Ruby, at one screen I can't feed
the input to one of the text box using the code
$browser.select_field(:id,"").set() what could be the reason.?
Raj
···
--
Posted via http://www.ruby-forum.com/.
I am automating Idit application using Ruby, at one screen I can't feed
the input to one of the text box using the code
$browser.select_field(:id,"").set() what could be the reason.?
Raj
--
Posted via http://www.ruby-forum.com/.
I think it's usually select_list, and you haven't entered an id to look
for. You also haven't given a value to set to.
--
Posted via http://www.ruby-forum.com/.
There are a few reasons it might not work.
Try navigating to the page using a Watir browser running through
Interactive Ruby so you can do some live experimentation.
Try using longer paths, like specifying any parent elements (frames in
particular):
thisfield =
$browser.frame(:index,0).text_field(:id,'IDITForm@pmlPercentage')
Ensure that the page is fully loaded before looking for the field, In
order to do this, I use Watir-Webdriver rather than just Watir alone, so
I tend to use when_present:
$browser.text_field(:id,'IDITForm@pmlPercentage').when_present.set(23)
Otherwise, try locating all (or some of) the text fields and iterating
through them to make sure you have the details exactly right (name, id,
value, etc.):
$browser.text_fields.each {|el| puts el.id }
--
Posted via http://www.ruby-forum.com/.
Hi,
Really so much thank you for your reply, Actually I have already solved
the problem, I solved the problem by executing via IRB mode in dos mode,
But confusion still reamins because I was not able to identified what
that problem was. But after i went through the IRB mode,scripts is also
working fine, i haven't done any changes in scripts. . And some of your
codings(give below) are useful for me for further work. Thank you so
much for you reply.
"$browser.text_field(:id,'IDITForm@pmlPercentage').when_present.set(23)"
"$browser.text_fields.each {|el| puts el.id }"
Thanks,
Raj
--
Posted via http://www.ruby-forum.com/.
No problem, I struggled to find documentation when starting out with
Watir, but it's getting better all the time.
These are handy resources:
http://www.rubydoc.info/github/jarib/watir-webdriver/
--
Posted via http://www.ruby-forum.com/.
Hi Joel Pearson
I am using eclipse for automation,when i am executing the program using
debug mode,Once i executed some lines, is it possible to bring the
control back to some lines before, and continue execution from there or
debugging from there?
Raj
--
Posted via http://www.ruby-forum.com/.
Hi Joel Pearson
please look at this error,
[15:51:13] [ERROR] : Error attaching: excelOpen: false , fileOpen:
false, file:
C:\work1\IDITTestAutomationProject\TestData\TestData_MyCopy.xls error:
Open
OLE error code:800A03EC in Microsoft Office Excel
'TestData_MyCopy.xls' cannot be accessed. The file may be
corrupted, located on a server that is not responding, or read-only.
HRESULT error code:0x80020009
Exception occurred.
Open
OLE error code:800A03EC in Microsoft Office Excel
'TestData_MyCopy.xls' cannot be accessed. The file may be
corrupted, located on a server that is not responding, or read-only.
HRESULT error code:0x80020009
Exception occurred.
I encounter this error so often, I haven't opened any Excel file during
execution, But still i am encountering this error, what is the reason ?
But if I close the eclipse and open again then this won't be coming.
Raj
--
Posted via http://www.ruby-forum.com/.
i don't understand, what do you mean by "unsubscribe"?
Raj
--
Posted via http://www.ruby-forum.com/.
Hi Arlen
Thank you , I was scared when i saw the word unsubscribe,because i
thought somebody was asking me to unsubscribe. Now it's clear .
Raj
--
Posted via http://www.ruby-forum.com/.
hi Joel Pearson
I have a question, For an example consider that I have to execute 10
test case, but at the first attempt it is found that internet has been
down, in such situation, it is not terminating the execution, but it
tries to run the remaining test cases, any idea to stop this as soon as
it realizes internet connection has been down.? It should not execute
the remaining test cases as soon as it is found internet connection has
been down.
Raj
--
Posted via http://www.ruby-forum.com/.
Firstly, please start any new question as a new thread so others can
find answers more easily in future.
Anyways, you want to look into this kind of thing:
http://www.tutorialspoint.com/ruby/ruby_exceptions.htm
If you're receiving a Timeout exception from Watir but your program
keeps running then you're probably handling the exception. What you need
to do is terminate when you hit that kind of exception. If you're
calling a method and the exception is handled inside that method, you'll
need to return a value which will be recognised by the parent and used
in a decision as to whether to continue or terminate execution.
For example (caveat lector, untested code):
________________________________________________
def mymethod
b = Watir::Browser.new
b.goto 'www.purple.com'
b.close
return true
rescue Timeout::Error
puts "Page load timed out"
return false
rescue => e
puts e
return false
ensure
b.close rescue nil
end
10.times do |iteration|
unless mymethod
puts "Error occurred, terminating process"
exit
else
puts "Succeeded: #{iteration}"
end
end
--
Posted via http://www.ruby-forum.com/.
Yeah I will start a new thread if i have question in future, Thank you
so much.
Raj
--
Posted via http://www.ruby-forum.com/.
hi,
I couldn't create a new thread, If press submit button, it came back to
the preview window .So I am posting here.
I have installed Ruby 1.8.7 and while i was trying to install "gem
install watir" it gives the error "ERROR: Error installing
watir:win32-process requires Ruby version > 1.9.0."But it was not the
case when i installed the Ruby last time? Is there any way to install
win32-process in version 1.8.7?Or is there any way can i able to install
"gem install watir" without any error?
Raj
--
Posted via http://www.ruby-forum.com/.
You'd need to install a version compatible with 1.8.7:
"gem install watir -v (version number here)"
But a far better approach is to upgrade to Ruby 1.9.3.
--
Posted via http://www.ruby-forum.com/.
"gem install watir -v (version number here)"
I used this "gem install watir -v 3.0.0" (the reason I have used is,I
have watir 3.0.0 for Ruby 1.8.7 in my computer already)Now i am
installing into another system. But anyway i couldn't succeed with
installation using the above syntax.
Raj
--
Posted via http://www.ruby-forum.com/.
Without a more descriptive response than "i couldn't succeed" ,it's
impossible to suggest anything relevant to combat your problem.
Other than "USE RUBY 1.9.3!", of course.
--
Posted via http://www.ruby-forum.com/.
I used 'gem install watir -v 3.0.0' ,But i failed to install this. Error
occurred suggesting me to install watir 1.9.0.
Raj
--
Posted via http://www.ruby-forum.com/.
hi,
we usually run ruby program by giving the command
ruby prog.rb
But here our source code is needed. But Is there any way we could
convert this file into .exe and then run the program directly by double
clicking that file or directly typing name of the file in the command
prompt?
Raj
--
Posted via http://www.ruby-forum.com/.