Forum Discussion

kaiiii's avatar
kaiiii
Regular Contributor
7 years ago

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

  • NisHera's avatar
    NisHera
    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

     

  • kaiiii's avatar
    kaiiii
    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.