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 :)

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.
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.
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).

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


Sign In or Register to comment.