Hi
I'm trying to test a custom action in my test app. When action is invoked, it should open a url. In the test function, I have created a HyperlinkHandler but it is not working. When i run the test case in test tool, it says 'Unhandled UI: Hyperlink' . Any guesses about what's missing here?
[Test]
[HandlerFunctions('HyperlinkHandler')]
procedure TestLookupDocument()
var
VendorLedgerEntry: TestPage "Vendor Ledger Entries";
BfSetup: Record "MDCBF Setup";
TestDataMgt: Codeunit "MDCBF Test Data Management";
begin
//[Scenario] If Lookup Document action is invoked, it opens that document in Batchflow online Dashboard
//[Given] vendor Ledger entries Page is open, serial no. in setup is not blank
TestDataMgt.InitializeSetup();
TestDataMgt.SetupMockStripeData();
Commit();
VendorLedgerEntry.OpenView();
Assert.IsTrue(VendorLedgerEntry."Lookup Document".Visible(), 'Action LookupDocuments is Visible');
Assert.IsTrue(VendorLedgerEntry."Lookup Document".Enabled(), 'Action LookupDocuments is enabled');
VendorLedgerEntry."Lookup Document".Invoke();
end;
Below is the handler function:
[HyperlinkHandler]
procedure HyperLinkHandler(Message: Text[1024]);
var
Pos: Integer;
begin
Pos := StrPos(Message, 'dashboard.bfonline.dk/.../login');
Assert.IsTrue(Pos = 1, 'Hyperlink is correct');
end;

Report
All responses (
Answers (