cancel
Showing results for 
Search instead for 
Did you mean: 

Opening a specific path using Test Complete

SOLVED
Highlighted
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
Highlighted
Contributor

Hello,

 

Can anyone tell me how to open a word document from C:\XYZ.

I can create a word document using aqfile.

But I want to launch the word document so that I can automate Subversion plugin.

Highlighted
Contributor

Now my scripts stopped w orking even after adding registry.

It only works when I am watching the execution with remote desktop.

Kindly suggest solution

Highlighted
Contributor

The testcase which I want to do is :-

Go to a folder
Perform SVN Checkout
Add a folder
Commit the folder
Add a Word document
Launch Word document, Perform action and commit
Add an Excel sheet
Launch Excel sheet, Perform action and commit.

Please someone help me.

Highlighted
Community Manager

You can open a Word file by using it's COM object. Perhaps, it will be a way you can use to run the needed plugin also. 

Here is a sample code to open the file:

'VBScript
Set oWord = Sys.OleObject("Word.Application")
oWord.Visible = True
oWord.Documents.Open "C:\YourFile.doc"

 

---------
Tanya Gorbunova
SmartBear Community Manager

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today

View solution in original post

Highlighted
Contributor

But what about my other issues.

How shall I launch the file explorer and performs my test cases.

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get properties of a web page element

See replies!

Compare images using the Region Checkpoint

See replies!

Compare HTML table with Excel file and correct data in Excel file

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!
Top Kudoed Authors