How can I simulate sfdx:force:org:open?

184    Asked by DavidPiper in Salesforce , Asked on Apr 27, 2023

I want to write a few automation that will run on cli and use sfdx force:org:open. How do I simulate the command?
The automation needs the url that sfdx... command leads to in the browser.Example I want to be able to reach the page using selenium. Though I can put this command itself in the automation script but that will not link selenium to it.
Also lets say I obtain the url somehow in my script, if I access that link using selenium will I be able to or will I encounter any access issue?

So if I run the command from python using subprocess

cmnd='sfdx force:org:open' run(cmnd,shell=True)

I am able to access the org like usual, but I want to access the url in code without actually accessing the link in the browser.


Answered by Fiona Dickens

Adding the -r flag to the command will return the URL instead of attempting to open in browser

sfdx force:org:open -r

Your Answer

Interviews

Parent Categories