cancel
Showing results for 
Search instead for 
Did you mean: 

Object exist error problem

Highlighted
Regular Contributor

Object exist error problem

In the below Code, i want to check  "Invalid_Currency_Pair" (object define below) exist or not. But when execution comes to this point where i create the object it gives existing error and the condition is object doesn't exist in application , it gives me error in test log

 

 Set Invalid_Currency_Pair = Mobile.Device("Q3000").Process("com.cor.currency").Layout("NO_ID",2).Layout("action_bar_root").Layout("content").Layout("scrollView").TextView("message")

 

If this object doesn't exist, then i found object doesn't exist error in test log. but i want object doesn't show in the application it should go to next line and not giving me any object exist error in test log.
for your better understand i attaching the test log.

2 REPLIES 2
Highlighted
Regular Contributor

In the below Code, i want to check  "Invalid_Currency_Pair" (object define below) exist or not. But when execution comes to this point where i create the object it gives existing error and the condition is object doesn't exist in application , it gives me error in test log

 

 Set Invalid_Currency_Pair = Mobile.Device("Q3000").Process("com.cor.currency").Layout("NO_ID",2).Layout("action_bar_root").Layout("content").Layout("scrollView").TextView("message")

 

If this object doesn't exist, then i found object doesn't exist error in test log. but i want object doesn't show in the application it should go to next line and not giving me any object exist error in test log.
for your better understand i attaching the test log.

Highlighted
Valued Contributor

you are trying to access TextView("message") of non exiting object.

So you get error message..

 

You should first check existence of  object before accessing in such scenario.

you can use wait object method like this which you wouldn't get error message

 

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get properties of a web page element

Participate!

Compare images using the Region Checkpoint

See replies!

Compare HTML table with Excel file and correct data in Excel file

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!
Top Kudoed Authors