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

Re: mysterious message

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

Re: mysterious message

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
[Community Expert Group]
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

Re: mysterious message

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

Re: mysterious message

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 Expert Group]
____
[Community Expert Group] members 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. Postings made by [Community Expert Group] members
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.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Highlighted
Community Hero

Re: mysterious message

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
[Community Expert Group]
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

Re: mysterious message

Thanks for the help, guys!

@NisHera, does it help resolve the issue?

 

 

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

 Join the virtual SmartBear Connect user conference on April 27-28! Get your free virtual ticket today!
Highlighted
Valued Contributor

Re: mysterious message

Thanks guys...

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

 

Highlighted
Community Manager

Re: mysterious message

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

 Join the virtual SmartBear Connect user conference on April 27-28! Get your free virtual ticket today!
Highlighted
Valued Contributor

Re: mysterious message

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

Community Hero

Re: mysterious message

Hi,

 

Thank you for the update.

 

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

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 Expert Group]
____
[Community Expert Group] members 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. Postings made by [Community Expert Group] members
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.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================