Selenium Webdriver debugging methods errors

Debugging Methods and Common Errors in Selenium WebDriver

This article summarizes debugging methods and common errors in Selenium WebDriver.

Shou Arisaka
1 min read
Nov 14, 2025

This summarizes debugging methods and common errors in Selenium WebDriver.

A memo on Selenium WebDriver problems and errors. Will be updated as needed.

Debugging

Output full log Selenium::WebDriver.logger.level = :debug

Write to file Selenium::WebDriver.logger.output = ‘selenium.log’

ruby gem “pry”

For Ruby, the debugging gem “pry” is useful. It allows setting breakpoints, etc.

NoSuchElementError

Resolved by switching window tab focus. This is often the case when “NoSuchElementError” appears even though there’s no problem with the code.

When clicking a link that opens in a new tab, you need to switch focus. Links with “_blank” etc.

driver.window_handles.each do |handle|
  driver.switch_to.window handle
end

Share this article

Shou Arisaka Nov 14, 2025

🔗 Copy Links