Search code examples
javascriptseleniumautomationtestcafebrowser-automation

is there a way to pass js command to dev console while automating testcafe testcase


This is the flow:

  1. Open the homepage
  2. Run the command on dev console
  3. Continue with rest of the test steps

top.startTour("123", 0) is the command

I am writing an automation test case wherein i need to pass a specific command on chrome dev console to activate a plugin required for my test case. I am using testcafe framework for my tests.

there is an interface in java JavaScriptExecutor which is supported via selenium. I am trying to see if there is anything specific for testcafe which i could use


Solution

  • Have you tried inject scripts into head tag

    https://devexpress.github.io/testcafe/documentation/guides/advanced-guides/inject-client-scripts.html#access-dom-in-the-injected-scripts

    this might help