I have a query regarding QARun script.When in record some action in Windows 2000,some code is generated and when i record the same action in Win XP,the script differs.
ListViewCtrl "~1","My computer",'LeftDoubleClick'
The Same Code in Win'XP is
ListViewCtrl "FolderView","My computer",'LeftDoubleClick'
So, according to this if i write scripts in Win'2000 then i cannot run the same script in windows'XP.Is it true.
I need clarification on this.
Windows XP and Windows 2000 are, in my opinion, very different operating systems and will present what appears to be the same control very differently, as you are currently experiencing. You could try a couple different things:
1. put the control in question in the object map, as opposed to doing a raw attach as you did in your example. Using the object map will give you a lot more control over how QARun works with the object. I have not run into this before, so I'm not positive it will work, but this is probably what I would try first.
2. The other choice would be to use conditional logic. You could determine which OS is currently in use using the SYSINFO command and then execute the appropriate line of code based on the OS. Again, I haven't done this specific activity, but I have used this technique in the past when running in different environments.
We have changed from W2K to XP last year. I found my QArun Code working without Problems afterwards (except Bitmap Checks, Events...)
I think the difference between your two code parts doesn't depend on the OS.
First one represents the ControlId by using the Index value, second one uses a Part of direct Attach to specify THIS control- independend of other Controls that maybe will be inserted afterwards.
Thanks for ur prompt responses.In my case i have tried in different systems,but in W2k and XP it is recording differently as i said earlier.
And if i record some script in W2k and run the same script in XP in some parts of the code it is giving run time error.
So if i have to run large scripts,it is giving a run time error in XP.I tried what ever u said,but still it is not working.
Any alternative solution.
If you are running into a problem where most of the code is running, but then a part stops, the easiest solution I have found is to let the script run until it bombs, then comment out the offending part of the code and re-record that piece.
You then have two alternatives. Start the script all over and look for the next bug, or use a goto at the beginning of your script and a label right after the newly recorded code and re-execute to look for the next bug.
Not elegant, and takes time, but it does work. And it is a useful tool because scripts will change more often than you think.