File tree 5 files changed +29
-17
lines changed
examples/python/tests/support
website_and_docs/content/documentation/webdriver/support_features
5 files changed +29
-17
lines changed Original file line number Diff line number Diff line change 1
- from selenium import webdriver
1
+ from selenium .webdriver .common .by import By
2
+ from selenium .webdriver .support import expected_conditions as EC
3
+ from selenium .webdriver .support .wait import WebDriverWait
2
4
5
+ # Expected Conditions API Documentation:
6
+ # https://www.selenium.dev/selenium/docs/api/py/webdriver_support/selenium.webdriver.support.expected_conditions.html
7
+
8
+
9
+ def test_expected_condition (driver ):
10
+ driver .get ("https://www.selenium.dev/selenium/web/dynamic.html" )
11
+ revealed = driver .find_element (By .ID , "revealed" )
12
+ driver .find_element (By .ID , "reveal" ).click ()
13
+
14
+ wait = WebDriverWait (driver , timeout = 2 )
15
+ wait .until (EC .visibility_of_element_located ((By .ID , "revealed" )))
16
+
17
+ revealed .send_keys ("Displayed" )
18
+ assert revealed .get_property ("value" ) == "Displayed"
Original file line number Diff line number Diff line change @@ -24,10 +24,9 @@ These methods can include conditions such as:
24
24
[ Expected Conditions Documentation] ( https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/support/ui/ExpectedConditions.html )
25
25
{{< badge-code >}}
26
26
{{% /tab %}}
27
- {{< tab header="Python" >}}
28
- [ Expected Conditions Documentation] ( https://www.selenium.dev/selenium/docs/api/py/webdriver_support/selenium.webdriver.support.expected_conditions.html )
29
- {{< badge-code >}}
30
- {{< /tab >}}
27
+ {{% tab header="Python" %}}
28
+ {{< gh-codeblock path="examples/python/tests/support/test_expected_conditions.py#L14-L15" >}}
29
+ {{% /tab %}}
31
30
{{< tab header="CSharp" >}}
32
31
.NET stopped supporting Expected Conditions in Selenium 4 to minimize maintenance hassle and redundancy.
33
32
{{< /tab >}}
Original file line number Diff line number Diff line change @@ -24,10 +24,9 @@ These methods can include conditions such as:
24
24
[ Expected Conditions Documentation] ( https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/support/ui/ExpectedConditions.html )
25
25
{{< badge-code >}}
26
26
{{% /tab %}}
27
- {{< tab header="Python" >}}
28
- [ Expected Conditions Documentation] ( https://www.selenium.dev/selenium/docs/api/py/webdriver_support/selenium.webdriver.support.expected_conditions.html )
29
- {{< badge-code >}}
30
- {{< /tab >}}
27
+ {{% tab header="Python" %}}
28
+ {{< gh-codeblock path="examples/python/tests/support/test_expected_conditions.py#L14-L15" >}}
29
+ {{% /tab %}}
31
30
{{< tab header="CSharp" >}}
32
31
.NET stopped supporting Expected Conditions in Selenium 4 to minimize maintenance hassle and redundancy.
33
32
{{< /tab >}}
Original file line number Diff line number Diff line change @@ -24,10 +24,9 @@ These methods can include conditions such as:
24
24
[ Expected Conditions Documentation] ( https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/support/ui/ExpectedConditions.html )
25
25
{{< badge-code >}}
26
26
{{% /tab %}}
27
- {{< tab header="Python" >}}
28
- [ Expected Conditions Documentation] ( https://www.selenium.dev/selenium/docs/api/py/webdriver_support/selenium.webdriver.support.expected_conditions.html )
29
- {{< badge-code >}}
30
- {{< /tab >}}
27
+ {{% tab header="Python" %}}
28
+ {{< gh-codeblock path="examples/python/tests/support/test_expected_conditions.py#L14-L15" >}}
29
+ {{% /tab %}}
31
30
{{< tab header="CSharp" >}}
32
31
.NET stopped supporting Expected Conditions in Selenium 4 to minimize maintenance hassle and redundancy.
33
32
{{< /tab >}}
Original file line number Diff line number Diff line change @@ -24,10 +24,9 @@ description: >
24
24
[ Expected Conditions Documentation] ( https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/support/ui/ExpectedConditions.html )
25
25
{{< badge-code >}}
26
26
{{% /tab %}}
27
- {{< tab header="Python" >}}
28
- [ Expected Conditions Documentation] ( https://www.selenium.dev/selenium/docs/api/py/webdriver_support/selenium.webdriver.support.expected_conditions.html )
29
- {{< badge-code >}}
30
- {{< /tab >}}
27
+ {{% tab header="Python" %}}
28
+ {{< gh-codeblock path="examples/python/tests/support/test_expected_conditions.py#L14-L15" >}}
29
+ {{% /tab %}}
31
30
{{< tab header="CSharp" >}}
32
31
.NET stopped supporting Expected Conditions in Selenium 4 to minimize maintenance hassle and redundancy.
33
32
{{< /tab >}}
You can’t perform that action at this time.
0 commit comments