BehatPageObjectExtension icon indicating copy to clipboard operation
BehatPageObjectExtension copied to clipboard

Create PageObject Element based on parameters

Open norberttech opened this issue 12 years ago • 3 comments

Sometimes we have elements that have very same logic but different parameters describes them so its impossible to get them directly from Page Object. It would be nice to have additional parameter in getElement method in Page class.

$params = array('id' => 'element_id'); 
PageObject\Page::getElement($name, $params);

norberttech avatar Jun 05 '13 10:06 norberttech

Page class already accepts parameters as the last argument. How about we make that Element class accepts them too and than both factory methods get an optional argument, like @norzechowicz proposed? This gives us an additional ability to override parameters passed via the configuration at runtime.

jakzal avatar Jun 10 '14 07:06 jakzal

Faced the same issue, so it's really useful

tikolakin avatar Apr 15 '16 17:04 tikolakin

This improvement can resolve this issue

spolischook avatar Oct 01 '16 21:10 spolischook