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.
>
> <div style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 
> 0px;">
> <div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; 
> height: 10ex;"> </div>
> <div style="position: absolute; overflow: hidden; left: 0px; top: 0px; 
> right: 0px; height: 70px;">
> <div style="position: absolute; overflow: hidden; left: 0px; top: 70px; 
> right: 0px; height: 28px;">
> <div style="position: absolute; overflow: hidden; left: 0px; top: 98px; 
> right: 0px; bottom: 0px;">
> <div class="GP2FV5MCFI" style="position: absolute; left: 0px; top: 0px; 
> right: 0px; bottom: 0px;">
> <div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; 
> height: 10ex;"> </div>
> <div style="position: absolute; overflow: hidden; left: 0px; top: 0px; 
> right: 0px; bottom: 0px;">
> <div style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 
> 0px;">
> <div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; 
> height: 10ex;"> </div>
> <div style="position: absolute; overflow: hidden; left: 0px; top: 0px; 
> bottom: 0px; width: 260px;">
> <div class="GP2FV5MCMDB" style="position: absolute; left: 0px; top: 0px; 
> right: 0px; bottom: 0px;">
> <div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; 
> height: 10ex;"> </div>
> <div style="position: absolute; overflow: hidden; left: 0px; top: 0px; 
> right: 0px; height: 50px;">
> <div style="position: absolute; overflow: hidden; left: 0px; top: 50px; 
> right: 0px; bottom: 0px;">
> <div class="GP2FV5MCAEB" style="overflow: auto; position: absolute; left: 
> 0px; top: 0px; right: 0px; bottom: 0px;" tabindex="-1">
> <div style="position: relative;">
> <div class="GP2FV5MCFW GP2FV5MCODB" 
> __gwtcellbasedwidgetimpldispatchingfocus="true" 
> __gwtcellbasedwidgetimpldispatchingblur="true">
> <div style="">
> <div class="GP2FV5MCBW GP2FV5MCEW gwtQuery-droppable" 
> style="outline:none;" __idx="0" onclick="">
> <table class="GP2FV5MCNK" cellspacing="0" cellpadding="0" title="Starter 
> Pack CCF - PCFile Searchbits Test" style="background-color: rgb(188, 188, 
> 188);">
> <tbody>
> <tr>
> <td align="left" style="vertical-align: top;">
> <table cellspacing="0" cellpadding="0">
> <tbody>
> <tr>
> <td align="left" style="vertical-align: top;">
> <td align="left" style="vertical-align: top;">
> <div class="GP2FV5MCPK">Starter Pack CCF - PCFile Se...</div>   
> </td>
> </tr>
> </tbody>
> </table>
> </td>
> </tr>
> </tbody>
> </table>
> </div>
> <div class="GP2FV5MCDW gwtQuery-droppable" style="outline:none;" __idx="1" 
> onclick="">
> <div class="GP2FV5MCBW gwtQuery-droppable" style="outline:none;" __idx="2" 
> onclick="">
> <div class="GP2FV5MCDW gwtQuery-droppable" style="outline:none;" __idx="3" 
> onclick="">
> <div class="GP2FV5MCBW gwtQuery-droppable" style="outline:none;" __idx="4" 
> onclick="">
> <div class="GP2FV5MCDW gwtQuery-droppable" style="outline:none;" __idx="5" 
> onclick="">
> <div class="GP2FV5MCBW gwtQuery-droppable" style="outline:none;" __idx="6" 
> onclick="">
> <div class="GP2FV5MCDW gwtQuery-droppable" style="outline:none;" __idx="7" 
> onclick="">
> <div class="GP2FV5MCBW gwtQuery-droppable" style="outline:none;" __idx="8" 
> onclick="">
> <div class="GP2FV5MCDW gwtQuery-droppable" style="outline:none;" __idx="9" 
> onclick="">
> <div class="GP2FV5MCBW gwtQuery-droppable" style="outline:none;" 
> __idx="10" onclick="">
> <div class="GP2FV5MCDW gwtQuery-droppable" style="outline:none;" 
> __idx="11" onclick="">
> <div class="GP2FV5MCBW gwtQuery-droppable" style="outline:none;" 
> __idx="12" onclick="">
> <div class="GP2FV5MCDW gwtQuery-droppable" style="outline:none;" 
> __idx="13" onclick="">
> <div class="GP2FV5MCBW gwtQuery-droppable" style="outline:none;" 
> __idx="14" onclick="">
> <div class="GP2FV5MCDW gwtQuery-droppable" style="outline:none;" 
> __idx="15" onclick="">
> <div class="GP2FV5MCBW gwtQuery-droppable" style="outline:none;" 
> __idx="16" onclick="">
> <div class="GP2FV5MCDW gwtQuery-droppable" style="outline:none;" 
> __idx="17" onclick="">
> <div class="GP2FV5MCBW gwtQuery-droppable" style="outline:none;" 
> __idx="18" onclick="">
> <div class="GP2FV5MCDW gwtQuery-droppable" style="outline:none;" 
> __idx="19" onclick="">
> <div class="GP2FV5MCBW gwtQuery-droppable" style="outline:none;" 
> __idx="20" onclick="">
> <div class="GP2FV5MCDW gwtQuery-droppable" style="outline:none;" 
> __idx="21" onclick="">
> <div class="GP2FV5MCBW gwtQuery-droppable" style="outline:none;" 
> __idx="22" onclick="">
> <div class="GP2FV5MCDW gwtQuery-droppable" style="outline:none;" 
> __idx="23" onclick="">
> <div class="GP2FV5MCBW gwtQuery-droppable" style="outline:none;" 
> __idx="24" onclick="">
> </div>
> <div style="display: none;">
> </div>
> </div>
> </div>
> </div>
> </div>
> </div>
>
>
> Thank you,
> Joe
>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

Reply via email to