Troubleshooting of selenium errors
Jump to navigation
Jump to search
SeleniumHQ Browser Automation (php-webdriver/php-webdriver: PHP client for Selenium/WebDriver protocol. Previously facebook/php-webdriver)
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 ...
- Troubleshooting of Excel errors
- PHP, cUrl, Python, selenium errors
- Database: SQL syntax debug, MySQL errors or MySQLTuner errors
- Troubleshooting of regular expression
- HTML/Javascript: Troubleshooting of javascript, XPath
- Software: Mediawiki, FTP problems
- Testing, Web Ping, Network problem, Web user behavior, Web scrape troubleshooting
Template