Forum Discussion
See Waiting for an Object, Process or Window Activation
In your code, you need to check if the object returned is not null before getting the property value.
- tvklovesu3 years agoFrequent Contributor
Even I tried FindElements.length!=0 and still got the same error that unable to find the object. But finally I was able to fix the issue by modifying my code as below
function waitUntil(element, PropValue, timeout){
var i=0
var obj = Aliases.pageEmailAnalyticsGettingStarted.FindElement(element)
do
{
Delay(2000)
if (obj.VisibleOnScreen==PropValue){
break;
}
i++;
}while (i<=10)
}- rrobinson3 years agoNew Contributor
Nice! I like all the code examples I can find! This is very helpful and happy that you sent this solution to me!!! Thanks a ton! Very nice solution here.
- tvklovesu3 years agoFrequent Contributor
The script runs fine in local, but when I try headless then its throwing error as stale element that the object not found as the page refreshed or so. How do you handle stale element in TC. while working in selenium I usually call the element again, in TC I even did same where I was set var obj everytime the function is called. Is there any other different way to fix this error.
Related Content
- 8 years ago
- 2 years ago
- 10 years ago
Recent Discussions
- 6 days ago
- 6 days ago
- 10 days ago