refactoring the basepageelement to accept locator as an __init__ parameter