AndroidDriver androiddriver
androiddriver.quit();//Worked
WebElement androiddriver
androiddriver.quit(); //FAILS - The method quit() is undefined for the type
AndroidDriver androiddriver
androiddriver.quit();//Worked
WebElement androiddriver
androiddriver.quit(); //FAILS - The method quit() is undefined for the type
Why cast androiddriver to WebElement? I’m a big fan of reading the unit tests when questions like this arise. Here is the base unit test that creates driver in @Before, and quits in @After:
Notice that like your 7.6.0, androiddriver is declared as type AndroidDriver, which has the .quit() method. I don’t think the type WebElement has .quit(), which is exactly the error you are getting.
I’ve tried use
AndroidDriver androiddriver;
androiddriver.quit(); //Works
But I’m unable to do something like this.
AndroidDriver objFrame = androiddriver.findElement(By.xpath(""));
But I get this error
Multiple markers at this line
Type mismatch: cannot convert from WebElement to
AndroidDriver
MobileElement cannot be resolved to a type
Nevermind I got it to work.
WebElement objFrame = androiddriver.findElement(By.xpath("."));
How to accept order autocratically from saned app