ClickOnce is a .NET technology that allows users to install and run various applications (typically, .NET, WPF or CEF) by clicking a link on a web page. TestComplete supports testing of applications deployed via ClickOnce and provides built-in operations that let you launch ClickOnce applications from tests.
Apr 04, 2018 Adds basic support for launching ClickOnce applications (by Menarva Ltd). Adds basic support for launching ClickOnce applications (by Menarva Ltd).
About ClickOnce Applications
ClickOnce applications differ from usual desktop applications in the way applications are installed and launched. Unlike usual applications installed to the Program Files folder or a user-defined folder, ClickOnce applications are installed into the user profile, to a subfolder with an obfuscated name. As a result, it is difficult to know the exact application location on the disk and launch the application’s executable file directly.
https://bonusheavenly.weebly.com/blog/gigabyte-driver-installer. From the user’s point of view, ClickOnce applications can be launched in two ways:
TestComplete supports and lets you automate both ways of launching ClickOnce applications.
Creating and Recording Tests for ClickOnce Applications
Testing of ClickOnce applications is similar to testing generic .NET and WPF applications. The only difference is the way of launching the tested application.
The general procedure is as follows:
Python
VBScript
Sub Test
Dim url, p ' The URL of the application's publish page url = 'http://server/myapp/publish.htm' ' Open the application's publish page in a web browser Browsers.Item(btIExplorer).Run url ' Install the application and wait until the installation is complete Sys.Browser().Page(url).FindChildByXPath('//A[@id='InstallButton']').Click Sys.Process('dfsvc').WinFormsObject('TrustManagerPromptUI').WinFormsObject('tableLayoutPanelOuter').WinFormsObject('tableLayoutPanelButtons').WinFormsObject('btnInstall').ClickButton Do While Sys.Process('dfsvc').WaitWinFormsObject('UserInterfaceForm', 1000).Exists aqUtils.Delay 1000 Loop ' Automate the launched application Set p = Sys.WaitProcess('MyApp', 60000) .. End Sub
DelphiScript
procedure Test;
var url, p; begin // The URL of the application's publish page url := 'http://server/myapp/publish.htm'; // Open the application's publish page in a web browser Browsers.Item(btIExplorer).Run(url); // Install the application and wait until the installation is complete //Sys.Browser.Page(url).NativeWebObject.Find('ObjectIdentifier', 'InstallButton', 'A').Click; Sys.Browser.Page(url).FindChildByXPath('//A[@id='InstallButton']').Click; Sys.Process('dfsvc').WinFormsObject('TrustManagerPromptUI').WinFormsObject('tableLayoutPanelOuter').WinFormsObject('tableLayoutPanelButtons').WinFormsObject('btnInstall').ClickButton; while Sys.Process('dfsvc').WaitWinFormsObject('UserInterfaceForm', 1000).Exists do aqUtils.Delay(1000); // Automate the launched application p := Sys.WaitProcess('MyApp', 60000); .. end; Clickonce Application Install Path
C++Script, C#Script
function Test()
{ // The URL of the application's publish page var url = 'http://server/myapp/publish.htm'; // Open the application's publish page in a web browser Browsers['Item'](btIExplorer)['Run'](url); // Install the application and wait until the installation is complete Sys['Browser']()['Page'](url)['FindChildByXPath']('//A[@id='InstallButton']')['Click'](); Sys['Process']('dfsvc')['WinFormsObject']('TrustManagerPromptUI')['WinFormsObject']('tableLayoutPanelOuter')['WinFormsObject']('tableLayoutPanelButtons')['WinFormsObject']('btnInstall')['ClickButton'](); while (Sys['Process']('dfsvc')['WaitWinFormsObject']('UserInterfaceForm', 1000)['Exists']) aqUtils['Delay'](5000); // Automate the launched application var p = Sys['WaitProcess']('MyApp', 60000); .. } Flv video downloader software. Knowing the Location of the Application's Deployment ManifestClickonce Application Location
You need to know the location of the ClickOnce application's deployment manifest (.application) or shortcut (.appref-ms) to be able to run this application from your test. If you installed the tested ClickOnce application from a web page and do not know the location of its manifest file, you can use one of the following approaches to learn it:
See Also
Supported Development Tools
Adding ClickOnce Applications to Tested Applications About Tested Applications Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |