selenium-ide icon indicating copy to clipboard operation
selenium-ide copied to clipboard

Running selenium recorder from terminal

Open Ashish3080 opened this issue 1 year ago • 5 comments

💬 Questions and Help

I want to use selenium recorder from command line. so how can I directly start the recording without using Selenium IDE UI.

Ashish3080 avatar May 09 '24 13:05 Ashish3080

Oh gosh, I'm sorry I haven't explored that possibility space. Although, @corevo once did some work to go down that path. If you'd like to invest in it's development, the tool is mostly functional here:

https://github.com/SeleniumHQ/selenium-ide/tree/trunk/packages/side-cli

We are looking at doing a pretty big architectural change soon when we'll look at making it so the IDE can basically be injected into any browser via preload scripts. However, we aren't there quite yet.

toddtarsi avatar May 09 '24 14:05 toddtarsi

The main pain point that needs to happen to allow use case flexibility like this is that a secure communication protocol needs to be provided to the preload scripts from the host process so that elevated access can be given in a secure way.

toddtarsi avatar May 09 '24 14:05 toddtarsi

Hi @toddtarsi thanks for the reply. I am using python for the record and playback of web elements. I have the playback file, where it follows the .side file to playback the recorded events. But I don't have the recorder to record the elements with their locators (xpath\css\ID\name) during runtime, which is creating a bottleneck in my project.

Ashish3080 avatar May 10 '24 06:05 Ashish3080

Are you able to maintain the side file in Selenium IDE v4? I would recommend working in the IDE for recording and playback, and then when you want to do python playback locally or via CI, you should re-transpile your side file to python using side-code-export.

npm i side-code-export @seleniumhq/code-export-python-pytest 
side-code-export @seleniumhq/code-export-python-pytest input.side /py-tests

toddtarsi avatar May 10 '24 14:05 toddtarsi

At some point, I'm going to revisit how the code sits next to the IDE, but there unfortunately isn't bidirectional awareness there yet.

toddtarsi avatar May 10 '24 14:05 toddtarsi