Ask a Question

RefreshMappingInfo() not working

SOLVED
NisHera
Valued Contributor

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..?

3 REPLIES 3
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.


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
NisHera
Valued Contributor

No use Waited for around a one and half minute...... Smiley Frustrated

 

sonya_m
SmartBear Alumni (Retired)

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

 

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!


Sonya Mihaljova
Community and Education Specialist

cancel
Showing results for 
Search instead for 
Did you mean: