Forum Discussion

Semirxbih's avatar
Semirxbih
Contributor
2 years ago

Object detected locally but comes back as "Object not found" in Jenkins

Hey all,

 

So I have an issue where an list object is not detectable inside Jenkins but it passes just fine in my local environment and I am not sure why that might be happening.

 

So I have this code:

 

    try {
        var dialogDownload = Aliases.browser.FindChildEx(
            ["ObjectType", "Caption"], 
            ["Dialog", "Downloads"], 
            10, 
            true, 
            20000
        );
        if (dialogDownload.Exists) {
            Log.Message("Dialog found successfully.");
            Sys.HighlightObject(dialogDownload);
        } else {
            Log.Warning("Dialog not found.");
        }
    } catch (e) {
        Log.Error("An error occurred: " + e.message);
    }

 

 
This finds the appropriate object, which is this in the object window:

 

Now, I'm trying to drill in and find the "List" object, which has this code:

 

        try {
            var intermediateObject = dialogDownload.FindChild("ObjectType", "Pane", 20);
            var list = intermediateObject.FindChildEx(
                ["ObjectType", "Caption"], 
                ["List", "Recent downloads"], 
                20, 
                true, 
                20000
            );

            if (list.Exists) {
                Log.Message("List found successfully.");
                Sys.HighlightObject(list);
            } else {
                Log.Warning("List not found.");
            }
        } catch (e) {
            Log.Error("An error occurred while trying to find the list: " + e.message);
        }

 

 

It is located in the following object window:

 

Locally, it finds the object just fine, but when I run it in Jenkins, it says "Object not found" on the List. Is there another approach that I might be able to take?

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Do you mean you are running the automation via Jenkins, on a remote machine?

    • Semirxbih's avatar
      Semirxbih
      Contributor

      rraghvani I'm running the automation on my local machine using TestComplete 15, then I'm running the same automation on a VM with TestComplete 15 that is connected to Jenkins and it comes back as failing for the above object, both same exact code, just for some reason it's not detectable on when it's running in a VM.

      • Marsha_R's avatar
        Marsha_R
        Moderator

        Having it fail because of Jenkins or having it fail because it's on another machine are two different questions. Since your local machine is a known quantity, I suggest running with Jenkins on your local machine to either eliminate Jenkins as the problem or confirm it.  Let us know what happens.