Thursday, July 9, 2015

Reporting Object or output

7/9/2015 -- notes of webex training

Reporter object is used to Report something on the result.

- Reporter.ReportEvent ----- this is used to report

Reporter.ReportEvent micPass, "<Expected value>", "<Actual value>"

or

Reporter.ReportEvent micFail, "<Expected value>","<Actual value>"


-  Report each every step in a script is possible through Reporter.ReportEvent

- EX:
if(Browser("<>").Page("<>").WebEdit("<>").Exist(2)) then

Reporter.ReportEvent micPass, "WebEdit should exist", "WebEdit exist"

else

Reporter.ReportEvent micFail, "WebEdit should exist", "WebEdit does not exist"

end if


- For Screenshot we can use the below:

- Screenshot

1.  Manually capture the screen
CaptureBitmap("<path>")
Desktop.CaptureBitmap("<path>")

Ex: Browser("<name>").Page("<name>").CaptureBitmap("<path where screenshot needs to be saved")

2. Update settings to capture the screen
Go to Tools->Options->Run -> Screen Capture

We can also capture movies here.


-

2 comments:

  1. How to report whether click event happened or not?

    ReplyDelete
  2. #SolutiononClickEvent: Click event directly cant be validated, but indirectly we could validate if the click even did really happen, by finding out whether the next page displayed or not.

    ' Here Page has property of next page that has to display after click button is 'clicked

    if (Browser("<>").Page("<>").Exist(5)) then
    Reporter.ReportEvent micPass, "User should sign in", "User signed in"
    else
    Reporter.ReportEvent micFail, "User should sign in", "User failed to sign in"
    end if

    ReplyDelete