cancel
Showing results for 
Search instead for 
Did you mean: 

recorded script unable to find the object "GroupButtons"

Highlighted
Occasional Contributor

recorded script unable to find the object "GroupButtons"

Hello, 

I'm using Testcomplete 14.30.3743.7 version (License: Perpetual (Desktop))

We have desktop app, that I'm testing it with Testcomplete. There were everything OK in Testcomplete 12.60.5545.7 version. But now, when I upgrade my testcomplete version, there are some bugs. 

 

There is part of my code:

function test() {

...

Aliases.B6.DialogOneTimeFeeTypes.rgAppCard.TGroupButton.ClickButton();

...

}

There is a problem with GroupButton-s. Recorded scripts couldn't run , because program doesn't recognize GroupButtons. Problem appeared in  14.30.3743.7 version. When I record new script, there are no changes in it, everything is the same, but new script runs and works correctly, before next GroupButton.

We use "Record script" in javascript, not Keyword Test.

screen.PNG

9 REPLIES 9
Highlighted
Community Hero

Re: recorded script unable to find the object "GroupButtons"

Generally, this means that something has changed in the identification of the object.  For us to help you diagnose better we need to see.

 

1) The code you're attempting to run

2) A screenshot of the Mapping criteria for TGroupButton including the hierarchy

3) The "Additional Info" from your error message on the object not found

4) A screenshot of the Advanced Properties of button from your Object Browser.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Occasional Contributor

Re: recorded script unable to find the object "GroupButtons"

function OneTimeFeeTypes()
{
Aliases.B6.MainForm.MainMenu.Click("[8]|[10]|[17]|[0]");

//// View
Aliases.B6.MainForm.MDIClient.ListOneTimeFeeTypes.ViewBtn.Click(18, 15);
Aliases.B6.DialogOneTimeFeeTypes.CancelBtn.ClickButton();

//// Add
Aliases.B6.MainForm.MDIClient.ListOneTimeFeeTypes.AddBtn.Click(11, 19);
Aliases.B6.DialogOneTimeFeeTypes.edDescrip.Keys("ტესტკომპლიტ");
Aliases.B6.DialogOneTimeFeeTypes.edDescripLat.Click(34, 12);
Aliases.B6.DialogOneTimeFeeTypes.edDescripLat.Keys("testcomplete");
Aliases.B6.DialogOneTimeFeeTypes.lcbProductCategories.Click(339, 16);
Aliases.B6.DialogOneTimeFeeTypes.lcbProductCategories.Keys("[Down][Enter]");
Aliases.B6.DialogOneTimeFeeTypes.rgAppCard.TGroupButton.ClickButton();
// Aliases.B6.DialogOneTimeFeeTypes.rgAppCard.TGroupButton2.ClickButton();
Aliases.B6.DialogOneTimeFeeTypes.clbOpType.Click(444, 15);
Aliases.B6.DialogOneTimeFeeTypes.clbOpType.Keys("[Down][Down][Down][Down][Down][Down][Down][Down][Down][Down][Down][Down][Enter]");
Aliases.B6.DialogOneTimeFeeTypes.OKBtn.ClickButton();
//// Change
Aliases.B6.MainForm.MDIClient.ListOneTimeFeeTypes.EditBtn.Click(13, 21);
Aliases.B6.DialogOneTimeFeeTypes.edDescrip.Keys(GetRandomGeorgianText(5) + "[Tab]");
Aliases.B6.DialogOneTimeFeeTypes.edDescripLat.Keys(GetTranslatedTextToEng());
Aliases.B6.DialogOneTimeFeeTypes.rgAppCard.TGroupButton.ClickButton();
Aliases.B6.DialogOneTimeFeeTypes.OKBtn.ClickButton();
//// View
Aliases.B6.MainForm.MDIClient.ListOneTimeFeeTypes.ViewBtn.Click(18, 15);
Aliases.B6.DialogOneTimeFeeTypes.CancelBtn.ClickButton();
Aliases.B6.MainForm.MDIClient.ListOneTimeFeeTypes.Close();
}

 

here is my code fragment. 

when I record new script, there is the same TGroupButton Mapping criteria. 

there is new code fragment: 

function Test1()
{
var dialogOneTimeFeeTypes = Aliases.B6.DialogOneTimeFeeTypes;
var TDBRadioGroup = dialogOneTimeFeeTypes.rgAppCard;
var groupButton = TDBRadioGroup.TGroupButton;
groupButton.ClickButton();
var groupButton2 = TDBRadioGroup.TGroupButton2;
groupButton2.ClickButton();
groupButton.ClickButton();
groupButton2.ClickButton();
var txDBLookupCombo = dialogOneTimeFeeTypes.clbOpType;
txDBLookupCombo.Click(448, 12);
txDBLookupCombo.Keys("[Down][Down][Down][Enter]");
groupButton.ClickButton();
var txDBMemo = dialogOneTimeFeeTypes.mmSQL;
txDBMemo.Click(59, 70);
txDBMemo.Keys("4564");
}

Highlighted
Occasional Contributor

Re: recorded script unable to find the object "GroupButtons"

The main problem is that every groupButton in my code (and there is a lot in it) has the same problem. 

stops and when I reRecord script and fill it in code, it works, but there isn't any change by the view. 

In the old version, I had not these problem and now I should rewrite new code because of this problem, I think

Highlighted
Community Hero

Re: recorded script unable to find the object "GroupButtons"

The additional info gives us the clue.  The problem is not with TGroupButton it's with what is showing as VCLObject("rgAppCard").  I'm guessing that this is a timing issue.  There's an activity that you are doing in your main code before you call that GroupButton click.  I'm guessing that's waht creates the "rgAppCard" object.  So, this is a matter of making sure that there is sufficient code waiting for the objects to appear before they are utilized.  TC 14 has had some object identification improvements over TC 12 which has improved efficiency of the processing.  So, this might be a matter of TC 14 running FASTER than TC 12 and therefore objects are not created in time.

 

As a test, put an aqUtils.Delay(2000) right before you call to click the button.  if this works, then that means you need to re-write your code a bit for a better timing or increase your Default timeout.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Community Manager

Re: recorded script unable to find the object "GroupButtons"

Thanks for the help, @tristaanogre.

@temo25, was the issue resolved? Please share the solution with us.

 

 

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

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Occasional Contributor

Re: recorded script unable to find the object "GroupButtons"

I try Delay(2000) and also sleep(2000) before the TGroupButton, but result is the same. 

After that I record new script for groupButtons and paste it over the old groupButtons click.

It works. 

After that I comment second line (second groupButton click) and remove the comment mark an old groupbutton click and it works also. 

Aliases.B6.DialogOneTimeFeeTypes.rgAppCard.TGroupButton.ClickButton();
// Aliases.B6.DialogOneTimeFeeTypes.rgAppCard.TGroupButton2.ClickButton();
Aliases.B6.DialogOneTimeFeeTypes.rgAppCard.TGroupButton2.ClickButton();

I'm am very confused what to do. 

Agree you that TC14 is faster than TC12, but I think this is not problem about that case. 

How can I increase default timeout? 

Highlighted
Community Hero

Re: recorded script unable to find the object "GroupButtons"

As mentioned, from the error, the problem is with the rgAppCard and is most likely a timing issue.  Rewrite your code as follows.

 

var appCardObj = Aliases.B6.DialogOneTimeFeeTypes.WaitAliasChild('rgAppCard', 5000)

if (appCardObj.Exists) {

    appCardObj..TGroupButton.ClickButton();

}

else {

    Log.Error('regAppCard object does not exist')

}

 

And report the results.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Occasional Contributor

Re: recorded script unable to find the object "GroupButtons"

@tristaanogre thanks for help. I try this and keep testing, so I tell step by step: 

 

Aliases.B6.DialogCompanyAttribCodes.rbAttribType.TGroupButton.ClickButton();
Aliases.B6.DialogCompanyAttribCodes.rbAttribType.TGroupButton2.ClickButton();
Aliases.B6.DialogCompanyAttribCodes.rbAttribType.TGroupButton3.ClickButton();
Aliases.B6.DialogCompanyAttribCodes.rbAttribType.TGroupButton4.ClickButton();
Aliases.B6.DialogCompanyAttribCodes.rbAttribType.TGroupButton5.ClickButton();

 

this is fragment of my code, which didn't work. after that I record one click on TGroupButton2 and don't paste instead of this. Delete also new record script. 

Run an old fragment and TGroupButton2 works, but still not works other TGroupButtons.

Then record all five clicks on the buttons and immediately delete this record. 

Old code works. 

 

I think problem is an object before TGroupButton-s (in this case: rbAttribType), which TC should not find before new record script, even in that case if you immediately delete that new one.

Highlighted
Community Manager

Re: recorded script unable to find the object "GroupButtons"

@temo25 Great to hear you are making progress in the investigation! Anymore updates?


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors