How to fix this HtmlUnit test giving errors

57 views Asked by At

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

1

There are 1 answers

0
RBRi On BEST ANSWER
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