Selenium Compound class names not permitted

Leon’s comment leads to the correct information that compound class names are no longer supported. What you could do instead is try using css selectors. In your case, the following line of code should help you get the element you want : el3 = driver.find_element_by_css_selector(“.action-btn.cancel.alert-display”) For newer Selenium Versions el3 = driver.find_element(By.CSS_SELECTOR, “.action-btn.cancel.alert-display”) It finds … Read more

Is it possible to use Selenium WebDriver to drive PhantomJS?

PhantomJS now includes the GhostDriver project. You are also suggested to use PhantomJS directly or with a convenience library such as CasperJS. CasperJS is specifically designed to make it easy to do sequential operations to web pages, perfect for many automation tasks. Disclaimer: I am the author of PhantomJS. Edit: As noted in Nick’s answer, … Read more

Unable to hide “Chrome is being controlled by automated software” infobar within Chrome v76

As of 1 Aug 2019 – You can send the excludeswitch – enable-automation to hide the message. and to disable pop up ‘Disable developer mode extensions’ set useAutomationExtension=false . Refer for useAutomationExtension Tested on : Windows 10 Version 76.0.3809.87 (Official Build) (64-bit) ChromeDriver 76.0.3809.68 –enable-automation : Inform users that their browser is being controlled by … Read more

How to download an image using Selenium (any version)?

I prefer doing something like this : 1. Get the SRC attribute of the image. 2. Use ImageIO.read to read the image onto a BufferedImage 3. Save the BufferedImage using ImageIO.write function For e.g. String src = imgElement.getAttribute(‘src’); BufferedImage bufferedImage = ImageIO.read(new URL(src)); File outputfile = new File(“saved.png”); ImageIO.write(bufferedImage, “png”, outputfile);

Check if a WebElement is stale without handling an exception

Webdriver itself uses the try/catch-construction to check for staleness as well. from org.openqa.selenium.support.ui.ExpectedConditions.java: public static ExpectedCondition<Boolean> stalenessOf(final WebElement element) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver ignored) { try { // Calling any method forces a staleness check element.isEnabled(); return false; } catch (StaleElementReferenceException expected) { return true; } } @Override public String … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)