Re: [wtr-general] Re: deleting text in a RichTextArea

2012-09-25 Thread Oscar Rieken
sorry didnt see the code I have never had success with them on the same line
I think that if you ended up at the front of the line and press backspace
it would have no effect on the text there
What i was suggesting is selecting all of the text and deleting it

@browser.frame(:class=>/gwt-**RichTextArea/).send_keys [:control,"a"]
@browser.frame(:class=>/gwt-**RichTextArea/).send_keys :delete

or
@browser.frame(:class=>/gwt-**RichTextArea/).send_keys :end
@browser.frame(:class=>/gwt-**RichTextArea/).send_keys [:shift,:home]
@browser.frame(:class=>/gwt-**RichTextArea/).send_keys :delete

On Tue, Sep 25, 2012 at 4:51 PM, Joe Fleck  wrote:

> Hi Oscar,
>
> Thank you for responding.
>
> Isn't that what I am doing already?  I am not fimiliar with send_keys
> other than typing out text.
>
> Thank you,
> Joe
> On Sep 25, 2012 2:04 PM, "Oscar Rieken"  wrote:
>
>> why not send control A and then delete
>>
>> On Tue, Sep 25, 2012 at 2:04 PM, Joe Fl  wrote:
>>
>>> The problem I am having is when this line of code is
>>> executed @browser.frame(:class=>/gwt-**RichTextArea/).click
>>> in Chrome the cursor is place at the end of the string and in Firefox
>>> the cursor ends up in front of the string.
>>>
>>> So the backspace isn't deleting the current text.
>>>
>>>
>>> Thank you and any help would be greatly appreciate.
>>> Joe
>>>
>>>
>>> On Tuesday, September 25, 2012 1:09:49 PM UTC-4, Joe Fl wrote:

 Hi everyone,

 I need to know if there is a better way to delete a string of text from
 a RichTextArea.


 Currently I handle it this way:
 @browser.frame(:class=>/gwt-**RichTextArea/).click
  # Erase old comment
 for rte in 
 1..@browser.frame(:class=>/**gwt-RichTextArea/).body.text.**length
 #GF0TARWCJU hasRichTextToolbar').body.**text.length
  # delete text by backspacing.
 @browser.frame(:class=>/gwt-**RichTextArea/).send_keys [:control,"a"],
 :backspace
  end

 Is there a better way to do this with watir-webdriver?


 Image Included:

 Thank you,
 Joe



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

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


[wtr-general] Re: Error security to access on nested frames

2012-09-25 Thread DerekC
Hi JuanH,

Did you manage to solve this? I have this for only one of the sub-frames... 
yet I can access others in the window.

This works:

@browser.frame( :id => "ivuFrm_page0ivu1" ).frame( :id => 
"ivuFrm_page0ivu0" ).frames.each do|f|
puts "-- -- -- id: " + f.id
end

... but this produces the error:

@browser.frame( :id => "ivuFrm_page0ivu1" ).frame( :id => 
"ivuFrm_page0ivu0" ).frame( :id => "ls-blindlayer-0" ).frames.each do|f|
puts "-- -- -- id: " + f.id
end


This site is in my trusted sites, and I relaxed the security (All options 
under "Scripting" enabled) as you did.
I have WinXP + IE 8 and the following gems:

   - activesupport (3.2.8, 3.2.6)
   - addressable (2.3.2, 2.2.8)
   - bigdecimal (1.1.0)
   - builder (3.1.3, 3.0.0)
   - childprocess (0.3.5, 0.3.2)
   - columnize (0.3.6)
   - commonwatir (3.0.0)
   - cucumber (1.2.1)
   - daemons (1.1.9, 1.1.8)
   - diff-lcs (1.1.3)
   - execjs (1.4.0)
   - factory_girl (4.1.0, 3.4.0)
   - ffi (1.1.5 x86-mingw32, 1.0.11)
   - gherkin (2.11.2 x86-mingw32, 2.11.0 x86-mingw32)
   - hoe (3.1.0, 3.0.7)
   - i18n (0.6.1, 0.6.0)
   - io-console (0.3)
   - json (1.7.5, 1.5.4)
   - libv8 (3.11.8.0, 3.3.10.4)
   - libwebsocket (0.1.5, 0.1.3)
   - mini_magick (3.2.1)
   - minitest (3.5.0, 2.5.1)
   - multi_json (1.3.6)
   - nokogiri (1.5.5 x86-mingw32)
   - nwrfc (0.0.5)
   - ParseTree (3.0.9)
   - pdf-forms (0.4.4)
   - pickle (0.4.11, 0.4.10)
   - rake (0.9.2.2)
   - rautomation (0.7.2)
   - rbx-require-relative (0.0.9)
   - rdiscount (1.6.8)
   - rdoc (3.12, 3.9.4)
   - redis (3.0.1)
   - ref (1.0.0)
   - rspec (2.11.0, 2.10.0, 1.3.0)
   - rspec-core (2.11.1, 2.10.1)
   - rspec-expectations (2.11.3, 2.10.0)
   - rspec-mocks (2.11.3, 2.10.1)
   - rubygems-update (1.8.24)
   - RubyInline (3.11.3, 3.9.0)
   - rubyzip (0.9.9, 0.9.8)
   - s4t-utils (1.0.4)
   - selenium-webdriver (2.25.0, 2.22.2)
   - sexp_processor (4.0.1, 3.2.0)
   - subexec (0.0.4)
   - syntax (1.0.0)
   - sys-proctable (0.9.1 universal-mingw32)
   - systemu (2.5.2, 2.5.1)
   - testjour (0.3.2)
   - user-choices (1.1.6.1)
   - watir (3.0.0)
   - watir-classic (3.2.0, 3.0.0)
   - watir-webdriver (0.6.1)
   - win32-api (1.4.8 x86-mingw32)
   - win32-process (0.6.6)
   - win32screenshot (1.0.7)
   - windows-api (0.4.2)
   - windows-pr (1.2.2)
   - xml-simple (1.1.1)
   - yajl-ruby (1.1.0 x86-mingw32)
   - ZenTest (4.8.2, 4.8.1)


Rgds,
Derek

On Friday, September 14, 2012 11:07:59 PM UTC+2, JuanH wrote:
>
> Hi Everyone, 
>
> I am trying to build a watir script for a full testing of my web 
> application.
> I must use Internet Explorer 8.
> It run very well, but when im trying to getting a page with nested frames, 
> it fails like this:
>
> 1) Error when i try to get nested frame's elements by name's frame
> ...
> $browser = Watir::IE.new
> $browser.goto my_url
> $browser.frame(:name,'frame_parent').frame(:name,'frame_child').link(:text=>'My
>  
> link').click()
>
> *StackTrace:*
> NoMethodError: unknown property or method: `documentelement'
> HRESULT error code:0x80020006
>   Nombre desconocido.
> from 
> D:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/page-container.rb:31:in
>  
> `method_missing'
> from 
> D:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/page-container.rb:31:in
>  
> `page'
> from 
> D:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/page-container.rb:55:in
>  
> `html'
> from (irb):77
> from D:/ruby/Ruby193/bin/irb:12:in `'
>
>
>
> 2) Error when i try to get nested frame's elements by index's frame
> ...
> $browser = Watir::IE.new
> $browser.goto my_url
> $browser.frame(:name,'frame_parent').frames[0].link(:text=>'My 
> link').click()
>
> *StackTrace:*
> Watir::Exception::FrameAccessDeniedException: IE will not allow access to 
> this frame for security reasons. You can work around this with 
> ie.goto(frame.src)
> from 
> D:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/frame.rb:38:in
>  
> `document'
> from 
> D:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/page-container.rb:31:in
>  
> `page'
> from 
> D:/ruby/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/page-container.rb:55:in
>  
> `html'
> from (irb):78
> from D:/ruby/Ruby193/bin/irb:12:in `'
>
>
> I can not use suggestions like " ... You can work around this with 
> ie.goto(frame.src) ... ", because my frame_parent has 3 frame childs and 
> all this frames comunicate by javascript. Working very with first frame 
> level ('parent_frame'), but error when getting second frame level 
> ('frame_child').
> All frames are in the same domain, in the same aplication, but even it 
> fails.
> I have been minimized my web-browser security restrictions (Trusted Sites 
> Zone, enable frame scripts, activex privs,..an entire time bomb) but 
> doesn't wok.
>
>
> Any help w

Re: [wtr-general] Re: deleting text in a RichTextArea

2012-09-25 Thread Joe Fleck
Hi Oscar,

Thank you for responding.

Isn't that what I am doing already?  I am not fimiliar with send_keys other
than typing out text.

Thank you,
Joe
On Sep 25, 2012 2:04 PM, "Oscar Rieken"  wrote:

> why not send control A and then delete
>
> On Tue, Sep 25, 2012 at 2:04 PM, Joe Fl  wrote:
>
>> The problem I am having is when this line of code is
>> executed @browser.frame(:class=>/gwt-**RichTextArea/).click
>> in Chrome the cursor is place at the end of the string and in Firefox the
>> cursor ends up in front of the string.
>>
>> So the backspace isn't deleting the current text.
>>
>>
>> Thank you and any help would be greatly appreciate.
>> Joe
>>
>>
>> On Tuesday, September 25, 2012 1:09:49 PM UTC-4, Joe Fl wrote:
>>>
>>> Hi everyone,
>>>
>>> I need to know if there is a better way to delete a string of text from
>>> a RichTextArea.
>>>
>>>
>>> Currently I handle it this way:
>>> @browser.frame(:class=>/gwt-**RichTextArea/).click
>>>  # Erase old comment
>>> for rte in 
>>> 1..@browser.frame(:class=>/**gwt-RichTextArea/).body.text.**length
>>> #GF0TARWCJU hasRichTextToolbar').body.**text.length
>>>  # delete text by backspacing.
>>> @browser.frame(:class=>/gwt-**RichTextArea/).send_keys [:control,"a"],
>>> :backspace
>>>  end
>>>
>>> Is there a better way to do this with watir-webdriver?
>>>
>>>
>>> Image Included:
>>>
>>> Thank you,
>>> Joe
>>>
>>>
>>>
>>>  --
>> 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
>>
>
>  --
> 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
>

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


[wtr-general] Re: Unable to click on the links having specific description

2012-09-25 Thread Dan
You could do something like this

if $ie.link.text.match(/^test/) then $ie.link.click end

On Tuesday, September 25, 2012 9:40:07 AM UTC-4, praveen kumar wrote:
>
> Hi All,
>
> My requirement is to click on the links present in the table which have 
> text starting with "*test*". I have written the code as below
>
> table = $ie.table(:id, "ctl00_mContentPlaceHolder_gvElobratedItems") 
> table.links.each do |link| 
>
> *# Here I need to click on the link starting with "test"* 
>  
> end
>
> So I am getting all the links present in the table. but not finding to 
> click the specific links with "test".
>
> Please let me know your thoughts
>
> Thanks,
> Praveen
>

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


Re: [wtr-general] Re: deleting text in a RichTextArea

2012-09-25 Thread Oscar Rieken
why not send control A and then delete

On Tue, Sep 25, 2012 at 2:04 PM, Joe Fl  wrote:

> The problem I am having is when this line of code is
> executed @browser.frame(:class=>/gwt-**RichTextArea/).click
> in Chrome the cursor is place at the end of the string and in Firefox the
> cursor ends up in front of the string.
>
> So the backspace isn't deleting the current text.
>
>
> Thank you and any help would be greatly appreciate.
> Joe
>
>
> On Tuesday, September 25, 2012 1:09:49 PM UTC-4, Joe Fl wrote:
>>
>> Hi everyone,
>>
>> I need to know if there is a better way to delete a string of text from a
>> RichTextArea.
>>
>>
>> Currently I handle it this way:
>> @browser.frame(:class=>/gwt-**RichTextArea/).click
>> # Erase old comment
>> for rte in 1..@browser.frame(:class=>/**gwt-RichTextArea/).body.text.**length
>> #GF0TARWCJU hasRichTextToolbar').body.**text.length
>> # delete text by backspacing.
>> @browser.frame(:class=>/gwt-**RichTextArea/).send_keys [:control,"a"],
>> :backspace
>> end
>>
>> Is there a better way to do this with watir-webdriver?
>>
>>
>> Image Included:
>>
>> Thank you,
>> Joe
>>
>>
>>
>>  --
> 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
>

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


[wtr-general] Re: deleting text in a RichTextArea

2012-09-25 Thread Joe Fl
The problem I am having is when this line of code is 
executed @browser.frame(:class=>/gwt-RichTextArea/).click
in Chrome the cursor is place at the end of the string and in Firefox the 
cursor ends up in front of the string.

So the backspace isn't deleting the current text.


Thank you and any help would be greatly appreciate.
Joe

On Tuesday, September 25, 2012 1:09:49 PM UTC-4, Joe Fl wrote:
>
> Hi everyone,
>
> I need to know if there is a better way to delete a string of text from a 
> RichTextArea.
>
>
> Currently I handle it this way:
> @browser.frame(:class=>/gwt-RichTextArea/).click
> # Erase old comment
> for rte in 1..@browser.frame(:class=>/gwt-RichTextArea/).body.text.length 
> #GF0TARWCJU hasRichTextToolbar').body.text.length
> # delete text by backspacing.
> @browser.frame(:class=>/gwt-RichTextArea/).send_keys [:control,"a"], 
> :backspace
> end
>
> Is there a better way to do this with watir-webdriver?
>
>
> Image Included:
>
> Thank you,
> Joe
>
>
>
>

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


[wtr-general] deleting text in a RichTextArea

2012-09-25 Thread Joe Fl
Hi everyone,

I need to know if there is a better way to delete a string of text from a 
RichTextArea.


Currently I handle it this way:
@browser.frame(:class=>/gwt-RichTextArea/).click
# Erase old comment
for rte in 1..@browser.frame(:class=>/gwt-RichTextArea/).body.text.length 
#GF0TARWCJU hasRichTextToolbar').body.text.length
# delete text by backspacing.
@browser.frame(:class=>/gwt-RichTextArea/).send_keys [:control,"a"], 
:backspace
end

Is there a better way to do this with watir-webdriver?


Image Included:

Thank you,
Joe



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

Re: [wtr-general] Selecting Dropdown via Value

2012-09-25 Thread Željko Filipin
On Tue, Sep 25, 2012 at 1:30 PM, Adrian Killens 
wrote:
> 
> X Large
> How would I select from this dropdown using the value C?

browser.select(name="hello").select_value("C")

More information:

http://rdoc.info/gems/watir-webdriver/Watir/Select#select_value-instance_method
http://rdoc.info/gems/watir-classic/Watir/SelectList#select_value-instance_method

Željko
--
filipin.eu

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


[wtr-general] Selecting Dropdown via Value

2012-09-25 Thread Adrian Killens
Hi There,
Does anyone know how I can select a dropdown via the value rather than the 
name e.g.


Medium
Large
X Large

How would I select from this dropdown using the value C? So that if I'm 
testing in multiple languages I can still select.

Cheers
Aidy

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


[wtr-general] Unable to click on the links having specific description

2012-09-25 Thread praveen kumar
Hi All,

My requirement is to click on the links present in the table which have 
text starting with "*test*". I have written the code as below

table = $ie.table(:id, "ctl00_mContentPlaceHolder_gvElobratedItems") 
table.links.each do |link| 

*# Here I need to click on the link starting with "test"* 
 
end

So I am getting all the links present in the table. but not finding to 
click the specific links with "test".

Please let me know your thoughts

Thanks,
Praveen

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


Re: [wtr-general] watir slow performance on a remote selenium grid2

2012-09-25 Thread Jarmo Pertman
One solution would be to use the alternative method described 
at http://watirwebdriver.com/javascript-dialogs/

Jarmo Pertman
-
IT does really matter - http://itreallymatters.net

On Friday, September 21, 2012 11:28:30 AM UTC+3, Željko Filipin wrote:
>
> I would suggest that you send this to wtr-dev...@rubyforge.org
>
> Željko
> --
> filipin.eu 
>
>
> On Fri, Sep 21, 2012 at 1:42 AM, Thien-An Mac 
> > wrote:
>
>> I have started to point my cucumber/watir-webdriver test suites on our 
>> remote grid (hosted on another server, in a different physical location) 
>> and the performance is quite dreadful compared to a local grid (ie i'm 
>> executing my cucumber scripts on the same machine as the grid). The 
>> performance went from 8 minutes to over 40 minutes (both runs our script in 
>> parallel)! I did a bit of digging and it seems that the reason why it's so 
>> slow is that there is a significant delay when i'm filling out my webforms. 
>> Oddly enough, when i run the same scenario, but using webdriver, the 
>> performance went decrease by alot.
>>
>> Here are the two sample scripts I'm using to compare (both doing a simple 
>> google search) with a rather "complex" timing system
>>
>> watir:
>>
>> require 'rubygems'
>> require 'watir-webdriver'
>> browser = Watir::Browser.new(:remote, :url => remote_grid_url)
>> browser.goto "www.google.com"
>> now = Time.now.to_f
>> browser.text_field(:name => "q").set "We the People"
>> endd = Time.now.to_f
>> browser.button(:name => "btnG").click
>>
>> delta =  endd - now
>> browser.close
>>
>> puts "Took : " + delta.to_s
>>
>> watir:
>> require 'rubygems'
>> require 'selenium-webdriver'
>> browser = Selenium::WebDriver.for(:remote, :url => remote_grid_url)
>> browser.get "http://www.google.com";
>> now = Time.now.to_f
>> browser.find_element(:name => "q").send_keys "We the People"
>> endd = Time.now.to_f
>> browser.find_element(:name => "btnG").click
>> delta =  endd - now
>> puts "Took : " + delta.to_s
>>
>> As you can see both scripts capture the time it takes to find the element 
>> and populate it. I ran both scripts seperately, and on average, the 
>> webdriver takes 1 second to find and populate, and watir takes 3 seconds, 
>> which is 3x more!
>>
>> Is there a special setting i need on the grid to make it faster or do i 
>> need to optimize my locators (ie find the div, then the child element)?
>>  
>>
>> -- 
>> Before posting, please read http://watir.com/support. In short: search 
>> before you ask, be nice.
>>  
>> watir-...@googlegroups.com 
>> http://groups.google.com/group/watir-general
>> watir-genera...@googlegroups.com 
>>
>
>

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