Contributions
How to Treat App Crash
I'm having some trouble with some old scripts. Before, VBScript was used on our Automation Project, and I'm not aware about how to use that On Error GoTo to treat app's crashes. Using try..catch would be easy, but how can I use On Error GoTo? TestComplete's help file isn't very clear. On VB6, it would be like this (check line 2 and line 14): Public Function addSGBD(model As String, description As String, server As String, user As String, password As String) On Error GoTo errvb description = Replace(description, "\", "\\") server = Replace(server, "\", "\") 'server = Replace(server, "\", "\\") If rrSet("SELECT COUNT(*) AS qtd FROM gdt_sgbds WHERE description='" & description & "'", Conn).Fields("qtd").Value = 0 Then rrSet "INSERT INTO GDT_SGBDS(model,description,server,user,password) VALUES('" & model & "','" & description & "','" & server & "','" & user & "','" & crypt(password) & "')", Conn addSGBD = 1 Else addSGBD = 1003 End If Exit Function errvb: GeraLog "GDT_LOG" & StrToData(Date), "AdministracaoDeSGBD.addSGBD" & vbCrLf & Err.Description End Function But VBScript doesn't work like that. The log folder is attached as a zip file. Hope someone can help me.Solved5.6KViews0likes2CommentsRe: How to handle wait Pop up (Progress bar) in TestComplete
Hello Ravi Khapre, how are you doing? There are many ways to wait for this pop up window to disappear. You can use the WaitWindow method to check if the window is shown, and then the .Exists method as loop to wait while the window is been shown. Like this: p = Sys.Process("Notepad"); // Waits for the window for 10 seconds w = p.WaitWindow("*", "Open*", -1, 10000); while(!w.Exists) { Delay(1000) } Check this article for more information (I've edited the code above for your need): Waiting for an Object, Process or Window Activation2.4KViews1like0CommentsRe: Modify selected properties
Hello Mike. I'm not sure I am following what you need. This properties are the current state of the object you have selected. It says that the object is Enabled, Visible and has no Caption. I think those properties are Read-Only. Hope it helps, but lets wait for someone with more experience than I to answer this too.2KViews1like0CommentsRe: Resizing Windows
Hello my friend. Try the Position Action article. However, the script should not depend on how big is the screen. Are you creating scripts by coordinates? I just can assure you that it is possible to maximize the window size, by using the property .Maximize() - you can read more about it on Window Object Methods article. Hope it helps. Regards, Joffre Mota2.2KViews1like0CommentsRe: Generic object for Event .ClickButton(cbChecked)
Exactly! You understood that idea... we are almost there. On my test, I'll call this function like this: verificarClickCheckBox("bTRABALHADOR_URBANO_PJ", "chkTrabalhadorUrbanoPJ", "Trabalhador Urbano - PJ - CLT"); Where chkTrabalhadorUrbanoPJ is declared as: chkTrabalhadorUrbanoPJ = Sys.Process("FPw5_CadCalc").VBObject("Form1").Window("MDIClient").VBObject("cdSituacoes").VBObject("fraSituacao_5").VBObject("Vinculos_11"); What I want to know is if there's a generic CheckBox object that will be replaced for the real CheckBox object. So, I can use just this line several times, instead of create a new if for each CheckBox of my application.2.2KViews0likes0CommentsRe: Generic object for Event .ClickButton(cbChecked)
It is erroring on this line if (registros.Fields(nomeColuna).Value == "S") { Where is the registros object declared? If that object does not exist, then it won't have a fields collection. I may be full of balogna, but that is what I see. Hello, thanks for your reply. The registros variable is being declared on other function. As I said, the problem is on line: nomeComponente.ClickButton(cbChecked); and the returned error is attached. The 'nomeComponente' will be replaced by a CheckBox component name, but it isn't working as expected (it isn't working at all).2.2KViews0likes0Comments