You can handle the CCPA Privacy Manager alert using the following steps in Selenium Webdriver/TestNG:
1 Locate the element of the pop-up using locators such as xpath, css selector, id, etc.
2 Once you locate the element, you can interact with it using Selenium Webdriver's WebElement class. For example, you can click the "Accept" or "Decline" button.
3 To dismiss the alert you can use the Alert interface of Selenium Webdriver, you can switch to the alert and either accept or dismiss it.
Example code in Java:
WebDriverWait wait = new WebDriverWait(driver, 30);
WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//element_locator")));
element.click();
Alert alert = driver.switchTo().alert();
alert.accept();
4 If the pop-up is not a standard JavaScript alert, but is a modal window on the page, you can use WebDriverWait to wait for it to appear, and then interact with it using WebElement class.
Example code in Java:
WebDriverWait wait = new WebDriverWait(driver, 30);
WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//element_locator")));
element.click();
Note: Replace "element_locator" in the above code with the actual locator of the element you want to interact with.