Ask a Question

Opening a specific path using Test Complete

SOLVED
ChandanD
Contributor

Opening a specific path using Test Complete

Hello,

I want to launch C:\XYZ\ using script

I am using below script

// This test case to download SVN folder
function checkoutsvn()
{
  var path
  try
  {
   myapp = Aliases.TortoiseProc 
   path = Project.Path
   var TIMEOUT= ProjectSuite.Variables.GetVariableDefaultValue("Timeout")
   var driverObject = DDT.ExcelDriver(path + "\\Testdata\\SVN_Testdata.xlsx","download",true)
   while(!driverObject.EOF())
   {
   Sys.Desktop.Keys("[Hold][Win]e[Release]") // Launching File explorer  
   var process = Aliases.explorer
   var search= process.FindChild(Array("WndCaption"),Array("File Explorer"),200)
   process.RefreshMappingInfo() 
   var addressbar = Aliases.explorer.wndCabinetWClass.WorkerW.ReBarWindow32.AddressBandRoot.progress.BreadcrumbParent.toolbarAddressQuickAccess
   Delay(500)
   addressbar.Click()
   delay(1000)
   address = Aliases.explorer.wndCabinetWClass.WorkerW.ReBarWindow32.AddressBandRoot.progress.comboBox
   fpath = DDT.CurrentDriver.Value(0)
   address.Keys(fpath) // Enter the path in access bar
   delay(100)
   address.Keys("[Enter]")
   delay(1000)
   var folderview = Aliases.explorer.wndKBData.KBData.DUIViewWndClassName.Explorer_Pane.CtrlNotifySink.ShellView.Items_View
   folderview.Click() // list of all files and folders 
   folderview.ClickR() 
   folderview.PopupMenu.Click("SVN Checkout...") // SVN Check out
   var p = myapp.WaitWindow("#32770", "Checkout", 1,TIMEOUT)
   myapp.RefreshMappingInfo()
   var checkout = Aliases.TortoiseProc.dlgCheckout 
   var URL = Aliases.TortoiseProc.dlgCheckout.cbxURLOfRepository
   var urlname = DDT.CurrentDriver.Value(1)
   URL.Keys(urlname)
  checkout.btnOK.Click()

It works fine on my machine n number of times. But when I run the script using Jenkins on a slave machine

I am getting error of The object "toolbarAddressQuickAccess" does not exist.

 

Can some one help me with this. 

 

Also I need to search an application is installed on not so I am using below script 

Here also it works on my machine but on Jenkins I am always getting 

The operation cannot be performed, because the desktop is invisible. 
Can someone help me with this also.

// This test case to check SVN is installed or not via DSM
function Check_SVN_Installation()
{
  var path
  try
  {
   path = Project.Path
   
   var driverObject = DDT.ExcelDriver(path + "\\Testdata\\SVN_Testdata.xlsx","Appname",true)
   while(!driverObject.EOF())
   {
   Delay(3000)
   var process = Aliases.explorer
   var search= process.FindChild(Array("WndCaption"),Array("Type here to search"),200) // Search icon on system tray
   search.Click()
   search.WaitProperty("Exists",true,2000)
   process.RefreshMappingInfo() 
   var appname = DDT.CurrentDriver.Value(0)
   Log.Message(appname)
   Sys.Desktop.Keys(appname) // enter app name in search key
   Log.Message("TortoiseSVN was found")
   delay(500)
   driverObject.Next()
   }
   DDT.CloseDriver(driverObject.Name)
  }
  catch(e)
  {
    Log.Error(e.message)

  }
}
14 REPLIES 14
BenoitB
Community Hero

Does your machine is locked ? Do you have desktop screen activated on ?

I'll check the desktop is invisible for both problems

Un sourire et ça repart

The desktop is not locked. But when I take remote connection of the PC and watch the execution the scripts works.

I don't know the reason for it.

ChandanD
Contributor

I am also facing one more problem with Jenkins. 

When I am trying to open the .xls file it is working in my machine because I have enabled option of enabling file name extension so below is the code which I am using

 var serword = win10folder.FindChild(Array("Value"),Array("Word_test.docx"),500)
   serword.DblClick() // newly created word document is opened.

 but on my Jenkins slave the file name extension is disabled for it gives me error cannot find the object with Find Child so I have to remove the extension and then it works. 

I tried by giving *.* but still it fails. 

Is there any way where I can find it even if it has .docx or not


@ChandanD wrote:

The desktop is not locked. But when I take remote connection of the PC and watch the execution the scripts works.

As i said that's the reason, when your are not connected the desktop screen is hidden/locked.

 

Hint here :

https://support.smartbear.com/testcomplete/docs/testing-with/running/via-rdp/in-minimized-window.htm...

 

 

 

Un sourire et ça repart

I added the Dword in registry. The desktop visible error is gone. 

But I received error Objeect not found for accessbar

At least one point done 😉

 

For object not found, perhaps because not exact same version of Windows ?

And check also if Explorer options are identical.

 

Un sourire et ça repart

Hello,

 

Both the system have same operating systems (Win 10). I am using Test Complete to develop the script and Jenkins have Test Execute to run the scripts.

File Explorer is also the same as you can see from my script I am calling Windows +E to launch it which is common.

So I am not getting any clue what is happening. I cannot always watch the execution and say the scripts are getting passed or the build job is getting passed.

If there is some solution like launching the explorer using aqtime or Scripting.FileSystem please let me know.

TanyaYatskovska
SmartBear Alumni (Retired)

Hi @ChandanD,

Is there any specific reason why you open a file via Window Explorer? TestComplete has some special features to open the needed file, like aqFile.OpenTextFile.

Also, TestComplete provides the OpenFile method that opens the file from the application's File | Open main menu

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



The reason I want to open file explorer is I have to automate the Tortoise SVN process.

Like go to a specific folder path. Do checkout

Launch Word document and perform subversion actions of commit

Launch excel sheet and perform subversion actions of add, lock

so to go to specific folder path and right click to perform tortoise svn functions. 

 

The scripts are designed and working on local machine. The problem is with Jenkins slave only where I'm facing issues.

cancel
Showing results for 
Search instead for 
Did you mean: