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?

1
  • 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. Commented Oct 10, 2013 at 8:30

2 Answers 2

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")
Sign up to request clarification or add additional context in comments.

Comments

0

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

Already covered here.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.