Selenium Page Factory How.Custom C# Examples -


does using c# selenium's pagefactory know how implement how.custom locator? have searched internet high , low no avail. examples in java , seem far , few between.

create class -

public class ngbymodelfinder : {     public ngbymodelfinder(string locator)     {         findelementmethod = (isearchcontext context) => context.findelement(ngby.model(locator));     } } 

and attach findsby attribute webelement -

[findsby(how = how.custom, using = "value locator", customfindertype = typeof(ngbymodelfinder))] 

protected iwebelement testdiv { get; set; }

i hope above you.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -