This is a migrated thread and some comments may be shown as answers.

Can I customize Wait for Exists?

4 Answers 146 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kristine Ayson
Top achievements
Rank 1
Kristine Ayson asked on 23 Jun 2010, 05:01 AM
Is there a way to customize the Wait.ForExists function to not flag an exception if the element is found?
Right now it's throwing this exception message:

Element was 'found'. Criteria: Element 'Exists'.
Page being searched 'SilverlightApp (silverlightControlHost)'.

4 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 23 Jun 2010, 05:29 PM
Hello Kristine Ayson,

I must admit I'm a little confused by the request. The Wait.ForExists doesn't throw any exception (or it's not supposed to and if it is we have a bug) when it successfully finds the element on the page within its timeout period.

Is it possible you mean the Wait.ForExistsNot function? This function will throw the exception you speak of if the element is still there after the timeout period. Do you simply want the test to continue past the failure? You can mark the test step "Continue on failure" as shown in the continueonfailure.png screenshot if that's all you need. The test will still be marked "Failed" but the test won't abort at that step if it detects a failure.

You als can place the function within a Try Catch block in a code-behind method. For example:

try
{
    Pages.ButtonsFirstLook.SilverlightApp.Item1Textboxview.Wait.ForExistsNot(5000);
}
catch (TimeoutException Exception)
{
    // Perform anything necessary after catching the exception
}

All the best,
Cody
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Kristine Ayson
Top achievements
Rank 1
answered on 24 Jun 2010, 02:47 AM
Hi Cody,

Sorry for the confusion. Right now, the Wait.ForExists throws an exception when the element it's supposed to wait is already there, thus the exception message:

Element was 'found'. Criteria: Element 'Exists'.
Page being searched 'SilverlightApp (silverlightControlHost)'.

I'm curious if it can be customize to behave this way:

if element is found, do nothing
else wait until timeout

Best Regards,
Kristine


0
Cody
Telerik team
answered on 24 Jun 2010, 10:51 PM
Hi Kristine Ayson,

I would really like to see the problem you are having first hand. I just finished retesting our Wait.ForExists function. At no time can i get it to error out if the element already exists when you call this function. I have tested it on HTML and Silverlight pages, regular steps and coded steps.

Can we look at this via GoToMeeting?

Kind regards,
Cody
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Cody
Telerik team
answered on 01 Jul 2010, 04:24 PM
Hi Kristine Ayson,

Did you get this problem resolved? Do you need any further assistance with this?

Sincerely yours,
Cody
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Kristine Ayson
Top achievements
Rank 1
Answers by
Cody
Telerik team
Kristine Ayson
Top achievements
Rank 1
Share this question
or