Results 1 to 4 of 4
  1. #1

    AOM script doesn\'t call Actions


    I have an issue with AOM script.Please see the below.
    I nedd to run some of Actions automatically, I tried different solutions, but nothing works. My script retrieves the data(QTP script name) from Excel and the run it automatically. But for me is more interesting to run for example Action 2 fromTest1 or Action 3 from Test2(doesn't matter)- not all actions in test, only defined actions.
    Dim qtApp, qtTest, qtAction, qtResultsOpt, xlApp, xlBook, xlSheet, iRow, row_count, test_name, action
    Set qtApp = CreateObject("QuickTest.Application") 'Create the Application object

    'Start QuickTest
    If Not qtApp.Launched then
    qtApp.Visible = True
    end if

    qtApp.Options.Run.ImageCaptureForTestResults = "OnError"
    qtApp.Options.Run.RunMode = "Fast"
    qtApp.Options.Run.ViewResults = False
    qtApp.WindowState = "Maximized"
    qtApp.ActivateView "ExpertView"

    'Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions")

    Set xlApp = CreateObject("Excel.Application")
    Set xlBook = xlApp.Workbooks.Open("C:\filename.xls")
    Set xlSheet = xlBook.Worksheets("Sheet1")
    row_count = xlSheet.usedrange.rows.Count

    For iRow = 2 to row_count
    'Check if the application is not already Launched
    test_name = xlSheet.Rows(iRow).Columns(1).Value
    action = xlSheet.Rows(iRow).Columns(2).Value

    ' Open the test in editable mode
    qtApp.Open test_name, False
    qtApp.Options.Run.ViewResults = True
    Set qtTest = qtApp.Test

    Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object
    qtResultsOpt.ResultsLocation = "V:\Results" ' Set the results location


    Set qtResultsOpt = Nothing
    Set qtTest = Nothing

    Set xlSheet = Nothing
    Set xlBook = Nothing
    Set xlApp = Nothing
    Set qtApp = Nothing

    Here the peace of code which I found in internet, this code find the name of Action.
    For iCounter=1 to oActCount
    act_name = qtApp.Test.Actions(iCounter).Name
    Msgbox act_name

    Please, advise me the solution for this issue.
    Thanks in advance.
    спас&# 1080;бо

  2. #2

    Re: AOM script doesn\'t call Actions

    is it a special requirement to call action 2 of test1 ...i think if u have any conditional check better do that in action1 of test 1 then call actions from other tests or same test based on condition..
    Ganesh Iyer
    Winds of Change

  3. #3

    Re: AOM script doesn\'t call Actions

    Thanks, but it isn't solution.
    I need to run different Actions automatically preferable from external script.
    Because you can call an Action in other Action, if you are added Call to Existing Action manually,in other case QTP can't find this Action.

    If I'm wrong please correct me.


  4. #4

    Re: AOM script doesn\'t call Actions

    LoadAndRunAction helps! [img]/images/graemlins/smile.gif[/img]

    thanks for replies



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 07:28 PM.

Copyright BetaSoft Inc.