Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

wgxpath doesn't work with textarea tag after changing input value #49

Open
trantrungtin opened this issue Aug 1, 2016 · 3 comments
Open

Comments

@trantrungtin
Copy link

trantrungtin commented Aug 1, 2016

I changed the value of the textarea tag on W3School [1]. After that, I try to evaluate textarea's xpath [2] on W3School [1] on IE but it doesn't work!

I have tried that xpath on Firefox, Chrome and it works fine.

[1] : http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_textarea
[2] : //textarea[contains(.,'At w3schools.com you will learn how to make a website. We offer free tutorials in all web development technologies.')]

@nthau2409
Copy link

Thank you @trantrungtin for posting this issue. I have working on automation project to automate web page.

I got the same issue that you mention above.

Can anyone have solution to come over this stuck?

Thanks,

@trantrungtin
Copy link
Author

trantrungtin commented Aug 8, 2016

@nedjs @Dominator008 Do you have any update about this issue?

@nedjs
Copy link
Contributor

nedjs commented Jun 5, 2017

Super late here... I attempted to replicate this issue but was unable to. Heres the code I used.

<textarea rows="4" cols="50">
At w3schools.com you will learn how to make a website. We offer free tutorials in all web development technologies.
</textarea>
<input type="button" onclick="doEval()" value="evaluate">
  <script type="text/javascript">
    wgxpath.install(window, true);
    function doEval() {

      console.log(document.evaluate);
      console.log(document.evaluate(
        "//textarea[contains(.,'At w3schools.com you will learn how to make a website. We offer free tutorials in all web development technologies.')]", 
        document.documentElement, 
        null, 
        XPathResult.FIRST_ORDERED_NODE_TYPE, 
        null
      ).singleNodeValue);
    }
  </script>

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

No branches or pull requests

3 participants