2016-08-25 4 views
1

셀레늄을 사용하는 것과 비슷한 헤드리스 (Headless) 브라우저를 사용하여 자동화 스크립트를 UFT로 실행할 수 있습니까?UFT를 사용한 헤드리스 UI 자동화 테스트

지금 실행중인 스크립트는 많은 시간을 소비하며 매우 느립니다.

저는 UFT에 비교적 익숙하지 않고 UFT를 사용하여 헤드리스 테스팅을 한 웹에 대한 조사를했지만 아무 것도 찾을 수 없었습니다.

어떤 조언이나 제안도 환영합니다.

답변

0

아래 코드와 유사합니까?

Public Function GetAllLinksInthePage() 
    Dim oIE 
    Set oIE = CreateObject("InternetExplorer.Application") 
    oIE.Visible = False 
    oIE.Navigate2 "http://newtours.demoaut.com/" 
    Wait 4 
    Set oIEDocument = oIE.Document 
    Set oLinkCollection = oIEDocument.getElementsByTagName("A") 
    iLinkCount = oLinkCollection.Length 
    If iLinkCount > 0 Then 
     For iCount = 0 To iLinkCount - 1 
      Print oLinkCollection(iCount).Text 
     Next 
    End If 
    Set oIE = Nothing 
End Function 
0

애플리케이션이 REST 또는 SOA 형태로 풍부한 API 세트를 제공하는 경우 XMLHTTP 객체를 사용할 수 있습니다. QTP/UFT와 독립적입니다. 그것은 순수한 VBSscript이고 어디서나 사용할 수 있습니다. 슬픈 부분은 처음부터 많은 코딩 작업을해야한다는 것입니다. 그러나 매우 쉽습니다.

dim xmlhttp, fso, f1, serverURL 
 
Set xmlhttp = Createobject("Microsoft.XMLHTTP") 
 
serverURL = "http://maps.googleapis.com/maps/api/distancematrix/xml?origins=Atlanta+GA+USA&destinations=Dallas+TX+USA&units=imperial&sensor=false" 
 
xmlhttp.Open "POST", serverURL, false 
 
xmlhttp.Send 
 
Set fso = CreateObject("Scripting.FileSystemObject") 
 
Set f1 = fso.CreateTextFile("D:\Sample VB Scripts\testfile.xml", True) 
 
f1.write xmlhttp.ResponseText 
 
f1.close

Sample XMLHTTP code

관련 문제