[wtr-general] Re: Can not interact with entire div List in application

2012-10-11 Thread Joe Fl
I have come up with a solution that works but I don't like the fact the 
loop will keep going if the name doesn't display.

If there is a complete arrow_down (command + down_arrow) that would remove 
the loop.

# library name is truncated
lib_name_b = lib_name.gsub("ng","...")
# scroll down div list
until @browser.div(:text,lib_name_b).present?
# arrow down
@browser.div(:class,'GP2FV5MCAEB').send_keys :arrow_down
end

On Thursday, October 11, 2012 1:37:38 PM UTC-4, Joe Fl wrote:
>
> Hi All,
>
> I have been working on this for two days now and cannot find a solution. 
>  please help.
> I have a list of libraries and my script runs thru the process of creating 
> one.  The problem I am having is locating the created item.  Once its 
> created it is placed at the bottom of the list
> and because of the list position in the browser I can not see all of the 
> items.
> When I try to do this "lib_txt = @browser.div(:index,43).text" I only get 
> half the list.  There are about 44 items in the list. 
> I have also tried this 
> **  "@browser.div(:text,'Automation Library for 
> Testi...').wd.location_once_scrolled_into_view" 
>  - which fails and reports can't locate text => Automation Library 
> for Testi... though if scroll down in the list it sees it.
> ** @browser.div(:text,'Automation Library for Testi...').present?  
>  - returns false when not in view and true when in view.
>
>
> Using:
> - watir-webdriver
> - ruby 1.8.7
> Browsers working with:
> - firefox
> - chrome
> Machine:
> - MacBook Pro
>
>
> I have included the code for the section I am trying to work with.  Any 
> Help would be greatly appreciated.
>
> 
>  
> 
> 
> 
> 
>  
> 
> 
>  
> 
> 
>  
> 
> 
> 
> 
>  __gwtcellbasedwidgetimpldispatchingfocus="true" 
> __gwtcellbasedwidgetimpldispatchingblur="true">
> 
>  style="outline:none;" __idx="0" onclick="">
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Starter Pack CCF - PCFile Se...   
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  onclick="">
>  onclick="">
>  onclick="">
>  onclick="">
>  onclick="">
>  onclick="">
>  onclick="">
>  onclick="">
>  onclick="">
>  __idx="10" onclick="">
>  __idx="11" onclick="">
>  __idx="12" onclick="">
>  __idx="13" onclick="">
>  __idx="14" onclick="">
>  __idx="15" onclick="">
>  __idx="16" onclick="">
>  __idx="17" onclick="">
>  __idx="18" onclick="">
>  __idx="19" onclick="">
>  __idx="20" onclick="">
>  __idx="21" onclick="">
>  __idx="22" onclick="">
>  __idx="23" onclick="">
>  __idx="24" onclick="">
> 
> 
> 
> 
> 
> 
> 
> 
>
>
> 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] Can not interact with entire div List in application

2012-10-11 Thread Joe Fl
Hi All,

I have been working on this for two days now and cannot find a solution. 
 please help.
I have a list of libraries and my script runs thru the process of creating 
one.  The problem I am having is locating the created item.  Once its 
created it is placed at the bottom of the list
and because of the list position in the browser I can not see all of the 
items.
When I try to do this "lib_txt = @browser.div(:index,43).text" I only get 
half the list.  There are about 44 items in the list. 
I have also tried this 
**  "@browser.div(:text,'Automation Library for 
Testi...').wd.location_once_scrolled_into_view" 
 - which fails and reports can't locate text => Automation Library 
for Testi... though if scroll down in the list it sees it.
** @browser.div(:text,'Automation Library for Testi...').present?  
 - returns false when not in view and true when in view.


Using:
- watir-webdriver
- ruby 1.8.7
Browsers working with:
- firefox
- chrome
Machine:
- MacBook Pro


I have included the code for the section I am trying to work with.  Any 
Help would be greatly appreciated.


 




 


 


 
















Starter Pack CCF - PCFile Se...   











































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] Re: Watir - Problem with pop up in IE9

2012-10-11 Thread Champ
I use rautomation and it works fine for the popup with the same title. I am 
on Ruby 1.9.2 and watir-classic 3.2.2 and IE9 too.

webpage_popup_title="Message from webpage"
popup= RAutomation::Window.new(:title => webpage_popup_title, :adapter => 
:autoit)
popup.WinWait(webpage_popup_title,'',20)
if (popup.exists? ==true)
   popup.send_keys('{ENTER}')
end

On Thursday, October 11, 2012 6:58:44 AM UTC-4, Jarmo Pertman wrote:
>
> It seems to be some different popup when you read the texts. I'm 
> suspecting that in IE9 this is not a regular JavaScript confirm popup.
>
> Jarmo Pertman
> -
> IT does really matter - http://itreallymatters.net
>
> On Thursday, October 11, 2012 5:31:11 AM UTC+3, Paul wrote:
>>
>>
>> 
>> For some reason my images of the popups did not save, attaching instead.
>>
>> On Thursday, 11 October 2012 15:26:08 UTC+13, Paul wrote:
>>>
>>>
>>> Hi, we have this popup in IE 8 and browser.alert.ok will work well.
>>>
>>> In IE9 the popup has changed to this:
>>>
>>>
>>> browser.alert.exists?
>>> > true
>>>
>>> browser.alert.close
>>> - minimises the popup
>>>
>>> browser.alert.ok
>>> - nothing
>>>
>>> I have tried some suggestions from the web like overriding the 
>>> javascript, sending keystrokes ('l' as in alt + l) and various other things.
>>>
>>> Does anyone have a solution?
>>>
>>> I am using ruby 1.9.2 and watir-classic 3.2.0. I don't want to move to 
>>> webdriver as it does not have attach().
>>>
>>> Regards
>>>
>>>

-- 
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] Can you use id and index?

2012-10-11 Thread Adrian Killens
Thank you once again! All sorted, I'm now using

browser.button(:id => "AddToBasket", :index => 0) 

Aidy :-)

On Thursday, 11 October 2012 10:10:18 UTC+1, Željko Filipin wrote:
>
> On Thu, Oct 11, 2012 at 10:48 AM, Adrian Killens 
> > 
> wrote:
> > Is it possible to use both and index and an id to get button?
>
> Sure. Something like this:
>
> browser.button(:id => "AddToBasket", :index => 0) # the first button with 
> id "one"
>
> > e.g. if I had a 10 buttons all with the id "AddToBasket" could I use the 
> id and the index to just click the first of the 10?
>
> Actually, this will click the first button 
>
> browser.button(:id => "AddToBasket").click
>
> This too:
>
> browser.button(:id => "AddToBasket", :index => 0).click
>
> And this will click the second one:
>
> browser.button(:id => "AddToBasket", :index => 1).click
>
> By the way, ids should be unique on the page, you should let the 
> developers know.
>
> Željko
>

-- 
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] Can you use id and index?

2012-10-11 Thread Joe Fleck
Hi,

If the button has text you can use that instead.

Joe
On Oct 11, 2012 4:48 AM, "Adrian Killens"  wrote:

> Is it possible to use both and index and an id to get button?
>
> e.g. if I had a 10 buttons all with the id "AddToBasket" could I use the
> id and the index to just click the first of the 10?
>
> 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
>

-- 
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: Watir - Problem with pop up in IE9

2012-10-11 Thread Jarmo Pertman
It seems to be some different popup when you read the texts. I'm suspecting 
that in IE9 this is not a regular JavaScript confirm popup.

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

On Thursday, October 11, 2012 5:31:11 AM UTC+3, Paul wrote:
>
>
> 
> For some reason my images of the popups did not save, attaching instead.
>
> On Thursday, 11 October 2012 15:26:08 UTC+13, Paul wrote:
>>
>>
>> Hi, we have this popup in IE 8 and browser.alert.ok will work well.
>>
>> In IE9 the popup has changed to this:
>>
>>
>> browser.alert.exists?
>> > true
>>
>> browser.alert.close
>> - minimises the popup
>>
>> browser.alert.ok
>> - nothing
>>
>> I have tried some suggestions from the web like overriding the 
>> javascript, sending keystrokes ('l' as in alt + l) and various other things.
>>
>> Does anyone have a solution?
>>
>> I am using ruby 1.9.2 and watir-classic 3.2.0. I don't want to move to 
>> webdriver as it does not have attach().
>>
>> Regards
>>
>>

-- 
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: click_no_wait no worky on Ruby 1.9.3

2012-10-11 Thread Jarmo Pertman
Maybe it has something to do with iframe. Can you go to the frame-s source 
url directly so you won't be inside of any frames and then click that 
button with #click_no_wait without being in the context of any frames?

If that helps then try again with frame, but this time edit the outputted 
command like this.

Instead of:
Watir::IE.attach(:hwnd, xx).frame({:tag_name=>['frame', 'iframe'], 
:id=>'viewIFRAME'})

Like this:
Watir::IE.attach(:hwnd, xx).frame({:tag_name=> Array.new << 'frame' << 
'iframe', :id=>'viewIFRAME'})

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

On Thursday, October 11, 2012 1:10:42 AM UTC+3, Paul wrote:
>
> Tried it with no success, also I note that the backslashes are there in my 
> 1.9.2 installation. That path is my RUBYLIB env var.
>
> Regards
>
> On Thursday, 11 October 2012 05:37:31 UTC+13, Jarmo Pertman wrote:
>>
>> Can you try if changing "\\" in that #click_no_wait command to "/" 
>> instead will make any difference. I can see this entry in that command:
>>
>> C:\\Users\\pauld\\workspace\\SopranoMedicalRecords\\AutomatedTests\\med_rec\\
>>
>> Let us know of your results.
>>
>> Jarmo Pertman
>> -
>> IT does really matter - http://itreallymatters.net
>>
>>
>> On Tuesday, October 9, 2012 6:29:16 AM UTC+3, Paul wrote:
>>>
>>> Edited subject to click_no_wait no worky on Ruby 1.9.3
>>>
>>> On Monday, 8 October 2012 10:57:02 UTC+13, Paul wrote:

 Here is my ruby version and gem list (after re-installing Ruby 1.9.3 
 and gems):

 C:\Users\pauld\workspace\SopranoMedicalRecords\AutomatedTests\med_rec\tests>ruby
  
 -v
 ruby 1.9.3p194 (2012-04-20) [i386-mingw32]

 C:\Users\pauld\workspace\SopranoMedicalRecords\AutomatedTests\med_rec\tests>gem
  
 list

 *** LOCAL GEMS ***

 addressable (2.3.2)
 bigdecimal (1.1.0)
 builder (3.1.3)
 childprocess (0.3.5)
 commonwatir (4.0.0)
 ffi (1.1.5 x86-mingw32)
 hoe (3.1.0)
 io-console (0.3)
 json (1.5.4)
 libwebsocket (0.1.5)
 mini_magick (3.2.1)
 minitest (2.5.1)
 multi_json (1.3.6)
 nokogiri (1.5.5 x86-mingw32)
 rake (0.9.2.2)
 rautomation (0.7.2)
 rdoc (3.9.4)
 ruby-oci8 (2.1.2 x86-mingw32)
 rubyzip (0.9.9)
 s4t-utils (1.0.4)
 selenium-webdriver (2.25.0)
 subexec (0.0.4)
 sys-proctable (0.9.1 universal-mingw32)
 user-choices (1.1.6.1)
 watir (4.0.0 x86-mingw32)
 watir-classic (3.2.0)
 watir-webdriver (0.6.1)
 win32-api (1.4.8 x86-mingw32)
 win32-process (0.7.0)
 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)

 Here is an IRB session, the button to click is deep within some frames. 

 irb(main):014:0> require 'rubygems'
 => true
 irb(main):015:0> require 'watir-classic'
 => true
 irb(main):016:0> b = Watir::Browser.attach :url, /concerto/
 => #http://chch-medsrec-vm04/concerto/Concerto.htm"; title="Concerto - 
 Example Clinician">
 irb(main):017:0> cc = b.frame(:id, 'ConcertoContext')
 => #>>> specifiers={:tag_name=>["frame", "iframe"], :id=>"ConcertoContext"}>
 irb(main):018:0> ca = cc.frame(:id, 'ConcertoApplication')
 => #>>> specifiers={:tag_name=>["frame", "iframe"], :id=>"ConcertoApplication"}>
 irb(main):019:0> eds = ca.frame(:name, 'EDSMain')
 => #>>> specifiers={:tag_name=>["frame", "iframe"], :name=>"EDSMain"}>
 irb(main):020:0> r = eds.frame(:name, 'Right')
 => #>>> specifiers={:tag_name=>["frame", "iframe"], :name=>"Right"}>
 irb(main):021:0> l = eds.frame(:name, 'Left')
 => #>>> specifiers={:tag_name=>["frame", "iframe"], :name=>"Left"}>
 irb(main):022:0> lt = l.frame(:name, 'LeftTop')
 => #>>> specifiers={:tag_name=>["frame", "iframe"], :name=>"LeftTop"}>
 irb(main):023:0> lb = l.frame(:name, 'LeftBottom')
 => #>>> specifiers={:tag_name=>["frame", "iframe"], :name=>"LeftBottom"}>
 irb(main):024:0> lb.button(:id, 'exitButton').exist?
 => true
 irb(main):025:0> lb.button(:id, 'exitButton').click_no_wait
 => ""
 irb(main):026:0> lb.button(:id, 'exitButton').click
 *[Manually clicked Ok button on javascript dialog]*
 => 0.065006 
 irb(main):027:0>


 When I run from my framework you can see a flash (looks like a cmd 
 window for a split second) as if the button is clicked (click_no_wait) but 
 the javascript dialog box does not appear as it did with watir versions 
 prior to 1.7.1.
 Running from IRB as above I do not see that flash.
 If I do a button.click the dialog box appears and blocks the script.
   
 Looking at the Ruby source there is not a click_no_wait method in 
 element.rb but the method is being called otherwise I would get a no 
 method 
 exception.

 Am I missing something here?

 thanks
 - paul


 On Friday, 5 Oc

Re: [wtr-general] Can you use id and index?

2012-10-11 Thread Željko Filipin
On Thu, Oct 11, 2012 at 10:48 AM, Adrian Killens 
wrote:
> Is it possible to use both and index and an id to get button?

Sure. Something like this:

browser.button(:id => "AddToBasket", :index => 0) # the first button with
id "one"

> e.g. if I had a 10 buttons all with the id "AddToBasket" could I use the
id and the index to just click the first of the 10?

Actually, this will click the first button

browser.button(:id => "AddToBasket").click

This too:

browser.button(:id => "AddToBasket", :index => 0).click

And this will click the second one:

browser.button(:id => "AddToBasket", :index => 1).click

By the way, ids should be unique on the page, you should let the developers
know.

Željko

-- 
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] Can you use id and index?

2012-10-11 Thread Adrian Killens
Is it possible to use both and index and an id to get button?

e.g. if I had a 10 buttons all with the id "AddToBasket" could I use the id 
and the index to just click the first of the 10?

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