Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BasePageExtended causing issue with wait #373

Closed
sridharaiyer opened this issue Apr 18, 2022 · 3 comments
Closed

BasePageExtended causing issue with wait #373

sridharaiyer opened this issue Apr 18, 2022 · 3 comments
Labels

Comments

@sridharaiyer
Copy link

sridharaiyer commented Apr 18, 2022

Describe the Issue
This is reopening the issue #357
I extended the BasePage as public class BasePageExtended<T extends BasePage> extends BasePage
And extended this class for my page object class as:
public class MyPage extends BasePageExtended<MyPage>

I am unable to use the wait.until methods in my page object as the compiler complains saying it is expecting a WebElement but getting an object instead

To Reproduce
Steps to reproduce the behavior:

  1. Mentioned in description

Expected Behaviour
Should be able to extend the BasePage as BasePageExtended and extend that for my pages without any issue.
Screen Shot 2022-04-18 at 11 07 51 AM
Screen Shot 2022-04-18 at 10 55 30 AM

@sridharaiyer
Copy link
Author

Hi
I was able to overcome the Wait issue by instantiating the Wait like this -

public class BasePageExtended<T extends BasePage> extends BasePage {
    protected Wait<WebDriver> wait = new WebDriverWait(driver, 30);

But I am still seeing some warnings in terms of "generifying" my code, when my pages extend the BasePageExtended class. Screenshots below.

Screen Shot 2022-04-18 at 1 42 21 PM

Screen Shot 2022-04-18 at 1 41 30 PM

Can you kindly help me get rid of these warnings?

@Mjl33
Copy link
Member

Mjl33 commented Apr 21, 2022

the correct extension is BasePageExtended<T extends BasePage<T>> extends BasePage<T>

@sridharaiyer
Copy link
Author

Thank you team. The extension is working fine now. Closing this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants