-1

I have a HtmlUnit test on the attached code. When I run the code I get the following error:

TylerH
  • 20,799
  • 66
  • 75
  • 101
rich25
  • 37
  • 11

1 Answers1

1
getByXPath

returns a list - you can't cast this to a button. You have to take one element from the list (e.g. the first one) for casting.

Or use

getFirstByXPath
RBRi
  • 2,704
  • 2
  • 11
  • 14