seleniumhq.github.io icon indicating copy to clipboard operation
seleniumhq.github.io copied to clipboard

[🐛 Bug]: implicit wait example: tiny inconsistency across languages: javascript example does more than examples for other languages

Open zipperer opened this issue 1 year ago • 2 comments

What happened?

This page that describes implicit waits includes code examples for Java, Python, CSharp, Ruby, and JavaScript. The JavaScript example both: (1) sets the value for the implicit wait and (2) demonstrates the benefit of setting a value for the implicit wait by finding an element that is not immediately available on the page. The examples for the other languages do (1) but not (2). So, there is a tiny inconsistency across the examples for the different languages. And that is the whole bug that this issue reports.

Below I paste four screenshots to show the examples for JavaScript, CSharp, Python, and Java. The screenshots differ on which tab I chose for language for the code example.

20240421-implicit-wait-example-javascript 20240421-implicit-wait-example-csharp 20240421-implicit-wait-example-python 20240421-implicit-wait-example-java

Suppose that this bug is worth doing anything about. Then, if we want the examples to be consistent across each of the languages, options include:

  • remove (2) from the JavaScript example
  • add (2) to the other examples

Option "remove (2) from the JavaScript example"

I claim: the source for that page is waits.en.md, and to remove (2) from the JavaScript example we could change

{{< tab header="JavaScript" >}} {{< gh-codeblock path="examples/javascript/test/waits/waits.spec.js#L37-L41" >}} {{< /tab >}}

to

{{< tab header="JavaScript" >}} {{< gh-codeblock path="examples/javascript/test/waits/waits.spec.js#L37" >}} {{< /tab >}}

i.e. change L37-L41 to L37.

Option "add (2) to the other examples"

On waits.en.md, change the gh-codeblock paths for the other languages to include an interval of lines that extends to the line that finds element with id "box0". For example, change

{{< tab header="Java" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/waits/WaitsTest.java#L50" >}} {{< /tab >}}

to

{{< tab header="Java" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/waits/WaitsTest.java#L50-L54" >}} {{< /tab >}}

i.e. change L50 to L50-L54. And perform a similar edit for Python, CSharp, and Ruby.

Best wishes, Andrew

What browsers and operating systems are you seeing the problem on?

Browser: Brave v1.64.109 OS: macOS Big Sur v11.7.10

zipperer avatar Apr 21 '24 17:04 zipperer

@zipperer, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

github-actions[bot] avatar Apr 21 '24 17:04 github-actions[bot]

Suppose this bug is worth doing anything about. Then there are similar bugs to note:

On the same page, in the examples for explicit wait:

  • the example for Ruby differs from the others
    • the others specify a timeout of 2 seconds while the example for Ruby does not
  • the example for JavaScript does more than the others

Within the next section 'Customization', the Ruby example shows how to set a timeout.

zipperer avatar Apr 21 '24 17:04 zipperer

Thank you, @harsha509 :)

zipperer avatar May 07 '24 14:05 zipperer