On Thursday, January 9, 2014 4:56:44 AM UTC-8, Oscar.Rieken wrote:
>
> you dont need all of that to locate those elements by their id. you can 
> probably get away with just switching to the you need frame once and then 
> performing the actions. on that frame. you are pretty much traversing the 
> dom to find your element
>
> Building on what oscar suggests  (aka how to recover from brain damage 
caused by tools that use fully qualified xpath for everything)

search_filter_frame =  browser.frame(:id => "ConcertoContext").frame(:id => 
"application-content").frame(:name => "SearchFilter")
search_filter_frame.text_field(:id => "attribute.Name-given").set "DEMO"
search_filter_frame..text_field(:id => "attribute.Name-surname").set 
"HIEONE"
search_filter_frame..button(:id => "default-button-button").click

Now, my gut tells me that the last bit will fail, or click the wrong button 
because well, any page with that many frames is just pure evil dinosaur web 
1.0 crap.  Such a page is thus bound to completely ignore HTML standards 
such as *ID values must be unique within a page (or frame)*, so there could 
likely a plethora of buttons on that form inside the 'default-button' span 
(for various options other than first child) all with the very same ID 
value.  If my gut is wrong, count your blessings, although with all those 
frames there will not be many.  If my gut is right, then after you have 
bugged the page for violating HTML standards, you can try this instead

search_filter_frame.span(:class => "first-child").button(:id => 
"default-button-button").click  #or as much container info is needed to 
find the right button.

--Chuck  (yes, I hate frames, however did you guess?) vdL

On Thu, Jan 9, 2014 at 12:10 AM, Sanjeev Singh <bapu.c...@gmail.com<javascript:>
> > wrote:
>
>> Hi All,
>>
>> I am trying the below code and it is really really slow to respond....
>>
>> browser.div(:id => "context-wrapper").frame(:id => 
>> "ConcertoContext").div(:id => "cpo-folder").div(:class => 
>> "cpo-content-wrapper").div(:class => "cpo-content").frame(:id => 
>> "application-content").frame(:name => "SearchFilter").div(:class => 
>> "dt-filter filter").form(:id => "filterForm").text_field(:id => 
>> "attribute.Name-given").set "DEMO"
>> browser.div(:id => "context-wrapper").frame(:id => 
>> "ConcertoContext").div(:id => "cpo-folder").div(:class => 
>> "cpo-content-wrapper").div(:class => "cpo-content").frame(:id => 
>> "application-content").frame(:name => "SearchFilter").div(:class => 
>> "dt-filter filter").form(:id => "filterForm").text_field(:id => 
>> "attribute.Name-surname").set "HIEONE"
>> browser.div(:id => "context-wrapper").frame(:id => 
>> "ConcertoContext").div(:id => "cpo-folder").div(:class => 
>> "cpo-content-wrapper").div(:class => "cpo-content").frame(:id => 
>> "application-content").frame(:name => "SearchFilter").div(:class => 
>> "dt-filter filter").div(:class => "actions").span(:id => 
>> "default-button").span(:class => "first-child").button(:id => 
>> "default-button-button").click
>>
>> All of the above 3 lines of code takes 3-4 minutes each to execute and by 
>> the time the last line gets executed the browser session expires.
>> Please help me if there is any quicker way to find out the last object 
>> and set the values.
>>
>> Thanks in advance...!!! 
>>
>> -- 
>> -- 
>> Before posting, please read http://watir.com/support. In short: search 
>> before you ask, be nice.
>>  
>> watir-...@googlegroups.com <javascript:>
>> http://groups.google.com/group/watir-general
>> watir-genera...@googlegroups.com <javascript:>
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Watir General" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to watir-genera...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

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

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to