Forum Discussion
What sort of element? What are the properties? What code are you executing?
Depending upon what's going on, it could be that the "Click" is not executing because there are other things that need to complete before the method is available... for example, if the component on the page doesn't exist yet, there are some built in "wait" routines that check to see if the item is ready to be interacted with before it proceeds.
If you can post the script code you are executing or a screenshot of your keyword test, perhaps a screenshot of the component you are interacting with as rendered, and even a screenshot of the component properties are they are recognized in the TestComplete object browser, we can probably find a solution for you.
It is a check box click, here is code snippet:
if (checkBox.checked == true) {
Log.Message(metaDataLabel[i] + " is available on the application---");
matchSuccess("'" + metaDataLabel[i] + "' column metadata is in CHECKED state by default.");
} else {
Log.Message(metaDataLabel[i] + " is available on the application---");
matchFaliure("'" + metaDataLabel[i] + "' column metadata is in UNCHECKED state by default.");
// checkBox.ClickChecked(true);
checkBox.Click();
loadingResults(searchResultsGadget);
matchSuccess("Now '" + metaDataLabel[i] + "' column metadata made into CHECKED state.");
}
- tristaanogre8 years agoEsteemed Contributor
Interesting... but still not giving me enough info... What, exactly is "checkbox"? How is it mapped? It's obvious you're running this through some sort of loop with an index i so there's other processing happening somewhere to identify "checkbox". Is your namemapping using extended find? Are you doing a FindChild or Find call to determine checkbox?
There are a number of things that would factor into determining what can be done to an object. Also, I think there is some other side of things going on... the log entry for an event I don't think happens ON the click but on when "Click" returns... so... you're clicking on the checkbox... what happens next? Are there things that are happening in the web application that clicking the checkbox triggers that it needs to wait for it to return before it continues?
Other questions:
Is this a new problem that just started happening or is this something that's been going on for a while? If it just started happening, what has changed since it last worked?
In short: There are a LOT of factors in automated testing that affects performance. Yes, a "click" action should be pretty simple... but just reading between the lines of your code tells me that there is not-simple stuff going on both in your script code as well as in the application that could have an effect on your timing.
In short short... need more info.- rndasa8 years agoOccasional Contributor
Here is the total script...it is pretty simple logic...
1) Validating All meta data items availability and their checked status.
2) If they are not in checked state then log it and then click that check box for changing its status.
These two things were performed (validation and action) on that web element, checkbox selection resulting column appearance in a web table. But web table refreshing takes just some MICRO seconds only.
This issue able to see last couple of weeks in TestComplete11.2.
Attaching LOG FILE...Please go through the time stamps for better understanding of the issue.
function verifyMetaData(getExcelData) {
StepIn_on("Settings metaDataItem validation", clBlue);
var resultsHeader = Aliases.SEARCH_RESULTS_HEADER;
var metadataContainer = commonFunctions.PerformAction(resultsHeader, ["objectType", "classname"], ["Panel", "fields"]);
var leftMetadataContainer = commonFunctions.PerformAction(metadataContainer, ["objectType", "classname"], ["Panel", "left"]);
var rightMetadataContainer = commonFunctions.PerformAction(metadataContainer, ["objectType", "classname"], ["Panel", "right"]);
var metaDataItem = leftMetadataContainer.FindAllChildren(["ObjectType"], ["Label"], 2).toArray();
metaDataLabel = []
for (j = 0; j < metaDataItem.length; j++) {
metaDataLabel[j] = metaDataItem[j].contentText
}
metaDataItem.reverse();
metaDataLabel.reverse();StepIn_on("Available toggle metaDataLabels", clDkGray);
for (k = 0; k < metaDataLabel.length; k++) {
Log.Message(metaDataLabel[k]);
}
stepOut();
if (arraysIdentical(metaDataLabel, getExcelData)) {
for (i = 0; i < metaDataLabel.length; ++i) {
StepIn_on(metaDataLabel[i], clDkGray);
var checkBox = metaDataItem[i].FindChild(["ObjectType"], ["CheckBox"], 2);
if (checkBox.checked == true) {
Log.Message(metaDataLabel[i] + " is available on the application---");
matchSuccess("'" + metaDataLabel[i] + "' column metadata is in CHECKED state by default.");
} else {
Log.Message(metaDataLabel[i] + " is available on the application---");
matchFaliure("'" + metaDataLabel[i] + "' column metadata is in UNCHECKED state by default.");
// checkBox.ClickChecked(true);
checkBox.Click();
loadingResults(searchResultsGadget);
matchSuccess("Now '" + metaDataLabel[i] + "' column metadata made into CHECKED state.");
}
stepOut();
}
} else {
matchFaliure("Search results meta data items miss matching with source list.");
}
stepOut();
}- tristaanogre8 years agoEsteemed Contributor
Cool... thanks for the code...
To clarify... this issue started happening a couple of weeks ago? Or has it been happening all the time and has been going on for a couple of weeks?
Because, if it started happening, then the relevent question is: what changed. If it's not your code, and it's not TestComplete, then something changed in the application that is having TestComplete take time to click the check box.Something that is not apparent in this code... do you have any event handlers that are triggered on logging? For example, do you have anything assgined to OnLogEvent? The reason being is that event handler processing on logging occurs before the log entry is written... so, if there is an event handler on OnLogEvent, that is going to process before the log record for the "click" shows up.... so, those 70+ seconds could be accounted for by the event handler, if it exists.
As for the web table refresh, I wondering if that could, honestly, be part of it. Here's why... objects are passed by reference in JScript, JavaScript... so, that checkBox object is a "found" object. If the web page is refreshed, then attempting to "click" on the item means that TC may need to re-find that object.... This is just a theory...
In any case, I don't see anything specific here that would cause TestComplete to run slow so that leads me in the direction of wondering what's going on in the application. Have you observed the test executing? Can you observe the 70+ second delays? What happens when you step through the code? Does the delay happen on the click when you step through?
Related Content
- 11 months agoakilan