Skip to content

Remove the many aliases for everything. #99

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

Closed
itfranck opened this issue Aug 4, 2020 · 1 comment
Closed

Remove the many aliases for everything. #99

itfranck opened this issue Aug 4, 2020 · 1 comment
Assignees
Milestone

Comments

@itfranck
Copy link
Collaborator

itfranck commented Aug 4, 2020

There's so many aliases in the module.
It might seems like it is convenient at first, but it create a situation where you can write the same thing in many different ways

Let's take for example Get-SeElement

Get-SeElement -By Name -Selection 'loginfmt'

Now, all the lines below are valid way to call the same statement.

Selection alias

#All aliases for selection
#[Alias("CssSelector", "Name", "Id", "ClassName", "LinkText", "PartialLinkText", "TagName", "XPath")]
Get-SeElement -By Name -name 'loginfmt'
Get-SeElement -By Name -CssSelector 'loginfmt'
Get-SeElement -By Name -LinkText 'loginfmt'

Target alias

  #[Alias('Element', 'Driver')]
Get-SeElement -By Name -Selection 'loginfmt' -Target $Driver 
Get-SeElement -By Name -Selection 'loginfmt' -Element $Driver 
Get-SeElement -By Name -Selection 'loginfmt' -Driver $Driver 

Function aliases

Find-SeElement  -By Name -Selection 'loginfmt' -Driver $Driver 
SeElement  -By Name -Selection 'loginfmt' -Driver $Driver 

Ultimately, all these are valid way to get to the same thing.
Now let's combine theses

Seelement -Name 'loginfmt' -Element $Driver
#Or 
Seelement -By name -xpath 'loginfmt' -Element $Driver

I think all theses aliases bring more confusion than they bring ease of use.

@itfranck itfranck added this to the V4.0 milestone Aug 4, 2020
@itfranck itfranck self-assigned this Aug 4, 2020
@itfranck itfranck changed the title Remove the many aliasess for everything. Remove the many aliases for everything. Aug 4, 2020
@vexx32
Copy link
Contributor

vexx32 commented Aug 7, 2020

Agreed. Part of this looks like it was introduced to retain some semblance of compatibility with older versions of the module, but just like I noted in #74, it's significantly more confusing than it is really helpful.

itfranck added a commit that referenced this issue Aug 22, 2020
Added internal Format-SeElement function intended to be used with anything that must return Iwebelement. The function add a default memeber set to be displayed so whenever you have IwebElement returned, they are formatted neatly on screen (#115). Also, removed Element alias on Get-SeElement (#99) and instead created a separated parameter set.
itfranck added a commit that referenced this issue Oct 13, 2020
Added internal Format-SeElement function intended to be used with anything that must return Iwebelement. The function add a default memeber set to be displayed so whenever you have IwebElement returned, they are formatted neatly on screen (#115). Also, removed Element alias on Get-SeElement (#99) and instead created a separated parameter set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants