How to create our own locating mechanisms by extending the "By" class | Selenium Forum
Sundaram Iyer Posted on 06/09/2021

In selenium, can you please give me a sample example and how we can extend "By" class?

"By" is an abstract class for locating elements. So to create own locating mechanisms, it is possible to subclass this class and override the protected methods as required.



Ashish Replied on 06/09/2021

Yes you can

Buts like building or extending selenium


Sundaram Iyer Replied on 06/09/2021

Thanks for your response. Is there any sample code or an example of a custom locater that  extends "By" class. a simple example code will really help.