Contributions
Re: Object Required error, please help!
In case anyone sees this... I have this working now and I don't know why I didn't see it sooner. I forgot to set the Project variable to Object and then Eval() the w.MappedName so it was not a string. You can only stare at code for so long before your brain turns to mush 🙂 I also fixed my logging. If anyone sees any other suggestions please let me have it!! Thank you and I hope this might help someone in the future.202Views0likes0CommentsObject Required error, please help!
Hello, I am trying to use a value that is stored in a Project level variable but I am getting am Object Required error. The error in TC showy the value but it is showing the value as incomplete. When I log the variable it logs out complete. The Project level variable is being set by another procedure which also logs the value as correct to the log. I am identifying the current form displayed on the screen using FindChild and sending it to a Project variable. From another script I am setting a local variable to the value of the Project variable and then attempting to use it. When I do I get an error "Object Required:'[string: "Aliases.Signon.frmPS"]'. When I log the values for "Project.Variables.whereAmI" and "cFrm" they write to the log as expected: Aliases.Signon.frmPSInvoices. I don't know where I am going wrong! My code: (error is coming from bold line) Sub Suspend_Transaction_AnyUser() Dim transType, cFrm transType = "" ' initialize Transaction Type cFrm = "" ' initialize Current Form visible on-screen Call whereAmI 'Update value for Project.Variables.whereAmI Log.Message(Project.Variables.whereAmI) ' Set current form value and log for troubleshooting Set cFrm = Project.Variables.whereAmI Log.Message(cFrm) Call cFrm.StripMainMenu.Click("File|Suspend") Call aqObject.CheckProperty(Aliases.Signon.frmSuspend, "WndCaption", cmpEqual, "Suspend Transaction") ' transType = Aliases.Signon.frmSuspend.txtFriendlyName.wText Call Aliases.Signon.frmSuspend.radioSuspendToGlobal.ClickButton Call aqObject.CheckProperty(Aliases.Signon.frmSuspend.radioSuspendToGlobal, "Checked", cmpEqual, True) Call Aliases.Signon.frmSuspend.txtDescription.Keys("Suspended Automated test: " + KeywordTests.Suspend_Transaction.Variables.transactionType) Call aqObject.CheckProperty(Aliases.Signon.frmSuspend.butProcess, "Enabled", cmpEqual, True) End Sub '------------------------------------------------------------- '------------------------------------------------------------- Sub whereAmI ' Use to identify current form displayed '--------------------------------------------------- ' Define property array: pArray,Values array: vArray ' p: process, w: window Dim pArray, vArray, p, w pArray = Array("MappedName", "VisibleOnScreen") vArray = Array("Aliases.Signon.frm*", True) Set p = Sys.Process("Signon") Set w = p.FindChild(pArray, vArray, 1) If w.Exists Then Log.Message w.FullName Project.Variables.whereAmI = w.MappedName Log.message(Project.Variables.whereAmI) Else Log.Error "The object was not found." End If End SubSolved221Views0likes1CommentRe: Testcomplete no longer executes VBScript, logs: The server threw an exception
We are doing additional troubleshooting any have found its is one of the oldest scripts we have and has not been altered in almost a year. It is a script which populates a data grid from an excel file.742Views0likes0CommentsTestcomplete no longer executes VBScript, logs: The server threw an exception
Hello, Yesterday my TestComplete(12.6) began posting the following message when ever we try to run any scripts: "VBScript runtime error. The server threw an exception". There have been no changes to the overall project or Testcompletes settings or to any of the scripts that now error. I have always had issues with TC routinely erroring and needed a restart but that did not work. We have yet to find any reason in the environment or the pc that could account for this as well. I was able to find a similar post from 2016 from another user to which no one replied. Currently our entire project can no longer execute and any suggestions would be much appreciated! Thank you.745Views0likes2CommentsIdentify current form for script use
Hello, I am trying to write a reusable script with a data loop in TestComplete 12, VB Script. Is there a way for me to identify the current active form? I have searched extensively and found nothing. My script interacts with a data grid and enters a file determined number of items and is quite simple but I would like to use this identification feature in other scripts as well. The grid is on the same location of every form but the form name changes example below: 1.Sys.Process("Signon").WinFormsObject("frmPSSales").WinFormsObject("RightFillPan").WinFormsObject("clientPanel").WinFormsObject("SpDataGrid1") 2.Sys.Process("Signon").WinFormsObject("frmPSOrders").WinFormsObject("RightFillPan").WinFormsObject("clientPanel").WinFormsObject("SpDataGrid1") I would like to capture the current "Sys.Process("Signon").WinFormsObject("********")." of the current form so it does not have to passed in to the function. An example of what im doing is below: Sub HMMMM() frm = "" frm = "This would be the retrieved form fullname or mapped name" Call Project.Variables.itemNum.Reset While Not Project.Variables.itemNum.IsEOF 'Enters the text Project.Variables.itemNum("ItemNumber") in the 'txtBase' text editor. Call frm.UcGetItemA1.panBase.txtBase.SetText(Project.Variables.itemNum.Value("ItemNumber")) 'Enters '[Enter]' in the 'txtBase' object. Call frm.UcGetItemA1.panBase.txtBase.Keys("[Enter]") 'Enters '[Enter]' in the 'SPTextBox' object. Call frm.SPTextBox.Keys("[Enter]") Call Project.Variables.itemNum.Next WEnd End Sub Any help is greatly appreciated.Solved1.4KViews0likes5CommentsRe: Finding an object when form name changes but every form has the same object
Additional info: This is the sample I am trying to use and I feel like my issue is with the "Set p =". I have tried to use wild cards like(Sys.Process("Signon").WinFormsObject("*").WinFormsObject("LeftPanel").WinFormsObject("labLogo") but that does not work. I have also tried findChild but it still finds the wrong control and cannot access it because it is not visible. sub findTest Dim p, control ' Searches for the control Set p = Sys.Process("Signon") Set control = p.Find("WinFormsControlName", "labLogo", 1000) ' Processes the search results If control.Exists Then Log.Message control.FullName Else Log.Error "The object was not found." End If End Sub884Views0likes1CommentFinding an object when form name changes but every form has the same object
Hello, This explanation may be poor but I am trying to script this for the first time. I have an object that I need to interact with regardless of what form I am on. I have tried to use the example provided by support but I cannot get it to work. There is a label on every form in our application that when click can navigate to the main form of the application. Sys.Process("Signon").WinFormsObject("#######").WinFormsObject("LeftPanel").WinFormsObject("labLogo") The WinFormsObject("######") changes with every form but it is always the ending WinformsObject("labLogo"). When I use Find it finds the object but on the Sys.Process("Signon"). I need it to find the object on whatever the current form is and take action against it. I have tried everything I could think of using the support and community to no avail. I am using VBScript if that changes anything. Thank you for any help!!!Solved896Views0likes2CommentsRe: Windows "Open File - Security Warning" dialog not registered during recording
This is how I dealt with the same issue. Never have been able to get this security dialogue to work via testcomplete. http://woshub.com/how-to-disable-open-file-security-warnings-in-windows-7/ Also works in Win101.9KViews0likes0CommentsRe: Windows "Open File - Security Warning" dialog not registered during recording
This is a workaround. I have also been unable to address the security dialogue and just removed it from the equation by setting up the network location as follows. This is for windows 7 but works on 10 as well. http://woshub.com/how-to-disable-open-file-security-warnings-in-windows-7/ Hope this helps.1.9KViews0likes0Comments