SeleniumHQ / selenium-ide

Open Source record and playback test automation for the web.
https://selenium.dev/selenium-ide/
Apache License 2.0
2.83k stars 768 forks source link

Running selenium recorder from terminal #1827

Open Ashish3080 opened 6 months ago

Ashish3080 commented 6 months ago

💬 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.

toddtarsi commented 6 months ago

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 commented 6 months ago

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.

Ashish3080 commented 6 months ago

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.

toddtarsi commented 6 months ago

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 commented 6 months ago

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.