@@ -301,5 +301,39 @@ void VerifyBasicFindTableCell() {
301
301
assertEquals ("0.01" ,cellContents ,"Table cell contents correctly read" );
302
302
}
303
303
304
+ // Verify we can click a button control
305
+ @ org .junit .jupiter .api .Test
306
+ void VerifyButtonClick () {
307
+ seleniumDriver .gotoURL ("https://www.maxsys.com.au/" );
308
+ Button buttonControl =null ;
309
+ try {
310
+ buttonControl = new Button ("Sign In" );
311
+ buttonControl = ControlBase .setControl (seleniumDriver ,buttonControl );
312
+ buttonControl .click ();
313
+ }
314
+ catch ( Exception e ) {
315
+ Logger .WriteLine (Logger .LogLevels .TestInformation ,"Error thrown clicking on Button control: " ,e .getMessage ());
316
+ }
317
+ HTMLElement oops = seleniumDriver .findElementOrNull (new ObjectMapping ("//*[starts-with(.,'Oops')]" ,"Error message" ));
318
+ assertNotNull (oops ,"Error message shown" );
319
+ }
320
+
321
+ // Verify we can click a link (Anchor) control
322
+ @ org .junit .jupiter .api .Test
323
+ void VerifyLinkClick () {
324
+ seleniumDriver .gotoURL ("https://www.maxsys.com.au/" );
325
+ Anchor anchorControl =null ;
326
+ try {
327
+ anchorControl = new Anchor ("Forgot Password?" );
328
+ anchorControl = ControlBase .setControl (seleniumDriver ,anchorControl );
329
+ anchorControl .click ();
330
+ }
331
+ catch ( Exception e ) {
332
+ Logger .WriteLine (Logger .LogLevels .TestInformation ,"Error thrown clicking on Anchor control: " ,e .getMessage ());
333
+ }
334
+ String pageTitle = seleniumDriver .getPageTitle ().trim ();
335
+ assertEquals ("MAXsys | Forgot Password" ,pageTitle ,"Forgot password page shown" );
336
+ }
337
+
304
338
}
305
339
0 commit comments