Forum Discussion

cmd125's avatar
cmd125
Occasional Contributor
9 months ago
Solved

WaitNamedChild not working

It seems as thought the WaitNamedChild method isn't working and doesn't find the element on screen. Instead it just waits until the set timeout time runs out. For example I use when I go to a certain page. Even when the page loads, and I have verified TC can see the object because I use the element highlight feature and it works, the test just delays the entire set timeout time instead of immediately continuing the test.

  • Please disregard. Not sure why but when I changed it to wait for a different element it worked. Thanks anyways.

  • I think I figured it out. If an element has two different xpaths set in the namemappings but pointed to different elements, it doesn't work. I had added two different xpaths due to the differences between qa and dev so that my tests would work on both until qa was updated, but when qa got updated this occurred. I'm pretty sure that is what happened here and I hope this helps anyone else that runs into this problem. 

     

5 Replies

  • cmd125's avatar
    cmd125
    Occasional Contributor

    Please disregard. Not sure why but when I changed it to wait for a different element it worked. Thanks anyways.

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    What version of TC are you using?

     

    Let's see your code please.

  • cmd125's avatar
    cmd125
    Occasional Contributor

    I think I figured it out. If an element has two different xpaths set in the namemappings but pointed to different elements, it doesn't work. I had added two different xpaths due to the differences between qa and dev so that my tests would work on both until qa was updated, but when qa got updated this occurred. I'm pretty sure that is what happened here and I hope this helps anyone else that runs into this problem. 

     

  • cmd125's avatar
    cmd125
    Occasional Contributor

    I was on 15.52.2.7 x64 but updated to latest 15.54.3.7 x64 and it still occurs. Here's a function that I have that it's occurring with:

    def test_function():
        if NameMapping.Sys.browser.Reservation.reservationButton.Exists == True:
              NameMapping.Sys.browser.Reservation.reservationButton.Click()
        NameMapping.Sys.browser.Reservation.WaitNamedChild("commentsTab", 12000)
        aqUtils.Delay(1000)