HomeAutomation

Always run command prompt as administrator windows 10

Always run command prompt as administrator windows 10
Like Tweet Pin it Share Share Email

We mentioned several times in our articles or responses to user queries that we need to run OATS or run command prompt as administrator, It becomes quite annoying if you have to do it every time. So we are sharing with you as how to set it for good and need not do it repeatedly.

Especially when working with OATS, people want to execute scripts from command prompt and land on to the following error

“oracle.oats.scripting.modules.webdom.common.api.exception.BrowserHelperException: Cannot get a connection from helper after 120 seconds”

Steps how to always run command prompt as administrator

  • Type cmd in your windows start program
Command prompt menu
  • Right click on Command Prompt and select “Open file location”
  • You will see the short cut files command prompt, run, control pane and etc
Command prompt and other shortcuts
  • Right click on command prompt shortcut and select properties menu to view the Command Prompt properties window.
Command prompt properties
  • Click on “Advanced” button to see the “Advanced properties” window
command prompt advanced properties, run as administrator unchecked
  • Select the checkbox “Run as administrator” and click OK button
Command prompt advanced properties
  • Click on “Apply” in command prompt properties window and click OK to close it.
  • You might be asked to provide administrator username and password, so which means your user should have the admin privileges. Otherwise, you will not be able to set this option.

From next time on wards whenever you open a command prompt you will see that it starts with “Administrator privileges” by default

run command prompt with administrator privileges

There is one last thing that you need to do, otherwise you end up entering username & password every time you launch the command prompt. You need to set the User Account Control settings to “Never notify me when”

How to change UAC in Windows 10 – ideally same for all windows versions

  • Open windows start menu and type “UAC”
User Account control settings menu
  • Select Change User Account Control Settings
User Account control settings
  • Drag down the lever to have it available at “Notify never when” this way user need not enter the username and password every time.

This is all you need to do so that you can always run command prompt with administrator privileges, in case of any queries please feel free to reach to us in form of comments.

lambdatest

Comments (6)

  • Thank you Srinivas for sharing information.

    i have one doubt can we ran OATS EBS/FORMS scripts through grid like selenium.
    when i ran OATS EBS/FORMS scripts through bat file, it is working fine, but scripts are executing background at that time screen shot are looking black, is there any way to run foreground.

    Thank you

    Thank you

    Reply
    • Author

      Yes one of the option is to use Oracle Test Manager, where you can attach multiple nodes and trigger multiple scripts in parallel across these machines. But you will still have an issue of screenshots being blank. One of the solution is to keep the other machines logged in and make sure their screens are not locked.

      Also, you need to make the execution view able, configuration is explained in this article.

      Reply
      • Thank you srinivas for reply

        When i run bat file through SMA machine at that time screen shots are not capturing and script are executing background. Is there any way to run foreground with screen shots.

        Thank You

        Reply
        • Author

          As of now there is no solution available, which I am aware of, in case you find one please do share it here it will be a great value add to the readers too

          Reply
  • Hi Srinivas,

    Currently am facing below issue. When I double clicked on .bat file which I created to execute openscripts scripts, its working as expected.

    But same .bat file if I trigger from Jenkins, am keep on getting below error message.

    oracle.oats.scripting.modules.webdom.common.api.exception.BrowserHelperException: Cannot get a connection from helper after 120 seconds.

    May I know do you have any solution to resolve this issue.

    Thanks,
    Lakshmi

    Reply
    • Author

      Hi Lakshmi Narayana,

      Thank you for reaching out to us, I am assuming that the bat file is not getting triggered with elevated privileges. Not sure if you are getting issue even if the bat file is triggered with elevated privileges.

      Well, we can go on a screen share and see how we can solve this issue, as you have reached out to me on whatsapp, we can continue to discuss how we can proceed there.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *