Ask a Question

How to handle if not finding on objects is not an error

mrvszn
Occasional Contributor

Re: How to handle if not finding on objects is not an error

Hi,

 

My coworker and I tried to apply your suggestion but we still get errors when there is no window and errors when false (saveaswindow).

Screenshot is below;

Clipboard - 22 Ekim 2021 09_37.png

 

Should we have done it differently? Do you have a solution suggestion?

@React 

Thank you.

 

React
New Contributor

Re: How to handle if not finding on objects is not an error

@mrvszn Is the "saveaswindow" object found?

cagan
Occasional Contributor

Re: How to handle if not finding on objects is not an error

Hi,

 

"saveaswindow" object is found if the Save As popup appeared. If object not found it will not do anyting actually and will just keep going test case.

React
New Contributor

Re: How to handle if not finding on objects is not an error

So you taking error before your "if statment" take pleace and in my opinion it is working as it should.

FindEx needs to be done, on an object thats exists - for example whole screen like I did.
var page = Sys.Browser().Page('*')

@cagan Change saveAsWindow declaration. It can be some parent object that you have assurance of it's existence and try again 🙂

cagan
Occasional Contributor

Re: How to handle if not finding on objects is not an error

Hi,

Thank you for your guidance. I just want to notify that saveAsWindow can be found or not. Both case are not wrong for us. It will just do different things on both case.

So, if same file name exists then Save As popup  appear on the screen, otherwise the file directly be saved. In this condition, we couldn't keep that taking parent object what will be used for Save As popup.

cancel
Showing results for 
Search instead for 
Did you mean: