by h2kqba009521 » Sat May 10, 2014 5:03 pm
- Code: Select all
Option Explicit
Dim objMotorsPage, objFashionPage
Dim IDPropertyVal
Dim strActualPropertyValueMotors
Dim ExpectedIDMotors
ExpectedIDMotors = "motors-logo"
'systemutil.Run "www.ebay.com"
Browser("Electronics, Cars, Fashion,").Page("Electronics, Cars, Fashion,").Link("Motors").Click
objMotorsPage = Browser("Electronics, Cars, Fashion,").Page("Electronics, Cars, Fashion,").Link("Motors") @@ hightlight id_;_Browser("ebay").Page("Motors").WebElement("WebElement")_;_script infofile_;_ZIP::ssf20.xml_;_
objMotorsPage.WebElement("WebElement.Motors").Check CheckPoint("WebElement")
'IDPropertyVal = objMotorsPage.WebElement("WebElement.Motors").GetROProperty("html id")
If objMotorsPage.WebElement("WebElement.Motors").Exist(0) Then
strActualPropertyValueMotors = objMotorsPage.WebElement("WebElement.Motors").GetROProperty("html id")
If strActualPropertyValueMotors = ExpectedIDMotors Then
'pass the test
Reporter.ReportEvent 0, "Testcase for page of Motors", "has passed as HTML ID Property value is " & strActualPropertyValueMotors & "and expected property value is motors-logo"
else
'fail the test
Reporter.ReportEvent 1, "Testcase for page of Motors", "has failed as HTML ID Property value is " & strActualPropertyValueMotors & "and expected property value is motors-logo"
End If
Else
Reporter.ReportEvent 1, "Test case for page of Motors", "has failed" & "as Motors page does not exixst"
End If
'Back to Home Page
If objMotorsPage.WebElement("WebElement.Motors").Exist(0) Then
objMotorsPage.Link("Home").Click
reporter.ReportEvent micPass, "Motors Page", "GoBackHomePageTestFrom Motors Passed"
Else
reporter.ReportEvent micFail, "Motors Page", "GoBackHomePageTestFrom Motors Failed"
End If
Browser("ebay").Page("Home").Link("Fashion").Click @@ hightlight id_;_Browser("ebay").Page("Home").Link("Fashion")_;_script infofile_;_ZIP::ssf5.xml_;_
set objFashionPage = Browser("ebay").Page("Fashion")
'Back to Home Page
objFashionPage.Link("eBay").Click
Browser("ebay").Close
-
h2kqba009521
-
- Posts: 2
- Joined: Wed May 07, 2014 1:43 am
Return to QTP - Quick Test Professional, HP UFT Training - Automation Testing
Who is online
Users browsing this forum: No registered users and 1 guest