quick test pro

Thảo luận về phần mềm Quick Test Pro QTP
Forum rules
Thảo luận về phần mềm Quick Test Pro QTP
Post Reply
dangvantrung
Hoc Tester
Posts: 4
Joined: Mon 21 Jan, 2013 10:42 pm
Contact:

quick test pro

Post by dangvantrung »

có bạn nào biết cái link clip hướng dẫn test gmail cho mình xin với!
thank!



tvn
Admin
Posts: 4900
Joined: Tue 10 Aug, 2010 10:11 am
Location: HCM
Contact:

Re: quick test pro

Post by tvn »

dangvantrung wrote:có bạn nào biết cái link clip hướng dẫn test gmail cho mình xin với!
thank!
Bạn copy cả cái code này vào QTP rồi chạy thử nha

Code: Select all

'Launching Internet Explorer and Opening Gmail Application
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "http://www.gmail.com"

'We will use the sync method to wait till Gmail opens
Browser("Title:=Gmail.*").Page("title:=Gmail.*").Sync

'Script to set username and password to login
Browser("Title:=Gmail.*").Page("title:=Gmail.*").WebEdit("name:=Email").Set "xxxxxx"
Browser("Title:=Gmail.*").Page("title:=Gmail.*").WebEdit("name:=Passwd").Set "yyyyyy"
Browser("Title:=Gmail.*").Page("title:=Gmail.*").WebButton("name:=Sign in").click
Browser("Title:=Gmail.*").Page("title:=Gmail.*").Sync
If Browser("Title:=Gmail.*").Page("title:=Gmail.*").Link("innertext:=Sign out", "html id:=:.*").Exist(1) Then

'Print a Pass message for the user if logged in
Print "User " &Username& " is successfully Logged in"
Else If not Browser("Title:=Gmail.*").Page("title:=Gmail.*").Link("innertext:=Sign out", "html id:=:.*").Exist(1) Then

'Print a Fail message for the user if not able to log in and terminate the action
Print "User " &Username& " is not able to Login in"
Print "The Test has been terminated"
ExitAction
End If
End If
Máy mình mới cài lại nên chưa cài QTP, mình chưa chạy thử.



dangvantrung
Hoc Tester
Posts: 4
Joined: Mon 21 Jan, 2013 10:42 pm
Contact:

Re: quick test pro

Post by dangvantrung »

bạn ơi cái này chỉ để test mỗi cái user xxxx với cái pass yyyy thui
bạn có cách nào để mình có thể test dc các test case nhập từ bàn phím không?



dangvantrung
Hoc Tester
Posts: 4
Joined: Mon 21 Jan, 2013 10:42 pm
Contact:

Re: quick test pro

Post by dangvantrung »

cái này chỉ test được cái user xxxx với pass yyyy thui bạn,có cách nào để test được các user và pass từ bảng data không bạn



tvn
Admin
Posts: 4900
Joined: Tue 10 Aug, 2010 10:11 am
Location: HCM
Contact:

Re: quick test pro

Post by tvn »

dangvantrung wrote:cái này chỉ test được cái user xxxx với pass yyyy thui bạn,có cách nào để test được các user và pass từ bảng data không bạn
Bạn xem video này có hướng dẫn tạo data driven trong QTP nè.



Post Reply

Return to “Quick Test Pro (QTP)”