| || |
The first clue I've had that there may be hope for me! I've posted a few times in the past on the same question, basically, and not yet found anything that works till now. Those of you who may recognize it, please bear with it.
When I record the declarations for the window, all the objects are there.
Until now, I had to just accept that I could only verify against the generic message. If I did a GetText() against the message, that's what I always got, even though I could see on the page the "Page 1 already..." version.
But now, using FlushCache() after the Done button, the GetText() call returns the second version!! Hurray!! I can comment and uncomment the FlushCache() and toggle the results of a GetText() call.
So I thought I had found the key -- that if I clean out at appropriate times and start fresh, SilkTest will be able to pick up on changes to the original html of the page.
But now I find that the other thing that happens at the same time - the black text is replaced by the red - that change is not detectable in any way that I can find. The color changes, but the text does too. The black text says "Add new page - 25 characters maximum" and the red is just "Add new page".
When I do GetText(), the text of the longer one always returns. I've tried IsVisible(), too. Remember, there are 2 separate objects there. They toggle their visiblity, so why doesn't SilkTest pick up the change? Whether the page shows the red text or the black, the black returns TRUE to IsVisible(), and the red returns FALSE. In the original html, the red is "visibility:hidden".
Thanks for any clues
Nice work. It's a good feeling when you get a creative solution together that works.
Beware of bugs in the above code; I have only proved it correct, not tried it.
jkohl - didn't I just see you over at Seque? How many jkohl's can there be? I replied over there.
Thanks a lot
Over on the Segue support forum, someone suggested I write my own code to parse the html looking for the tags I want and reading the styles for the visibility and display of the objects. I had mentioned there that I found some other elements on the page that DO respond sensibly to the IsVisible method, and some that don't. It turned out that the ones that don't are found inside <div> tags. He wrote:
Ah, yes. I've also noticed that SilkTest doesn't recognize <div> tags. That would explain your situation. The styles for the message that work are applied to the <tr> tags. The styles for the messages that don't "work" are applied to the <div> tag.
The only way I've found around this is to write special code to parse the HTML itself, and look for the tags of interest. For instance, with:
<DIV ID="addTabDivError" class="errorTextColor" STYLE="visibility:hidden;position:relative;top:-10px;"><span CLASS="errorTextColor">Add new page</span></DIV>
you would look for the DIV with that ID, then check the visibility style.
I asked what he meant and haven't heard yet. Anyone here have any idea what he could mean?