Forum Discussion
Hi,
While it is not clear what happens in your application after the first click, the most probable guess is that the following sequence occurs:
-- Link is clicked;
-- Application navigates to somewhere *and the initial table is no more present on the screen*;
-- Back button/link is clicked;
-- Application navigates back to the initial page *and the table is recreated a-new*
If my guess is correct, then all found references to table cells will be invalidated after navigating away from the initial page and you *must* search for them again after you back to the page with the table. Then you should be able to click the second cell and so on.
P.S. And yes, as it already has been said, search by XPath is the worst approach in TestComplete. (Especially, when searching through the whole page, like a lot of people used to do. Or, maybe, because of some Selenium specifics?)
P.P.S. Use of Aliases might solve the problem with recreated page elements, but this will work only if the given element has its Alias in NameMapping which is not a case with tables (due to how tables are usually designed nowadays).
I'm with AlexKaras. When you navigate away from the page after clicking on the first item, all handles and references to the previous page are no longer valid. Your Find returned a bunch of objects with specific handles... and they no longer exist hence your error. What you should do is, within your for loop, refresh your array of items with another find. The loop will still go on to the next item in the loop but your array will have the correct handles again.
Related Content
- 6 months agoḼari
- 2 years agoDesktopapptesti
Recent Discussions
- 12 hours agojstaehlin
- 2 days agoAivanitskiy