Ask a Question

Startup of application within a Docker Container

SOLVED
rsaritzky
Occasional Contributor

Startup of application within a Docker Container

Hi,

 

Has anyone tried to start a desktop application within a Docker container?  We do development on our local machines in a Docker environment.

 

Can I pass a powershell script name which starts my docker environment and starts my desktop app to TestComplete?

 

Thx

Ron

1 ACCEPTED SOLUTION

Accepted Solutions
Marsha_R
Community Hero

Re: Startup of application within a Docker Container

Here's how to run a Powershell script from TestComplete.  It doesn't know what's in the script, so this should work for you.

https://support.smartbear.com/testcomplete/docs/testing-with/advanced/using-external-functions/runni...

 

Try it and let us know what happens!

Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame

View solution in original post

4 REPLIES 4
Marsha_R
Community Hero

Re: Startup of application within a Docker Container

Here's how to run a Powershell script from TestComplete.  It doesn't know what's in the script, so this should work for you.

https://support.smartbear.com/testcomplete/docs/testing-with/advanced/using-external-functions/runni...

 

Try it and let us know what happens!

Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame

View solution in original post

rsaritzky
Occasional Contributor

Re: Startup of application within a Docker Container

Thanks for the link on running Powershell scripts. Here's my followup question:

I'm creating tests only by using the "Record" function. We're not writing any scripts (yet).

Do I have to convert the Test to a script first, then add the "getActiveXObject("WScript.Shell").Run("powershell -file C:\\MyScript.ps1");" command? Or is it something different?

Thanks,

Ron

The information transmitted in this electronic communication is intended only for the person or entity to whom it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities, other than the intended recipient, is prohibited. If you received this information in error, please contact the sender and the privacy officer, and properly dispose of this information.
Marsha_R
Community Hero

Re: Startup of application within a Docker Container

You can use Run Code Snippet inside a keyword test in order to execute a script.

https://support.smartbear.com/testcomplete/docs/keyword-testing/reference/test-actions/run-code-snip...

Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
rsaritzky
Occasional Contributor

Re: Startup of application within a Docker Container

Thanks for all the suggestions so far.  I'm not quite there, but getting close:

 

I created a script that runs my powershell script which starts my docker container and runs a command to start my app:

function StartNav()
{
WshShell.run("powershell -file C:\\users\rons\desktop\Start-NAV.ps1")
}

 

When I run the command directly in Windows 

powershell -file C:\\users\rons\desktop\Start-NAV.ps1

 

My app starts correctly and the opening page in my app is displayed as I expect it.

When I run the above script inside TestComplete,  the app does not start, but the Script Test Log is successful (but empty).

I see the Powershell window open briefly, but it disappears too quickly, so I can't see if there are any errors.

 

I searched the Community and saw a couple of references from several years ago to running TestComplete as Administrator, which I also tried with the same result.

 

Does anyone have any other suggestions?

 

 

cancel
Showing results for 
Search instead for 
Did you mean: