mysterious message
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
mysterious message
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?
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Not been a Python guru...
> for i in range (0,tabCount)
Shouldn't it be
for i in range (0,tabCount - 1)
?
/Alex [Community Champion]
____
[Community Champions] 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 Champions]
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 Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the help, guys!
@NisHera, does it help resolve the issue?
Tanya Yatskovskaya
SmartBear Community and Education Manager
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks guys...
busy in on another area....will let you know it helps..
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 Yatskovskaya
SmartBear Community and Education Manager
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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..!
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
/Alex [Community Champion]
____
[Community Champions] 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 Champions]
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 Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
