It worked!
Although my first attempt caused my chosen tab to keep re-selecting itself when I tried to click on any of the others.
Putting the sir.SetProperty('MainTabs', 'Current Tab', '0') statement within the test condition "if testrun==1" (or something like that) solved the problem.
Thanks again Daz.