Libraries & Frameworks

java.lang.NullPointerException: Cannot invoke “org.openqa.selenium.WebDriver.quit()” because “this.driver” is null
at hooks.MyHook.teardown(MyHook.java:24)
public class MyHook extends Base{
@Before
public void beforeScenario(){
System.out.println(“Scenarios has started”);
}
@After
public void teardown() {
driver.quit();
}
}

public class Base {
public WebDriver driver;
public Properties prop;

public WebDriver initializeDriver() throws IOException{
prop= new Properties();
FileInputStream fis=new FileInputStream(“C:\Users\CITPL-Developer-2\eclipse-workspace\Fdms\src\main\java\citpl\resources\data.properties”);
prop.load(fis);

String browserName = System.getProperty(“browser”)!=null ? System.getProperty(“browser”) :prop.getProperty(“browser”);

if(browserName.equals(“chrome”))
{
ChromeOptions options = new ChromeOptions();
options.addArguments(“–remote-allow-origins=*”);
System.setProperty(“webdriver.chrome.driver”,”C:\Users\CITPL-Developer-2\driver\chromedriver.exe”);

if(browserName.contains(“headless”)){
options.addArguments(“headless”);
}
driver = new ChromeDriver(options);
driver.manage().window().maximize();
}
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
return driver;
}

public class LoginSteps extends Base{

@Given (“Naviagate to the login page”)
public void Naviagate_to_the_login_page() throws IOException {
initializeDriver();
driver.get(prop.getProperty(“url”));
}
@When (“^I enter valid username (.+) and password (.+)$”)
public void I_enter_valid_username_valid_username_and_Pasword(String username, String password) throws InterruptedException {
LoginPage lp= new LoginPage(driver);
lp.entervalidCredentials(username, password);
}

Background : I am trying to access Appium Inspector on iOS iPhone 16 using MacOS with M1.
Problem : Previously using appium inspector I was able to inspect the elements/locators for iOS on real device as well as simulator.
But after migrating to macOS Sequoia I observed Appium inspector is not getting loaded and observed error 500
Error stack :
Got response with status 500: {“value”:{“error”:”unknown error”,”message”:”-[XCUIApplicationProcess waitForQuiescenceIncludingAnimationsIdle:]: unrecognized selector sent to instance 0x600002c7f900″

Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: -[XCUIApplicationProcess waitForQuiescenceIncludingAnimationsIdle:]: unrecognized selector sent to instance 0x600002c7f900

After analysed I saw this is occurring after cmd ‘getPageSource’

Matched ‘/source?format=xml&scope=AppiumAUT’ to command name
‘getPageSource’

Anyone has observe this kind of behavior and already aware about fix?strong text

In this blog, we explore how AI is optimizing QA processes in order management, from automating testing to predictive analytics. Learn how AI technologies are revolutionizing the reliability of QSR order systems, while maintaining high customer satisfaction.
The post How QA Powers Scalable Order Management for Global QSR Chains first appeared on TestingXperts.