|
|
|
|
Scripts stops after performing a step when it has been initiated by schedule task.
|
|
03-08-2010, 09:06 AM
(This post was last modified: 03-08-2010 09:07 AM by Ajit.2k6.)
Post: #1
|
|||
|
|||
|
Scripts stops after performing a step when it has been initiated by schedule task.
If i run manually its running fine. Why is that. Please help!!! I have to click the PLAY button after that. Thanks, Ajit |
|||
|
03-08-2010, 09:50 AM
Post: #2
|
|||
|
|||
|
RE: Scripts stops after performing a step when it has been initiated by schedule task.
please provide more details, paste your lines of code.
Thanks, ~Saket Kumar [Linkedin][pdf Api for QTP] It's so hard when I have to, and so easy when I want to... |
|||
|
03-08-2010, 09:55 AM
Post: #3
|
|||
|
|||
RE: Scripts stops after performing a step when it has been initiated by schedule task.
(03-08-2010 09:50 AM)Saket Wrote: please provide more details, paste your lines of code. Following is my .vbs file from where i m initiating the test: Set qtApp = CreateObject("QuickTest.Application") qtApp.Launch qtApp.Visible = True 'qtApp.Open "D:\Program Files\Mercury Interactive\QuickTest Professional\Tests\Creating a Gmail ID" 'this is the location of test scripts Set qtTest = qtApp.Test 'Set QuickTest run options qtApp.Options.Run.RunMode = "Fast" qtApp.Options.Run.ViewResults = False qtApp.Open "\\Ausyddata02\testing\QTP Common\Lab Tests\Automated Tests\Installing SiPass 2.50", True ' Open the test in read-only mode ' set run settings for the test Set qtTest = qtApp.Test qtTest.Run ' Run the test 'qtTest.Close ' Close the test 'qtApp.quit Set qtTest = Nothing ' Release the Test object Set qtApp = Nothing ' Release the Application object 'qtTest.Close 'qtApp.Quit Thanks, Ajit |
|||
|
03-08-2010, 09:58 AM
Post: #4
|
|||
|
|||
|
RE: Scripts stops after performing a step when it has been initiated by schedule task.
where do you stuck in the code that you mentioned?
Thanks, ~Saket Kumar [Linkedin][pdf Api for QTP] It's so hard when I have to, and so easy when I want to... |
|||
|
03-08-2010, 10:12 AM
Post: #5
|
|||
|
|||
RE: Scripts stops after performing a step when it has been initiated by schedule task.
(03-08-2010 09:58 AM)Saket Wrote: where do you stuck in the code that you mentioned? Function fFindLatestBuilt () SystemUtil.Run "\\Ausydw2342\BUILDS\MP2.50","","\\Ausydw2342\BUILDS\MP2.50","" Window("MP2.50").Activate rCount = Window("MP2.50").WinListView("SysListView32").GetItemsCount rCount = rCount -1 BuiltNo = Window("MP2.50").WinListView("SysListView32").GetItem (rCount) Dim fso6 Set fso6 = CreateObject("Scripting.FileSystemObject") If (fso6.FileExists ("\\Ausydw2342\BUILDS\MP2.50\"&BuiltNo&"\Setup\DISK1\Setup.exe")) Then Datatable.Import ("\\Ausyddata02\testing\QTP Common\Lab Tests\DATA Files\LastBuiltNo.txt") PBNo = DataTable.GetSheet("Global").GetParameter("BNo").ValueByRow(1) ' msgbox PBNo ' msgbox BuiltNo If strComp (PBNo, BuiltNo) = True Then Dim fso5, MyFile Set fso5 = CreateObject("Scripting.FileSystemObject") Set MyFile = fso5.CreateTextFile("\\Ausyddata02\testing\QTP Common\Lab Tests\DATA Files\LastBuiltNo.txt", True) MyFile.WriteLine("BNo") MyFile.Write (BuiltNo) MyFile.Close Datatable.Import ("\\Ausyddata02\testing\QTP Common\Lab Tests\DATA Files\LastBuiltNo.txt") s = 1 fFindLatestBuilt = s Reporter.ReportEvent micPass, "SiPass Installation Version available and used is: MP2.50\MP2.50."&bno&".00"&b&""&a, "This should be the latest availble SiPass Inte folder in the SiPass 2.50 directory" Else Reporter.ReportEvent micWarning , "SiPass Integrated nightly built is not available" , "Please contact the developers " End if ' s = 0 ' fFindLatestBuilt = s ''msgbox "A" End if End Function '*********************************************************** Sub sRemoveSiPassInteg() Dim fso1, msg Set fso1 = CreateObject("Scripting.FileSystemObject") If (fso1.FileExists("D:\Program Files\SiPass Integrated\SiPass.exe")) Then If Window("SiPass Integrated").Exist Then Window("SiPass Integrated").Activate End If Datatable.Import ("\\Ausyddata02\testing\QTP Common\Lab Tests\DATA Files\LastBuiltNo.txt") BNo = DataTable.GetSheet("Global").GetParameter("BNo").ValueByRow(1) SystemUtil.Run "\\Ausydw2342\BUILDS\MP2.50\"&bno&"\Setup\DISK1\Setup.exe" While Window("SiPass integrated Setup").Exist = False Wend While Window("SiPass integrated Setup").WinRadioButton("Remove").Exist = false Wend Window("SiPass integrated Setup").WinRadioButton("Remove").Set Window("SiPass integrated Setup").WinButton("Next >").Click Window("SiPass integrated Uninstall").WinButton("Next >").Click While Window("SiPass integrated Setup").WinButton("Finish").Exist = False Wend Window("SiPass integrated Setup").WinButton("Finish").Click Reporter.ReportEvent micPass, "SiPass Version Installed was: MP"&BNo, "SiPass "&BNo&" is successfully removed from this PC" Dim fso2 Set fso2 = CreateObject("Scripting.FileSystemObject") fso2.DeleteFolder("D:\Program Files\SiPass Integrated") Else Dim fso3 Set fso3 = CreateObject("Scripting.FileSystemObject") If (fso3.FolderExists("D:\Program Files\SiPass Integrated")) then Dim fso4 Set fso4 = CreateObject("Scripting.FileSystemObject") fso4.DeleteFolder("D:\Program Files\SiPass Integrated") End If End If End Sub i am calling these two functions in my script from another .vbs file. There are two conditions: 1. Sometimes it runs and stops at first "bold line 2. Sometimes it runs upto second bold line and hung If i run this script manually (without Schedule task) its ok. I dont know whats wrong with it. Thanks, Ajit |
|||
|
03-08-2010, 10:37 AM
Post: #6
|
|||
|
|||
|
RE: Scripts stops after performing a step when it has been initiated by schedule task.
your second bold statements seems to be incomplete isn't it? does it work when you try without schedule task.
Code: Window("SiPass integrated Setup").WinRadioButton("Remove").Setin the first bold statement, you are trying to get an item from syslistview. make sure the item exists there with the number you have provided in rcount. Thanks, ~Saket Kumar [Linkedin][pdf Api for QTP] It's so hard when I have to, and so easy when I want to... |
|||
|
03-08-2010, 10:40 AM
Post: #7
|
|||
|
|||
RE: Scripts stops after performing a step when it has been initiated by schedule task.
(03-08-2010 10:37 AM)Saket Wrote: your second bold statements seems to be incomplete isn't it? does it work when you try without schedule task. Yes Saket, it run fine when i run it without schedule task. Script itself has no issues but running through Schedule Task giving these problems |
|||
|
03-08-2010, 06:23 PM
Post: #8
|
|||
|
|||
|
RE: Scripts stops after performing a step when it has been initiated by schedule task.
not sure what could be the reason
but can you give it a try in 'Normal' run mode instead of 'Fast' comment the statement 'qtApp.Options.Run.RunMode = "Fast" in your vbs. let me know how it goes. Thanks, ~Saket Kumar [Linkedin][pdf Api for QTP] It's so hard when I have to, and so easy when I want to... |
|||
|
03-10-2010, 06:39 AM
Post: #9
|
|||
|
|||
RE: Scripts stops after performing a step when it has been initiated by schedule task.
(03-08-2010 06:23 PM)Saket Wrote: not sure what could be the reason Thanks a lot Saket, its working. Changing "Fast" to "Normal" worked. Regards, Ajit |
|||
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads... | |||||
| Thread: | Author | Replies: | Views: | Last Post | |
| Schedule ALM ( QC 11) script | apte.ak@gmail.com | 0 | 458 |
10-28-2011 09:50 PM Last Post: apte.ak@gmail.com |
|
| QTP 10 stops recognizing Flex objects | lpiris | 0 | 1,059 |
04-29-2011 07:59 PM Last Post: lpiris |
|
| Scheduling tests stored in QC by using Windows 7 Task Scheduler | avanthi | 4 | 1,246 |
02-28-2011 06:29 PM Last Post: basanth27 |
|
| After running about 70-80 transactions QTP and the browser hangs and stops running. | pram | 11 | 3,015 |
08-28-2009 06:21 PM Last Post: basanth27 |
|
| QTP scripts, stops running,when the window is minimized and locked | avsandhya | 0 | 812 |
03-17-2009 02:50 PM Last Post: avsandhya |
|
User(s) browsing this thread: 1 Guest(s)
|
|

Search
Member List
Calendar
Help



