Ask a Question

WaitChild does not appear to recognise when a Link object appears in a webpage

jonjdavey
Occasional Contributor

WaitChild does not appear to recognise when a Link object appears in a webpage

I cannot get WaitChild to work for a logout Link which only appears after user has logged in:

Set logoutLink = Sys.Process("iexplore").Page(uRL).Panel(0).Panel(0).Panel(1).WaitChild("Link(2)", 1000)



If I insert a sleep(100) before the line of code above it works, but that defeats the object of trying to use the WaitChild method
4 REPLIES 4
tristaanogre
Esteemed Contributor

The problem may not be in the wait child for the link, but in the panel that the link is a child of.  Something to look at is whether or not that panel exists prior to logging in. 

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
jonjdavey
Occasional Contributor

Thanks for your response.



I did think of that, so tried running this code:

Set
logoutLink =
Sys.Process("iexplore").Page(uRL).Panel(0).Panel(0).WaitChild("Panel(1)",
1000)

Set
logoutLink =
Sys.Process("iexplore").Page(uRL).Panel(0).Panel(0).Panel(1).WaitChild("Link(2)",
1000)



However the code only fails on the second line (the new Link(2) object), so that does not appear to be the problem



Hi Jonathan,





Try using the 'WaitLink' method:

Set logoutLink = Sys.Process("iexplore").Page(uRL).Panel(0).Panel(0).Panel(1).WaitLink(2, 10000)





Please see the 'Additional Methods Used to Obtain Web Pages Elements' section of the Working With Web Page Elements help topic.
--
Dmitry Nikolaev

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
jonjdavey
Occasional Contributor

Hi David,



Thanks for your response.



I had previously tried the WaitLink method but did not realise that I could specify my link using an index. Using the link name does not work, but using an index, as you suggest, did work. So thanks very much for your help!
cancel
Showing results for 
Search instead for 
Did you mean: