Forum Discussion

cg-ngc's avatar
cg-ngc
Occasional Contributor
2 months ago

[Java AUT / JavaScript test] .Exists waits when window exists but is not visible

Given the following code

Here I am working with two windows - "nht" and "ac"
nht exists and is visible
ac exists and is NOT visible (It's completely hidden, not just behind another window)

The problem is that line 146 (Check if ac exists) waits for the default timeout, even though it already exists!!

To me, at least line 146 seems to be a bug.
If the window does not exist and I execute the following code

Then it does not wait

So it's inconsistent.

obj.Exists will NOT wait if the object does not exist
obj.Exists will NOT wait if the object exists and is visible
obj.Exists WILL wait if the object exists but is not visible

I'm not asking if it's invisible, I'm asking if it exists. Why should it alter it's behaviour based on a property I am not asking about?

Whatever, what I want is to be able to perform both checks without waiting.
I do not want to alter the default timeout, I want to be able to make just these specific checks without waiting.

23 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    I'm not sure what version of TC you are using. Since WaitTime is 0, WaitAliasChild will return immediately. Assuming the child alias object exists, then the property Visible will return a value immediately too.

    However, if the child alias object does not exist, WaitAliasChild will return a stub object immediately. Property Exists will return immediately, but Visible will return an error after a number of seconds - depending on the project auto-wait timeout.

    Ideally, you should enclose your Visible property within an If statement

    let ac = Aliases.ICS.WaitAliasChild("AddChannelWindwo", 0);
    if (ac.Exists) {
    	let ac_vis = ac.Visible;
    }
    

     

     

    • cg-ngc's avatar
      cg-ngc
      Occasional Contributor

      Yeah, I click attach, upload the files, it appears in the post, but when I submit, there's nothing there.

      eg I am taking a SS of this post now, before I submit

       

      • rraghvani's avatar
        rraghvani
        Champion Level 3

        File attachments doesn't seem to be working. I've informed the relevant person about this.

    • cg-ngc's avatar
      cg-ngc
      Occasional Contributor

      I have managed to submit my zip to support via email (Case #00664059)

      Thanks for all your help so far!
      Oh, and PS, I am off work tomorrow, so unlikely to reply