java.lang.NullPointerException: Cannot invoke “java.util.concurrent.TimeUnit.toMillis(long)” because “unit” is null
java.lang.NullPointerException: Cannot invoke “java.util.concurrent.TimeUnit.toMillis(long)” because “unit” is null
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS) ;
The error message “java.lang.NullPointerException: Cannot invoke ‘java.util.concurrent.TimeUnit.toMillis(long)’ because ‘unit’ is null” indicates that a null reference is being passed as the argument ‘unit’ to the method ‘toMillis(long)’ in the class ‘java.util.concurrent.TimeUnit’. This means that the variable ‘unit’ has not been assigned a value and is therefore null, causing the exception to be thrown. To resolve this issue, you need to make sure that the variable ‘unit’ is assigned a value before it is passed as an argument to the method ‘toMillis(long)’.