Forum Discussion

NisHera's avatar
NisHera
Valued Contributor
5 years ago
Solved

RefreshMappingInfo() not working

My application is written in delphi.
when i run below code gets error "Python runtime error.
RuntimeError: 0x847ceed2" in Log.Message(childtab.Text) line...

by debugging found that RefreshMappingInfo() did not working
the code is below..

def closeAll(self):
 tabCount = Aliases.App.Browser.MDIClient.ChildCount
 for i in range (0,tabCount):
   Aliases.App.Browser.MDIClient.RefreshMappingInfo()
   Delay(5000,"Waiting everything to be refreshed...................")
   childtab = Aliases.App.Browser.MDIClient.Child(0)
   Log.Message(childtab.Text)
   childtab.close()


while debugging , when go to object browser ..could see deleted tab is there even though RefreshMappingInfo() runs.

So child(0) still refers to closed tab

 

when RMB and manually refreshed mapping infor, script runs correctly.

always first tab is closed correctly problem starts subsequent tabs .

any ideas..?

  • Hi NisHera . I found your support ticket for this issue. I am glad to know you've solved it! :smileyhappy:

     

    Let me post the solution here for other community members to see:

     

    Basically, the “Refresh()” method should be used before “RefreshMappingInfo” and it will update the child objects. 

     

    Great job!

3 Replies

  • cunderw's avatar
    cunderw
    Community Hero

    This is likely a timeing issue. I would suggest doing something along the lines of WaitAliasChild to wait for the tab to not exist.

    • NisHera's avatar
      NisHera
      Valued Contributor

      No use Waited for around a one and half minute...... :smileyfrustrated:

       

      • sonya_m's avatar
        sonya_m
        SmartBear Alumni (Retired)

        Hi NisHera . I found your support ticket for this issue. I am glad to know you've solved it! :smileyhappy:

         

        Let me post the solution here for other community members to see:

         

        Basically, the “Refresh()” method should be used before “RefreshMappingInfo” and it will update the child objects. 

         

        Great job!