>
> It is known that using :visible_text will not have the same performance. 
It has to iterate over elements, where as the Selenium ones would not. The 
benefit of :visible_text is that we can apply it across all element types, 
not just links.

Yes, it is increasing the performance ! But still it's taking much time but 
compared to element() function it's okay. But *link*: locator really rocks! 
I still don't have any clue why WATIR is going to forbid using such a 
powerful performance of Selenium, I don't see any reason other than putting 
just name sake of WATIR API. 

I have a number of ideas for improving locator performance in general. 
However, for this specific case, you will see performance improvements by 
not using #element. Just switching to using #link will cut down the number 
of elements Watir has to iterate over. If there are other locators to 
reduce the links checked, that will also help performance. If that doesn't 
help, a specific example would help us identify other places for 
performance improvements.

Yes, I agree using b.link() increases the performance, But I completely 
against the idea of not using the link: locator of selenium.

If I pass the locator which is inside the selenium locators list, then make 
a direct call to find_element just by passing those two values, but when 
you find the locator which is not in selenium locators list, then go for 
formation of xpath. It's pretty simple. It was good but I don't know why 
all these unnecessary arrangement which actually spoils the WATIR structure 
rather than improving. The very first time yesterday when I developed  
WATIR code for new project, I installed previous version(6.8.4) because of 
this new arrangement. 


On Sunday, December 10, 2017 at 7:54:42 PM UTC+5:30, Justin Ko wrote:

> Yes, the plan is to remove :link, :link_text and :partial_link_text.
>
> It is known that using :visible_text will not have the same performance. 
> It has to iterate over elements, where as the Selenium ones would not. The 
> benefit of :visible_text is that we can apply it across all element types, 
> not just links.
>
> I have a number of ideas for improving locator performance in general. 
> However, for this specific case, you will see performance improvements by 
> not using #element. Just switching to using #link will cut down the number 
> of elements Watir has to iterate over. If there are other locators to 
> reduce the links checked, that will also help performance. If that doesn't 
> help, a specific example would help us identify other places for 
> performance improvements.
>
> Justin
>
>
> On Sunday, December 10, 2017 at 2:24:19 AM UTC-5, [email protected] 
> wrote:
>>
>> When I use
>>
>> b.element(link: 'Book Now').click
>>
>> it says 
>>
>> 2017-12-10 12:49:01 WARN Watir [DEPRECATION] :link locator is deprecated. 
>> Use :visible_text instead.
>>
>> Does that mean it would be removed in future? 
>>
>> because what I found is, visible_text locator is not working properly, it 
>> clicks the link after 3 to 5 mins of time, How funny, Isn't it? 
>>
>

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

--- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to