Skip to content

Enabling two FF driver tests #2401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from
Open

Enabling two FF driver tests #2401

wants to merge 4 commits into from

Conversation

diemol
Copy link
Member

@diemol diemol commented Jul 31, 2025

User description

Thanks for contributing to the Selenium site and documentation!
A PR well described will help maintainers to review and merge it quickly

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, and help reviewers by making them as simple and short as possible.

A couple of flags were added to the service in FF and this enables those tests we already had.

Description

Motivation and Context

Types of changes

  • Change to the site (I have double-checked the Netlify deployment, and my changes look good)
  • Code example added (and I also added the example to all translated languages)
  • Improved translation
  • Added new translation (and I also added a notice to each document missing translation)

Checklist

  • I have read the contributing document.
  • I have used hugo to render the site/docs locally and I am sure it works.

PR Type

Tests


Description

  • Enable two previously ignored Firefox driver tests

  • Fix log file path configuration for Firefox service

  • Correct log location validation logic


Diagram Walkthrough

flowchart LR
  A["Ignored Tests"] --> B["Remove [Ignore] Attributes"]
  B --> C["Fix LogPath Property"]
  C --> D["Correct Log Validation"]
  D --> E["Working Firefox Tests"]
Loading

File Walkthrough

Relevant files
Tests
FirefoxTest.cs
Enable Firefox driver logging tests                                           

examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs

  • Remove [Ignore] attributes from LogsToFile() and LogsLevel() test
    methods
  • Fix service.LogPath property assignment (was commented out)
  • Correct log location validation logic in GetLogLocation() method
+3/-6     

Copy link
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Logic Error

The condition in GetLogLocation() method has incorrect logic. It checks if _logLocation is null/empty AND if the file doesn't exist, but it should use OR logic instead. This could cause the method to not create a new temp file when needed.

if (string.IsNullOrEmpty(_logLocation) && !File.Exists(_logLocation))
{

Copy link
Contributor

qodo-merge-pro bot commented Jul 31, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Fix logical operator in condition

The logical condition is incorrect. When _logLocation is null or empty, checking
File.Exists(_logLocation) will always return false, making the condition always
true. Use OR operator instead of AND to properly handle both null/empty and
non-existent file cases.

examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs [171-174]

-if (string.IsNullOrEmpty(_logLocation) && !File.Exists(_logLocation))
+if (string.IsNullOrEmpty(_logLocation) || !File.Exists(_logLocation))
 {
     _logLocation = Path.GetTempFileName();
 }
  • Apply / Chat
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies a logical bug in the new code, as using && would prevent creating a new temp file if _logLocation has a value but the file doesn't exist.

Medium
  • Update

Copy link

netlify bot commented Jul 31, 2025

Deploy Preview for selenium-dev ready!

Name Link
🔨 Latest commit 6cfbb90
🔍 Latest deploy log https://app.netlify.com/projects/selenium-dev/deploys/689c4a21161e950008d714c2
😎 Deploy Preview https://deploy-preview-2401--selenium-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

qodo-merge-pro bot commented Aug 12, 2025

CI Feedback 🧐

(Feedback updated until commit 82705e2)

A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

Action: tests (ubuntu, nightly)

Failed stage: Run tests [❌]

Failure summary:

The action failed because the .NET build/test step could not compile due to a missing type:
- C#
compiler error CS0246 at examples/dotnet/SeleniumDocs/Troubleshooting/LoggingTest.cs(48,35): The
type or namespace name ConsoleLogHandler could not be found.
- This indicates a missing using
directive, package/reference, or class definition required by SeleniumDocs.csproj.
- The retry
wrapper attempted the command three times (dotnet test in examples/dotnet/SeleniumDocs) and each
attempt failed with the same compile error, causing the job to exit with code 1.

Relevant error logs:
1:  ##[group]Runner Image Provisioner
2:  Hosted Compute Agent
...

144:  > Warning:          Could not resolve keysym XF86CameraAccessToggle
145:  > Warning:          Could not resolve keysym XF86NextElement
146:  > Warning:          Could not resolve keysym XF86PreviousElement
147:  > Warning:          Could not resolve keysym XF86AutopilotEngageToggle
148:  > Warning:          Could not resolve keysym XF86MarkWaypoint
149:  > Warning:          Could not resolve keysym XF86Sos
150:  > Warning:          Could not resolve keysym XF86NavChart
151:  > Warning:          Could not resolve keysym XF86FishingChart
152:  > Warning:          Could not resolve keysym XF86SingleRangeRadar
153:  > Warning:          Could not resolve keysym XF86DualRangeRadar
154:  > Warning:          Could not resolve keysym XF86RadarOverlay
155:  > Warning:          Could not resolve keysym XF86TraditionalSonar
156:  > Warning:          Could not resolve keysym XF86ClearvuSonar
157:  > Warning:          Could not resolve keysym XF86SidevuSonar
158:  > Warning:          Could not resolve keysym XF86NavInfo
159:  Errors from xkbcomp are not fatal to the X server
160:  ##[group]Run actions/setup-dotnet@v4
...

414:  Version: 11.0.28+6
415:  Path: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/11.0.28-6/x64
416:  ##[endgroup]
417:  Creating settings.xml with server-id: github
418:  Writing to /home/runner/.m2/settings.xml
419:  ##[group]Run nick-fields/retry@v3.0.2
420:  with:
421:  timeout_minutes: 20
422:  max_attempts: 3
423:  command: cd examples/dotnet/SeleniumDocs
424:  dotnet test
425:  
426:  retry_wait_seconds: 10
427:  polling_interval_seconds: 1
428:  warning_on_retry: true
429:  continue_on_error: false
430:  env:
431:  DISPLAY: :99
432:  GITHUB_TOKEN: ***
433:  GH_TOKEN: ***
434:  DOTNET_ROOT: /usr/share/dotnet
435:  JAVA_HOME: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/11.0.28-6/x64
436:  JAVA_HOME_11_X64: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/11.0.28-6/x64
437:  ##[endgroup]
438:  ##[group]Attempt 1
439:  Determining projects to restore...
440:  All projects are up-to-date for restore.
441:  ##[error]/home/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Troubleshooting/LoggingTest.cs(48,35): error CS0246: The type or namespace name 'ConsoleLogHandler' could not be found (are you missing a using directive or an assembly reference?) [/home/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
442:  ##[warning]Attempt 1 failed. Reason: Child_process exited with error code 1
443:  ##[endgroup]
444:  ##[group]Attempt 2
445:  Determining projects to restore...
446:  All projects are up-to-date for restore.
447:  ##[error]/home/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Troubleshooting/LoggingTest.cs(48,35): error CS0246: The type or namespace name 'ConsoleLogHandler' could not be found (are you missing a using directive or an assembly reference?) [/home/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
448:  ##[warning]Attempt 2 failed. Reason: Child_process exited with error code 1
449:  ##[endgroup]
450:  ##[group]Attempt 3
451:  Determining projects to restore...
452:  All projects are up-to-date for restore.
453:  ##[error]/home/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Troubleshooting/LoggingTest.cs(48,35): error CS0246: The type or namespace name 'ConsoleLogHandler' could not be found (are you missing a using directive or an assembly reference?) [/home/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
454:  ##[endgroup]
455:  ##[error]Final attempt failed. Child_process exited with error code 1
456:  Post job cleanup.

Copy link
Contributor

CI Feedback 🧐

A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

Action: tests (macos, stable)

Failed stage: Run tests [❌]

Failure summary:

The action failed because the .NET build for the example tests did not compile due to API changes in
Selenium:
- Compilation errors CS1061 in examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs:
-
(line 68, col 21) and (line 97, col 21): FirefoxDriverService has no definition for LogPath, and no
accessible extension method LogPath was found. This indicates the property was removed or renamed in
the referenced Selenium WebDriver/FirefoxDriver version.
- An additional warning indicates
ConsoleLogHandler is obsolete in Troubleshooting/LoggingTest.cs(48,35), suggesting newer Selenium
APIs are in use.
As a result, dotnet test failed on all three retry attempts and exited with code 1.

Relevant error logs:
1:  ##[group]Runner Image Provisioner
2:  Hosted Compute Agent
...

180:  Version: 11.0.28+6
181:  Path: /Users/runner/hostedtoolcache/Java_Temurin-Hotspot_jdk/11.0.28-6/arm64/Contents/Home
182:  ##[endgroup]
183:  Creating settings.xml with server-id: github
184:  Writing to /Users/runner/.m2/settings.xml
185:  ##[group]Run nick-fields/retry@v3.0.2
186:  with:
187:  timeout_minutes: 20
188:  max_attempts: 3
189:  command: cd examples/dotnet/SeleniumDocs
190:  dotnet test
191:  
192:  retry_wait_seconds: 10
193:  polling_interval_seconds: 1
194:  warning_on_retry: true
195:  continue_on_error: false
196:  env:
...

211:  Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry
212:  ----------------
213:  Installed an ASP.NET Core HTTPS development certificate.
214:  To trust the certificate, run 'dotnet dev-certs https --trust'
215:  Learn about HTTPS: https://aka.ms/dotnet-https
216:  ----------------
217:  Write your first app: https://aka.ms/dotnet-hello-world
218:  Find out what's new: https://aka.ms/dotnet-whats-new
219:  Explore documentation: https://aka.ms/dotnet-docs
220:  Report issues and find source on GitHub: https://github.com/dotnet/core
221:  Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
222:  --------------------------------------------------------------------------------------
223:  Determining projects to restore...
224:  Restored /Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj (in 2.05 sec).
225:  ##[warning]/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Troubleshooting/LoggingTest.cs(48,35): warning CS0618: 'ConsoleLogHandler' is obsolete: 'Use TextWriterHandler instead, will be removed in v4.32' [/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
226:  ##[error]/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs(68,21): error CS1061: 'FirefoxDriverService' does not contain a definition for 'LogPath' and no accessible extension method 'LogPath' accepting a first argument of type 'FirefoxDriverService' could be found (are you missing a using directive or an assembly reference?) [/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
227:  ##[error]/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs(97,21): error CS1061: 'FirefoxDriverService' does not contain a definition for 'LogPath' and no accessible extension method 'LogPath' accepting a first argument of type 'FirefoxDriverService' could be found (are you missing a using directive or an assembly reference?) [/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
228:  ##[warning]Attempt 1 failed. Reason: Child_process exited with error code 1
229:  ##[endgroup]
230:  ##[group]Attempt 2
231:  Determining projects to restore...
232:  All projects are up-to-date for restore.
233:  ##[warning]/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Troubleshooting/LoggingTest.cs(48,35): warning CS0618: 'ConsoleLogHandler' is obsolete: 'Use TextWriterHandler instead, will be removed in v4.32' [/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
234:  ##[error]/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs(68,21): error CS1061: 'FirefoxDriverService' does not contain a definition for 'LogPath' and no accessible extension method 'LogPath' accepting a first argument of type 'FirefoxDriverService' could be found (are you missing a using directive or an assembly reference?) [/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
235:  ##[error]/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs(97,21): error CS1061: 'FirefoxDriverService' does not contain a definition for 'LogPath' and no accessible extension method 'LogPath' accepting a first argument of type 'FirefoxDriverService' could be found (are you missing a using directive or an assembly reference?) [/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
236:  ##[warning]Attempt 2 failed. Reason: Child_process exited with error code 1
237:  ##[endgroup]
238:  ##[group]Attempt 3
239:  Determining projects to restore...
240:  All projects are up-to-date for restore.
241:  ##[warning]/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Troubleshooting/LoggingTest.cs(48,35): warning CS0618: 'ConsoleLogHandler' is obsolete: 'Use TextWriterHandler instead, will be removed in v4.32' [/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
242:  ##[error]/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs(68,21): error CS1061: 'FirefoxDriverService' does not contain a definition for 'LogPath' and no accessible extension method 'LogPath' accepting a first argument of type 'FirefoxDriverService' could be found (are you missing a using directive or an assembly reference?) [/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
243:  ##[error]/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs(97,21): error CS1061: 'FirefoxDriverService' does not contain a definition for 'LogPath' and no accessible extension method 'LogPath' accepting a first argument of type 'FirefoxDriverService' could be found (are you missing a using directive or an assembly reference?) [/Users/runner/work/seleniumhq.github.io/seleniumhq.github.io/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj]
244:  ##[endgroup]
245:  ##[error]Final attempt failed. Child_process exited with error code 1
246:  Post job cleanup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant