SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81

I solved these kinds of problems using the webdrive manager. You can automatically use the correct chromedriver by using the webdrive-manager. Install the webdrive-manager: pip install webdriver-manager Then use the driver in python as follows from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager driver = webdriver.Chrome(ChromeDriverManager().install()) This answer is taken from https://stackoverflow.com/a/52878725/10741023

How to run Selenium WebDriver test cases in Chrome

You need to download the executable driver from: ChromeDriver Download Then use the following before creating the driver object (already shown in the correct order): System.setProperty(“webdriver.chrome.driver”, “/path/to/chromedriver”); WebDriver driver = new ChromeDriver(); This was extracted from the most useful guide from the ChromeDriver Documentation.

How to capture the screenshot of a specific element rather than entire page using Selenium Webdriver?

We can get the element screenshot by cropping entire page screenshot as below: driver.get(“http://www.google.com”); WebElement ele = driver.findElement(By.id(“hplogo”)); // Get entire page screenshot File screenshot = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); BufferedImage fullImg = ImageIO.read(screenshot); // Get the location of element on the page Point point = ele.getLocation(); // Get width and height of the element int eleWidth = … Read more

Selenium: How selenium identifies elements visible or not? Is is possible that it is loaded in DOM but not rendered on UI?

Selenium can identify the presence or visibility of the elements as soon as they are present or visible in the HTML DOM. From user perspective you can invoke isDisplayed() method on an WebElement to examine if the intended WebElement is displayed or not. As per current implementation Selenium may not be distinguishing between loaded and … Read more

Selenium Google Login Block

I had the same problem and found the solution for it. I am using 1) Windows 10 Pro 2) Chrome Version 83.0.4103.97 (Official Build) (64-bit) 3) selenium ChromeDriver 83.0.4103.39 Some simple C# code which open google pages var options = new ChromeOptions(); options.addArguments(@”user-data-dir=c:\Users\{username}\AppData\Local\Google\Chrome\User Data\”); IWebDriver driver = new OpenQA.Selenium.Chrome.ChromeDriver(); driver = new ChromeDriver(Directory.GetCurrentDirectory(), options); driver.Url … Read more

Limit chrome headless CPU and memory usage

There had been a lot of discussion going around about the unpredictable CPU and Memory Consumption by Chrome Headless sessions. As per the discussion Building headless for minimum cpu+mem usage the CPU + Memory usage can be optimized by: Using either a custom proxy or C++ ProtocolHandlers you could return stub 1×1 pixel images or … Read more

XPath: difference between dot and text()

There is a difference between . and text(), but this difference might not surface because of your input document. If your input document looked like (the simplest document one can imagine given your XPath expressions) Example 1 <html> <a>Ask Question</a> </html> Then //a[text()=”Ask Question”] and //a[.=”Ask Question”] indeed return exactly the same result. But consider … Read more

How does reCAPTCHA 3 know I’m using Selenium/chromedriver?

reCaptcha Websites can easily detect the network traffic and identify your program as a BOT. Google have already released 5(five) reCAPTCHA to choose from when creating a new site. While four of them are active and reCAPTCHA v1 being shutdown. reCAPTCHA versions and types reCAPTCHA v3 (verify requests with a score): reCAPTCHA v3 allows you … Read more