i use list_select_item tsl in my script its working in my system very fine.but i tried to run the script in some other system it doesn't working it throw list obj not found error message,gui file loaded correctly if i select the obj in the gui map editor it pointed out the obj in the screen correctly.but it return E_NOT_FOUND return value during the test run. i don't know why?.give me some suggestion
Sorry but I have to keep silence where this it is from: ;-)
#* This function was created as an attempt to solve a particularly ugly bug
#* in WR 6.0 / 6.02. It is obsolete now because we have discovered the real
#* cause of the problem which you can solve by placing set_var("timeout",10)
#* in your startup script.
#* We have left the function in the library to show one way how some problems
#* could be aproached by applying alternative methods to achieve the "same"
#* effect. In this case we rely on the fact that MFC listboxes typically
#* position the focus on the item whose name starts with the key pressed. So
#* we are pressing the initial key until we either find an item or we "cycle-
#* through" the list.
#* Hier and then we had the problem that after restarting WinRunner, list
#* objects wouldn't work properly. For some reason list_select_item() would
#* suddenly not work although the item was still there and neither application
#* nor the test (that's what we thought) changed. GUI editor would show no
#* problems whatsoever with any of the list objects. Only the selecting would
#* not work. The only way to "solve" the problem was to re-install WinRunner.
#* Finally, after days of searching,, we have discovered, that after some
#* WinRunner crashes, the default timeout value (saved in wrun.ini, where else)
#* had a value of 10 instead of 10000. This has explained why this problem
#* only occurs in WR 6.0. It is 6.0 when timeout was changed from seconds to
#* miliseconds. Obviously, somewhere deep in some WinRunner dll there is still
#* a peace of logic that thinks in seconds instead of miliseconds.
#* Since we know what Mercury could claim, we have checked our test scripts -
#* they are deffinitely fine. It is WinRunner who causes problems.
#* There are several solutions for this problem:
#*[*] You change the wrun.ini each time this happens.
#*[*] You wait until Mercury fixes the problem.
#*[*] You (re)set the timeout you want in your startup script.
#* Obviously, the last one is the only feasible.
#* @param obj (in) name of the list object
#* @param item (in) item which is to be selected
#* E_OK: success
#* !E_OK: error
public function list_select_item1 ( in obj, in item )
auto rc, x, t;
auto arr, n=0;
x = substr(item,1,1);
while( 1 )
rc = list_get_selected( obj, t, n );
if (rc) return rc;
if ( t == item )
if( t in arr )
arr[t] = n;
if (rc) return rc;