htmlelements icon indicating copy to clipboard operation
htmlelements copied to clipboard

Changes from pull request #121

Open emaks opened this issue 9 years ago • 10 comments

Changes from pull request #121 have removed difference between TypifiedElement.class and HtmlElement.class. Now we can do all actions that provides selenium api using TypifiedElement.class while this class has been implemented not to provide this possibility

emaks avatar Jun 10 '16 07:06 emaks

This is correct. What do you see the disadvantages of being able to access the WebElement API with TypifiedElements? Do you know why it was different in the first place?

I found the major advantage being able to explicitly wait for it like a normal WebElement. It also reduces code duplication, often you want to perform actions which are identical to the WebElement API and before the PR they were been passed through, without modification, to the wrapped WebElement.

ham1 avatar Jun 10 '16 08:06 ham1

Because when I use Button.class I mustn't have functionality like sendKeys(), getText() etc.

emaks avatar Jun 10 '16 09:06 emaks

Why must the functionality not be there?

Is already is there as you can still get access to the API using .getWrappedElement() - so easy to get around.

You can chose just not to use it.

Whereas, if it's not there, .getWrappedElement() has to be called or things such as explicit "wait for (in)visibility of all in" a List cannot be done without a custom ExpectedConditions.

In your example, you might want getText() on a button to check it has the expected text, also you might want to send the enter key on the button to test keyboard navigation.

ham1 avatar Jun 10 '16 12:06 ham1

Why must the functionality not be there?

because it looks like https://hsto.org/getpro/habr/post_images/9b8/71b/a0b/9b871ba0b4fe575aa9d896a6d642c55a.jpg

emaks avatar Jun 10 '16 13:06 emaks

TypifiedElements is a architect fail. So in most cases we have more troubles than profit from using it. So its just a step to make unification of this classes

lanwen avatar Jun 10 '16 13:06 lanwen

@lanwen in that case TypifiedElements have to be removed

emaks avatar Jun 10 '16 15:06 emaks

I totally agree. As well as being more 'correct' it will simplify the code base, which is always good, but what of backward compatibility?

ham1 avatar Jun 10 '16 15:06 ham1

yep, we can't just remove this class without set of small steps which are: unification - deprecation - removing.

lanwen avatar Jun 10 '16 15:06 lanwen

Can this be closed or are we going to look to deprecate TypifiedElements?

ham1 avatar Oct 19 '17 11:10 ham1

i would vote for deleting it

artkoshelev avatar Oct 20 '17 04:10 artkoshelev