TestRequestPage functions syntax problem

ReboghRebogh Member Posts: 13
edited 2017-01-11 in NAV Three Tier
Have an issue with report request page in test codeunit. It could be interesting for you, and maybe, I could get an advice about :)

// [SCENARIO]
Automated Test. Need to pass values to global variables on report request page in code and run report.

// [GIVEN]
Processing-only report, Test codeunit, Test trigger, which is running report, RequestPageHandler, TestRequestPage, ReportHandler

// [WHEN]
At first, I tried to pass values through xml parameters with standard report function RUNREQUESTPAGE.
https://msdn.microsoft.com/en-us/library/dn762361(v=nav.90).aspx
figured, that it could transfer only dataset filters, but not global variables.

Then, I used TestRequestPage directly after report.run. Also, tried diff combinations of ReportHandler, RequestPageHandler with it.
https://msdn.microsoft.com/en-us/library/hh169417(v=nav.90).aspx
first thing, which seems weird to me, was a short MSDN help. It has only 4 triggers instead of dozens of functions on TestReqPage object.

After assigning value to control, which is successful, we need to press ok on req. window.
If this is not done, report will not be executed.
Microsoft (and also there are examples in our autotest-cases) recommends to use SAVEAS...
Problem is that there`s no such menu in ProcessingOnly, it gives an error on execution.
Main problem lays in «OK» function (sounds funny, heh).
https://snag.gy/2W6XBM.jpg

Have no clue what is needed to use it. Tried to play with it in different ways, but have no result.
Also, could not find any info about in google.

// [THEN]
Solved it by creating a function in report to pass all needed parameters into global variables.
Of course, it is not a universal solution, and (i hope) there should be a way to use TestReqPage in this case.

Any ideas?

Best Answer

Answers

Sign In or Register to comment.