Absent Member.. disdainfull Absent Member..
Absent Member..
144 views

QTP 11 running a test with App.Visible=False makes QTP window appear

I am trying to run tests in automation with the App.Visible property set to "False".  It remains invisible until the test is run and the window appears.  How do I keep it invisible?  Is there a performance increase by doing this like in QTP 10?

0 Likes
7 Replies
Highlighted
Absent Member.. MisterT1968 Absent Member..
Absent Member..

Re: QTP 11 running a test with App.Visible=False makes QTP window appear

Hi,

 

Can you please post the complete VBScript source code here? Please note, that you cannot run this from within QTP/UFT itself.

 

Best regards,

Tino Pacholski

Functional Testing Support Engineer

[If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]
0 Likes
Absent Member.. disdainfull Absent Member..
Absent Member..

Re: QTP 11 running a test with App.Visible=False makes QTP window appear

...
	Set App = CreateObject("QuickTest.Application")
	App.Launch
	App.Visible = False
...
							'run test
							filetxt.Write("          	Started: "  & Now)
							runTest objTest.Path, resultPath, testerName
...

'End of script
...

Sub runTest(ByVal testName, ByVal resultPath, ByVal developer)
...
	Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object
	qtResultsOpt.ResultsLocation = resultPath ' Set the results location
...
	If runTests and runThisTest Then
		App.Test.Run qtResultsOpt, True' Run the test and wait for it to finish before proceeding
	Else
		App.Test.Run qtResultsOpt, False' Run the test and do NOT wait for it to finish before proceeding
		App.Test.Stop
	End If
	
...
End Sub

...

 The window is invisible until it gets to the conditional statement you see and the bottom that runs the test.  Once the test has started to run the QTP window appears.  I cannot provide all of the code but these are the lines that pertain to my issue.

0 Likes
Absent Member.. bobando Absent Member..
Absent Member..

Re: QTP 11 running a test with App.Visible=False makes QTP window appear

Hi disdainfull,

 

I wonder if you get the same issue (QTP being visible) if you run the same script without the condition statement (and even out of the Sub. For example, based on the code provided try it in a simple way like:

 

Set App = CreateObject("QuickTest.Application")
App.Launch
App.Visible = False

 

Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions")
qtResultsOpt.ResultsLocation = resultPath

 

App.Test.Run qtResultsOpt, True

 

 

If the above does not generate the issue, you could play around your code in order to verify if either the condition, the Sub or some variable could be causing this. 

 

Thanks,

Braulio

HP | Unified Functional Testing Engineer

[If this post or any other post helps to resolve your issue or query, mark the thread as solved and give KUDOS to the author for their assistance. ]

(Posts and opinions made here are my own and do not reflect the opinions of my employer HP in any way)
0 Likes
Absent Member.. disdainfull Absent Member..
Absent Member..

Re: QTP 11 running a test with App.Visible=False makes QTP window appear

I ran the following code and it still opens the QTP window once the test starts to run.

 

Set App = CreateObject("QuickTest.Application")
App.Visible = False
App.Launch

App.open "C:\...\TesterRoleVerification", True

Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions")
qtResultsOpt.ResultsLocation = "C:\...\QTPtestRun\"

App.Test.Run qtResultsOpt, True

Set qtResultsOpt = Nothing
App.Quit
Set App = Nothing

 

0 Likes
Absent Member.. MisterT1968 Absent Member..
Absent Member..

Re: QTP 11 running a test with App.Visible=False makes QTP window appear

Hello,

 

How are you? I hope you are fine 🙂

 

Can you please check, whether or not it makes a difference, if the visible part is executed after the launch part (switch the lines)?

 

In this case, I think it would be better to raise a case with FT Support via http://support.openview.hp.com. So far we did not have any reports about such a behavior. I am also not able to reproduce this on my QTP 11 machine. It might be related to the configuration of the specific machine.

 

Please make sure, that you have all mandatory patches and hotfixes are installed. A list can be found in our knowledgebase.

 

Best regards,

Tino Pacholski

Functional Testing Support Engineer

[If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]
0 Likes
Absent Member.. disdainfull Absent Member..
Absent Member..

Re: QTP 11 running a test with App.Visible=False makes QTP window appear

Changing the order for the visible property did not change anything as I expected from how the Help file describes the property.  These are the Patches and Hotfixes installed on my machine:

 

Product Information 
 
 
Product name: QuickTest Professional 
 
Product version: 11.00 
 
Product ID: QTPRPID11.00/01 
 
Product build: 1018 
 
Operating system: Microsoft Windows 7 Service Pack 1 (Build 7601) 
 
Internet Explorer version: 8.0.7601.17514 
 
ALM/QC connectivity: 11.0.0.3803 
 
  
 
Add-in Information: 
   
 Name  
   
 ActiveX  
 ASPAjax  
 Visual Basic  
 Web  
 Web Services  
   
 
 
 
Hotfix and Patch Information: 
   
 Name  
   
 QTP_00709 for HP QuickTest Professional 11.00 QFE  
 QTP_00906 for HP QuickTest Professional 11.00  
 QTP_00925 for HP QuickTest Professional 11.00  
   
 
 
Note: The readme files for all installed hotfixes and patches are available in C:\Program Files (x86)\HP\QuickTest Professional\HotfixReadmes 
 
 
© Copyright 1992–2010 Hewlett-Packard Development Company, L.P.

 

 

0 Likes
Absent Member.. MisterT1968 Absent Member..
Absent Member..

Re: QTP 11 running a test with App.Visible=False makes QTP window appear

Hi,

 

Thank you very much for your update.

 

Please open a case with support in order to investigate further.

 

Best regards,

Tino Pacholski

Functional Testing Support Engineer

[If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.