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

TypeError: elem.get is not a function #953

Closed
Debashis9012 opened this issue Dec 5, 2019 · 1 comment
Closed

TypeError: elem.get is not a function #953

Debashis9012 opened this issue Dec 5, 2019 · 1 comment
Assignees
Labels

Comments

@Debashis9012
Copy link
Contributor

Expected behavior

Unable to perform page action click operation.

Actual behavior

Getting below error:
TypeError: elem.get is not a function

Steps to reproduce

##HTML snippet:##

<!DOCTYPE html>
<html>
<body>

<h2>HTML Forms</h2>

<form action="/action_page.php">
  First name:<br>
  <input type="text" name="firstname" value="Mickey">
  <br>
  Last name:<br>
  <input type="text" name="lastname" value="Mouse">
  <br><br>
  <input type="submit" value="Submit">
   <input type="submit" value="Hello">


</form>

<form action="/action_page.php">
  First name:<br>
  <input type="text" name="firstname" value="Mickey">
  <br>
  Last name:<br>
  <input type="text" name="lastname" value="Mouse">
  <br><br>
  <input type="submit" value="Submit">
   <input type="submit" value="Hello">


</form>

<form action="/action_page.php">
  First name:<br>
  <input type="text" name="firstname" value="Mickey">
  <br>
  Last name:<br>
  <input type="text" name="lastname" value="Mouse">
  <br><br>
  <input type="submit" value="Submit">
   <input type="submit" value="Hello">
  

</form>
<p>If you click the "Submit" button, the form-data will be sent to a page called "/action_page.php".</p>

</body>
</html>

Run the below script:

const { openBrowser, goto, click ,closeBrowser } = require('taiko');
(async () => {
    try {
        await openBrowser({headless: true});
        await goto("file:///Users/eleWrapper.html");
        let a = button("Hello");
        let ele= await a.elements();
       console.log(ele);
       click(ele[0]);
       //  click(a); //This works
    } catch (error) {
        console.error(error);
    } finally {
        await closeBrowser();
    }
})();

Versions

Version: 1.0.3 (Chromium: 79.0.3945.16) d9a4b6a65628db44301305757a3a5c5ad412c2ce
@Debashis9012
Copy link
Contributor Author

This issue has been verified and found fixed.
Tested version: ff140a8a5a76be5be2b7d1a82f04bdab27ac91d0

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

No branches or pull requests

3 participants