# set StopOnError via script

**URL:** <https://community.smartbear.com/t/set-stoponerror-via-script/307>\
**Category:** TestComplete\
**Tags:** test, testcomplete, migrated, properties, test-complete\
**Created:** [January 28, 2016, 4:07pm UTC](https://community.smartbear.com/t/set-stoponerror-via-script/307 "2016-01-28T16:07:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 28, 2016, 4:07pm UTC](https://community.smartbear.com/t/set-stoponerror-via-script/307/1 "2016-01-28T16:07:14Z")

</div>

> Originally posted by **jromie** on January 28, 2016

I am trying to write a simple script that runs each time a project starts. It is to loop through the test items and shut off the StopOnError property.

Here is the code I have right now that doessn’t work (JScript):

var i;

for(i = 0; i \< Project.TestItems.ItemCount; i++) {

Project.TestItems.TestItem(i).StopOnError = 0;

}

This throws and error: “Invalid number of arguments or invalid property assignment”

Is this specific task even possible?

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 28, 2016, 7:53pm UTC](https://community.smartbear.com/t/set-stoponerror-via-script/307/2 "2016-01-28T19:53:49Z")

</div>

> Originally posted by **djadhav** on January 28, 2016

This article [https://support.smartbear.com/viewarticle/68453/](https://support.smartbear.com/viewarticle/68453/) describes StopOnError as a Read Only property hence I believe you cannot change it’s value from script.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 28, 2016, 8:35pm UTC](https://community.smartbear.com/t/set-stoponerror-via-script/307/3 "2016-01-28T20:35:01Z")

</div>

> Originally posted by **jromie** on January 28, 2016

I saw that, but figured I’d ask anyways. Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [October 7, 2026, 5:14pm UTC](https://community.smartbear.com/t/set-stoponerror-via-script/307/4 "2026-10-07T17:14:47Z")

</div>

Closed on October 7, 2026, 5:14pm UTC

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
