cancel
Showing results for 
Search instead for 
Did you mean: 

mysterious message

SOLVED
Highlighted
Valued Contributor

mysterious message

error.png

Hi

I'm having a message time to time could not find any reason.

dose any body have an idea.

it's same place when just started test.

comes only ramdomly ...

the number reffered did not change so may not be a memory location?

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Valued Contributor

for anybody come same problem...........................

when Tabs changed, TC do not update it self ..stubbornly keep same values of it's childs.

I use "Refresh mapping infor()" which did not work.

But method "Refresh()" worked like a magic..!Man Happy

View solution in original post

9 REPLIES 9
Highlighted
Community Hero

We'd kind of need to know what's being executed.  What's the code being run?  Have you tried dropping in a break point and debugging to see where the error happens?


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Valued Contributor

Anyway I handled that using try/except ....but original problem is there.

below is my code..(with solution)

 

error fires at highlighted log message line

class Tabs():
  def __init__(self,tab=None):
    self.tab = tab
  
  def tabExists(self):
    success = False
    while not success:
      try:
        Aliases.......MDIClient.RefreshMappingInfo()
        tabCount = Aliases...........MDIClient.ChildCount 
        if tabCount ==0 :
          return False
        for i in range (0,tabCount):
          childtab = Aliases.................MDIClient.Child(i)
          if self.tab in childtab.Text:
            Log.Message(childtab.Text+" ..exists")
            return True
        else:
          return False
        success = True   # <--this will never excute, just in case 
      except RuntimeError:
        Log.Message(RuntimeError)
        success =False

Un fortunatly can not debug  since it dosn't occure every time ....

once in 5 /6 times.

Highlighted
Community Hero

Hi,

 

Not been a Python guru...

> for i in range (0,tabCount)

Shouldn't it be

for i in range (0,tabCount - 1)

?

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Highlighted
Community Hero

Good catch, Alex! I didn't even see that.

Yes, the index on the "Child" object is a 0 based index so running it to tabCount-1 should at least correct that problem. Whether that completely fixes your issue remains to be seen but that seems to be the best candidate!

Woot! And this is why you're a hero, Alex!

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Community Manager

Thanks for the help, guys!

@NisHera, does it help resolve the issue?

 

 

---------
Tanya Gorbunova
SmartBear Community Manager

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Valued Contributor

Thanks guys...

busy in on another area....will let you know it helps..

 

Highlighted
Community Manager

Thanks for the update, @NisHera.

Let me mark Alexei's reply as a solution for a while. If it doesn't work for you - just post an update here and we will continue investigating the issue.

 

 

---------
Tanya Gorbunova
SmartBear Community Manager

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Valued Contributor

for anybody come same problem...........................

when Tabs changed, TC do not update it self ..stubbornly keep same values of it's childs.

I use "Refresh mapping infor()" which did not work.

But method "Refresh()" worked like a magic..!Man Happy

View solution in original post

Highlighted
Community Hero

Hi,

 

Thank you for the update.

 

Well... Now, with the update from you, the reason seems to be obvious to me. 🙂

So... Just for the record...

And again - my experience with Python is very limited, thus, I might be wrong with something Python-related, but in general:

-- Usually, it is not the best idea to use more or less persistent variables to keep references to UI objects that potentially can change (be disposed of/recreated/properties changed/etc.);

-- It is even less good idea to keep references to the Aliased objects. On the one hand, Aliases use late binding which makes it possible to declare variables like this: someVar = Aliases.SomeObject even when SomeObject does not exist yet. Variable will be initialized with the actual object reference at the moment when test code will attempt to perform some action over the object. On the other hand, as it is described in the documentation, Aliases object tries to keep a cached copy of the object and may not update it when the real object changes. This requires test developer to be very attentive to potential caching problems and either avoid them or use .Refresh()/.RefreshMappingInfo() properly.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get properties of a web page element

See replies!

Compare images using the Region Checkpoint

See replies!

Compare HTML table with Excel file and correct data in Excel file

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!
Top Kudoed Authors