java - Unable to access DesiredCapabilities methods -


my question : created desiredcapabilities instance shown in below code :

public class testcommons  {      desiredcapabilities capabilities = desiredcapabilities.firefox();     capabilities.setcapability("marionette", true);      webdriver driver = new firefoxdriver();      public void setup() {          driver.navigate().to(                 "http://toolsqa.wpengine.com/automation-practice-form/");         driver.manage().window().maximize();         driver.manage().timeouts().implicitlywait(20, timeunit.seconds);         system.out.println("");     }      public void teardown() {          driver.close();     }  } 

when write capabilities. in next line not getting eclipse intellisense options. , if write capabilities.setcapability , showing error. in code , in setup() method when write capabilities. options. why not getting eclipse intellisense outside method? attached screenshot.desiredcapabilities instance

this because have write capabilities.setcapability("marionette", true); inside method, not inside class.
applies method calls void return type.

a place 1 of @before-annotated methods (like @beforeclass) or, in cases, may class constructor.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -