1

I am using PageObject pattern for my selenium tests. I am getting compiler warnings [variable is never assigned to, and will always have its default value null] in C# . How to suppress these warnings?

Kiran
  • 11
  • 1
  • 3
  • Well what variables is it talking about? Sounds like you just have unused fields, but without seeing the code that is generating the warnings, we have no idea. – Arran Oct 10 '13 at 08:30

2 Answers2

1

Add the public access modifier to the WebElements. That'll get rid of it.. Otherwise, you might be able to add an attribute to the class to ignore those warnings.

In java, it's

@SupressWarnings("unused")
ddavison
  • 28,221
  • 15
  • 85
  • 110
0

This is a generic C# behavior, not Selenium specific.

Already covered here.

Community
  • 1
  • 1
dbalencar
  • 1
  • 2