TestRequestPage functions syntax problem
Rebogh
Member Posts: 13
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?
// [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?
0
Best Answer
-
Hi Robogh
I have been fighting the same fight, shortly after seeing your post I got to this solution.
"TestReqPage.OK.INVOKE;"
I know it might be a bit late, but still
5
Answers
-
Hi Robogh
I have been fighting the same fight, shortly after seeing your post I got to this solution.
"TestReqPage.OK.INVOKE;"
I know it might be a bit late, but still
5
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 323 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions