Skip to content

moveto returns "unknown command" on v4.3.0 of chrome webdriver #118

Closed

Description

@vasilake-v

Hey All !

I'm trying to use the new version of "selenium/hub:4.3.0-20220726" and "selenium/node-chrome:4.3.0-20220726" with https://github.com/minkphp/MinkSelenium2Driver but facing a issue related to "clickOnElement()" method

One could say/relay me to MinkSelenium2Driver package discussion, but i still think this is something related to php-webdriver and its method support for webdrivers.

During "clickOnElement()" method, on webdriver the moveto and click() is called.
php-webdriver throws exception during moveto() action, after POST http://127.0.0.1:4444/wd/hub/session/:sessionId/moveto, which is accepted by selenium-hub... it returns a response with error details "error": "command unknown"

I've created a Pull-request but i'm not 100% sure whether the approach is the right one (seems to be though) #117

I'd appreciate some guidance here

Thank you!

Activity

  1. added a commit that references this issue on Aug 9, 2022
    48524f2
  2. Saeven commented on Nov 29, 2022

    @Saeven

    @slava-v I'm running into the same problem using:

    • selenium/standalone-chrome:4.6.0-20221104
    • behat/behat: "3.12.0"
    • behat/mink: "v1.10.0"
    • behat/mink-extension: "2.3.1"
    • behat/mink-selenium2-driver: "v1.6.0"
    • instaclick/php-webdriver: "1.4.16"
    • ChromeDriver 107.0.5304.62

    Had you solved this? I get logs that look like:

    #0 /vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php(174): WebDriver\Exception::factory(-8, 'Unable to execu...')
    #1 /vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php(234): WebDriver\AbstractWebDriver->curl('POST', '/moveto', Array)
    #2 /vendor/instaclick/php-webdriver/lib/WebDriver/Container.php(241): WebDriver\AbstractWebDriver->__call('moveto', Array)
    #3 /vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php(798): WebDriver\Container->__call('moveto', Array)
    
  3. justafish commented on Dec 2, 2022

    @justafish

    I've opened a PR to fix this #120

  4. vasilake-v commented on Dec 12, 2022

    @vasilake-v
    Author

    @Saeven

    The issue was fixed for me with instaclick/php-webdriver: 1.4.15

    So my setup is slightly different

    container image: selenium/node-chrome: 4.3.0-20220726

    composer.lock

    behat/behat: v3.10.0
    behat/mink: v1.10.0
    behat/mink-extension: 2.3.1
    behat/mink-selenium2-driver: v1.6.0
    instaclick/php-webdriver: 1.4.15
    

    behat.yml.dist

    extensions:
            Behat\MinkExtension:
                sessions:
                    default:
                        symfony2: ~
                    javascript:
                        selenium2:
                            wd_host: "http://selenium-hub:4444/wd/hub" # Docker configuration
                            capabilities:
                                browserName: 'chrome'
                                marionette: false
                                browser: 'chrome'
                                platform: "LINUX"
                                version: ''
                                extra_capabilities:
                                    idle-timeout: 600
                                    command-timeout: 600
                                    max-duration: 14400
                                    chromeOptions:
                                        args:
                                            - "start-maximized"
    

    docker-compose.yml

        selenium-hub:
            image: selenium/hub:4.3.0-20220726
            ports:
                - "4444:4444"
    
        selenium-node-chrome:
            image: selenium/node-chrome:4.3.0-20220726
            volumes:
                - "${PROJECT_ROOT:-.}/var/chrome:/tmp/"
            ports:
    @@ -91,9 +91,12 @@ services:
                SCREEN_DEPTH: 24
                NODE_MAX_SESSION: 1
                NODE_MAX_INSTANCES: 1
                SE_EVENT_BUS_HOST: selenium-hub
                SE_EVENT_BUS_PUBLISH_PORT: 4442
                SE_EVENT_BUS_SUBSCRIBE_PORT: 4443
            shm_size: 2G
            depends_on:
                - selenium-hub
  5. Saeven commented on Dec 12, 2022

    @Saeven

    @slava-v I've tried your configuration just now, but it still unfortunately yields request failures:

    Unable to execute request: POST \u002fsession\u002f1528e41bd667b564d12e0bf292a79c9f\u002fmoveto

     [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "345c78266b0b2566aa535d1f0a9b6a05","eventTime": 1670868993454654109,"eventName": "exception","attributes": {"exception.message": "Unable to execute request: POST \u002fsession\u002f1528e41bd667b564d12e0bf292a79c9f\u002fmoveto\nBuild info: version: '4.3.0', revision: 'a4995e2c09*'\nSystem info: host: 'b8fc029cf303', ip: '172.26.0.5', os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.49-linuxkit', java.version: '11.0.15'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.UnsupportedCommandException: POST \u002fsession\u002f1528e41bd667b564d12e0bf292a79c9f\u002fmoveto\nBuild info: version: '4.3.0', revision: 'a4995e2c09*'\nSystem info: host: 'b8fc029cf303', ip: '172.26.0.5', os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.49-linuxkit', java.version: '11.0.15'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.remote.codec.AbstractHttpCommandCodec.decode(AbstractHttpCommandCodec.java:293)\n\tat org.openqa.selenium.remote.codec.AbstractHttpCommandCodec.decode(AbstractHttpCommandCodec.java:127)\n\tat org.openqa.selenium.grid.web.ProtocolConverter.execute(ProtocolConverter.java:123)\n\tat org.openqa.selenium.grid.node.ProtocolConvertingSession.execute(ProtocolConvertingSession.java:75)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.execute(SessionSlot.java:125)\n\tat org.openqa.selenium.grid.node.local.LocalNode.executeWebDriverCommand(LocalNode.java:447)\n\tat org.openqa.selenium.grid.node.ForwardWebDriverCommand.execute(ForwardWebDriverCommand.java:35)\n\tat org.openqa.selenium.remote.http.Route$PredicatedRoute.handle(Route.java:373)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:86)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.grid.node.Node.execute(Node.java:240)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.remote.AddWebDriverSpecHeaders.lambda$apply$0(AddWebDriverSpecHeaders.java:35)\n\tat org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:44)\n\tat java.base\u002fjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)\n\tat java.base\u002fjava.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:829)\n","exception.type": "org.openqa.selenium.UnsupportedCommandException","http.flavor": 1,"http.handler_class": "org.openqa.selenium.remote.http.Route$PredicatedRoute","http.host": "localhost:4444","http.method": "POST","http.request_content_length": "50","http.scheme": "HTTP","http.target": "\u002fsession\u002f1528e41bd667b564d12e0bf292a79c9f\u002fmoveto","http.user_agent": "selenium\u002f4.3.0 (java unix)"}}
    
  6. vasilake-v commented on Dec 15, 2022

    @vasilake-v
    Author

    @Saeven , that really looks strange.

    You say that you tried with same versions? 🤔 Could it be that the your vendor folder still has the old package ? (remove all packages and reinstall / clean composer cache)

    If you tried with newer version, then the only things that come to my mind is that the bug was reintroduced 😞

  7. justafish commented on Jan 11, 2023

    @justafish

    Could this issue be re-opened please @robocoder ?

  8. robocoder commented on Jan 11, 2023

    @robocoder
    Contributor

    Re-opening for further investigation.

  9. justafish commented on Jan 12, 2023

    @justafish

    Just to explain why I think #120 is the solution @robocoder - moveTo was removed from Selenium in April 2021 as it's not compliant with the spec. Removing the command from this library will cause Mink to raise an exception that the command doesn't exist (rather than erroring out completely as it currently does) See https://github.com/minkphp/MinkSelenium2Driver/blob/master/src/Selenium2Driver.php#L800 which also references moveto as not being in the W3C WebDriver spec.

    I'd appreciate if you could explain why you don't think this should be removed? Thanks! 😸

  10. robocoder commented on Jan 12, 2023

    @robocoder
    Contributor

    I know the command is unsupported in the W3C spec but I can't ignore the BC aspect of this library.

  11. justafish commented on Jan 13, 2023

    @justafish

    @robocoder could we make a 2.x.x release, otherwise what would your preferred solution be along the lines of?

  12. Saeven commented on Jan 19, 2023

    @Saeven

    I would like to voice a small vote for what @justafish suggests: a semver intention to flag the BC.

    Perhaps the PR is indeed not the right solution, there I defer to your team!

    However, a semver promotion that removes the deprecated command would save our CI chain logs and make logs useful once again. Right now, we're left to wade through hundreds of thousands of lines that are being padded to 40x intended size because of barrage of org.openqa.selenium.UnsupportedCommandException

    Thank you for your efforts! I know OSS can be a thankless job!

  13. Saeven commented on Jan 25, 2023

    @Saeven
  14. justafish commented on Jul 25, 2023

    @justafish

    @robocoder can you provide some guidance here please if you're unwilling to remove the command to cause it to raise an exception? I understand the BC break concerns, but this is already broken for anyone who isn't using a > 1 year old release now

  15. added 2 commits that reference this issue on Mar 19, 2024
    99957bf
    99b3135
  16. aik099 commented on Mar 19, 2024

    @aik099
    Contributor

    The minkphp/MinkSelenium2Driver@7aa0e14 commit made it possible for MinkSelenium2Driver to handle an attempt to call non-existing moveto command. The fix is available in the MinkSelenium2Driver v1.7.

  17. aik099 commented on Mar 19, 2024

    @aik099
    Contributor

    How you managed to get MinkSelenium2Driver working with Selenium 4?

    For me instaclick/php-webdriver 1.x doesn't even connect to Selenium 4, because it can talk only JsonWireProtocol, but Selenium 4 is W3C only.

  18. added a commit that references this issue on Mar 27, 2025
    feaf742
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions