Generated C# code is failing to build

I generated c# code of my test that is using the action IsNotPresentOrInvisible. The test runs successfully on TestProject and the AddOn is installed.
When I build the project in visual studio, it fails
Error is
‘WebActions’ does not contain a definition for ‘IsNotPresentOrInvisible’ and no accessible extension method ‘IsNotPresentOrInvisible’ accepting a first argument of type ‘WebActions’ could be found (are you missing a using directive or an assembly reference?