Selenium findElements() / findElement(by class) returns null
Here is your problem:
private void logIn(){ //Create Driver and log in // myWebDriver is a Class field already // Remove WebDriver declaracion this.myWebDriver = new FirefoxDriver(); myWebDriver.navigate().to("https://www.youtube.com/");}
You are creating a new WebDriver
, so when you use it at findElements
function it's not properly initialized.
Hope this helps!