Hi Aidy

We have written the following watir script for calling SAFS.

require 'Watir'
require 'Win32API'
class STAF_Watir_Interface

def processRequest(otrd)

 oresult = Win32API.new("DDVariableStore","STAFResult","","")

 ostaf = otrd.getSTAFHelper()

 status = ostaf.sendQueueMessage(debuglog, sinfo & "HookScript processing 
request...")

 otrd.setStatusCode(-1)
 otrd.setStatusInfo("")

 message = "I did good on line "& otrd.getLineNumber()
 details = "I deserve something special!"

 status = ostaf.logPassedMessage(otrd.getFac(), message, details, oresult)

 processRequest = otrd.getStatusCode()
end

 engine = "SAFS/Watir"

 shutdown = "False"
 
 astaf = Win32API.new("DDVariableStore","STAFUtilities","","")
 otrd = Win32API.new("DDVariableStore","TestRecordData","","") 
 oresult = Win32API.new("DDVariableStore","STAFResult","","")

 otrd.setSTAFHelper(ostaf)

 status = ostaf.registerNewProcess(engine)

 handleid = ostaf.getHandleID()

 status = ostaf.sendQueueMessage(debuglog, sinfo & "HookScript initializing...")
 status = ostaf.resetHookEvents(engine)
 status = ostaf.postEvent(engine & "Start")

 while (shutdown == False) do

  status = ostaf.sendQueueMessage(debuglog, sinfo & "HookScript Ready")
  status = ostaf.postEvent(engine & "Ready") 
     status = ostaf.getNextHookTestEvent(engine)
     status = ostaf.sendQueueMessage(debuglog, sinfo & "HookScript Dispatched")

     otrd.reinitialize()

     status = ostaf.getTestRecordDataVariant(otrd)

     record = otrd.getInputRecord()

     if record == "SHUTDOWN_HOOK" then

   shutdown = "True"
  end

  if (shutdown == "False") then
          status = processRequest(otrd)
   status = ostaf.sendQueueMessage(debuglog, sinfo & "HookScript Results: "& 
status) 
      status = ostaf.sendTestRecordResultsVariant (otrd)
             status = ostaf.setHookTestResultsEvents(engine, 2)
      status = ostaf.resetEvent(engine & "Running")
  else
      status = ostaf.sendQueueMessage(debuglog, sinfo & "HookScript Shutting 
Down") 
      status = ostaf.postEvent(engine &"Results")
  end
 end

 status = ostaf.resetHookEvents(engine)
 status = ostaf.postEvent(engine &"Shutdown")
 status = ostaf.sendQueueMessage(debuglog, sinfo & "HookScript Shutdown") 
 status = ostaf.unRegisterProcess ()

end



But we are getting the following error.
D:/Program Files/Watir/unittests/11.rb:35:1n 'initialize': GetProcAddress: 
STAFUtilities or STAFUtilitiesA <RuntimrError>
         from D:/Program Files/Watir/unittests/11.rb:35

Can you help us to solve the issue ?

Thanks
Meghanath


_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to