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

On Error Countinue

1 Answer 57 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 2
John asked on 01 Dec 2014, 10:38 PM
Hi,
When I attempt to see if an item is visible, I receive an error when the object is not there.  I do not see an error when it's there.  Is thee a way to find out if it there with out an error when its not?

Thanks,
John 



bool Isthere = false;

Isthere = Pages.JointCommissionResources17.EnterpriseCell.IsVisible();

'12/1/2014 3:45:00 PM' - 'Fail' : 3. [PortalSelectOrgList_CodedStep] : RadComboBox('rcbSite'): selecting item with index '0'------------------------------------------------------------Failure Information: ~~~~~~~~~~~~~~~Exception thrown executing coded step: '[PortalSelectOrgList_CodedStep] : RadComboBox('rcbSite'): selecting item with index '0''.InnerException:ArtOfTest.Common.Exceptions.FindElementException: Element Not found!FindExpression used: [id 'Exact' rcbSite] AND [tagname 'Exact' div] at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo, Object target) at ArtOfTest.Common.WaitSync.For[T,V](Func`3 func, T target, V custom, Boolean invertCondition, Int32 timeout, WaitResultType errorResultType) at ArtOfTest.WebAii.Synchronization.Wait.ForCondition(Func`3 condition, Boolean invertCondition, Object custom, Int32 timeout, WaitResultType errorResultType) at ArtOfTest.WebAii.Synchronization.Wait.ForExists(Int32 timeout, Boolean refreshElement) at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.GetElement(HtmlFindExpression expr, Boolean waitOnElement, Int32 timeout) at ArtOfTest.WebAii.TestTemplates.ElementContainer`2.Get(TFindExpression expr, Boolean waitOnElement, Int32 timeout) at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get(HtmlFindExpression expr) at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get[TControl](HtmlFindExpression expr) at ArtOfTest.WebAii.TestTemplates.HtmlElementContainer.Get[TControl](String[] clauses) at EProducts1.Pages.JointCommissionResources0Page.get_RcbSiteDiv() in \\jcrfs1\com_software$\TelerikProjects\EProducts\EProducts1\Pages.g.cs:line 664 at EProducts1.PortalSelectOrgList.PortalSelectOrgList_CodedStep() in \\jcrfs1\com_software$\TelerikProjects\EProducts\EProducts1\Portal\PortalSelectOrgList.tstest.cs:line 63

1 Answer, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 04 Dec 2014, 03:21 PM
Hello John,

Try replacing this step with WaitForVisible one:

Pages.JointCommissionResources17.EnterpriseCell.Wait.ForVisible(30000);

You can also add a wait for exist the element and then verify it whether is it visible or not. 

See this article.

Let me know if this helps.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
John
Top achievements
Rank 2
Answers by
Boyan Boev
Telerik team
Share this question
or