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

[Feature Request] to get an element by indexNumber on elements(); #1095

Closed
msx752 opened this issue Feb 21, 2020 · 1 comment · Fixed by #1106
Closed

[Feature Request] to get an element by indexNumber on elements(); #1095

msx752 opened this issue Feb 21, 2020 · 1 comment · Fixed by #1106

Comments

@msx752
Copy link

msx752 commented Feb 21, 2020

hi, could you add a specific function to get element in an array by number of Index

Case

  • there may more than one matches while using

$('input[maxlength="11"]'); or $('button[type="button"].btn.btn-outline-dark');

Current State

  • this is the ugly solution which i found.
let matches = $('button[type="button"].btn.btn-outline-dark');
let selectedElement = (await matches.elements())[indexNumber];

Request

  • this is not big deal but reducing the line of codes matter while working on project.
 let selectedElement =   await `$('input[maxlength="11"]').ElementAt(indexNumber);`
// or
 let selectedElement =   await `$('input[maxlength="11"]').At(indexNumber);`

``

Versions

Version: 1.0.3 (Chromium:81.0.3994.0)
@zabil
Copy link
Member

zabil commented Feb 28, 2020

Perhaps

let selectedElement =   await $('input[maxlength="11"]').element(indexNumber);

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

Successfully merging a pull request may close this issue.

2 participants