vick Posted April 10, 2018 Share Posted April 10, 2018 Hi , I have script like below: in loop i have for example $a =_IEGETOBJBYID(....) $b =_IEGETOBJBYID(....) $c=_IEGETOBJBYID(....) if i want to handle error , i need to write If @error then statement after every object or i can write only one after all so any object fail , it handle error like below: if $x=$y then $a =_IEGETOBJBYID(....) $b =_IEGETOBJBYID(....) $c=_IEGETOBJBYID(....) elseif @error then do something endif Link to comment Share on other sites More sharing options...
Danp2 Posted April 10, 2018 Share Posted April 10, 2018 You could save the value of @error following each call to _IEGetObyByID and then check the results of the saved values at the end. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
vick Posted April 10, 2018 Author Share Posted April 10, 2018 thanks but instead of using @error for each call, how we can use once only ? Link to comment Share on other sites More sharing options...
Danp2 Posted April 10, 2018 Share Posted April 10, 2018 Sorry, but you request isn't making sense. If you want to know whether each call to _IEGetObjById succeeded or failed, you will either need to save the @error value after each call or I guess you could use IsObj() to test each of the resulting variables. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
vick Posted April 12, 2018 Author Share Posted April 12, 2018 got it. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now