Troubleshooting of selenium errors

From LemonWiki共筆
Revision as of 15:58, 26 May 2020 by Planetoid (talk | contribs) (Created page with "[https://www.selenium.dev/ SeleniumHQ Browser Automation] == How to resolve Uncaught Facebook\WebDriver\Exception\InvalidSelectorException == Error message <pre> PHP Fatal er...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

SeleniumHQ Browser Automation

How to resolve Uncaught Facebook\WebDriver\Exception\InvalidSelectorException

Error message

PHP Fatal error:  Uncaught Facebook\WebDriver\Exception\InvalidSelectorException: invalid selector: The result of the xpath expression "xxx" is: [object Attr]. It should be an element.
  (Session info: chrome=83.0.4103.61) in /path/to/vendor/php-webdriver/webdriver/lib/Exception/WebDriverException.php:105

Situation

  • After the term was keyed in into the text box, the script shuld auto click the specified button which specified by XPath expression.

Possibile soultions

  • Solution1: Using headless chrome[1]
  • Solution2: Not click the button which specified by XPath expression. Send the ENTER to submit the form[2].

References


Troubleshooting of ...

Template