You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* By default, **[CSS Selectors](https://www.w3schools.com/cssref/css_selectors.asp)** are used for finding page elements.
@@ -132,7 +132,7 @@ class MyTestClass(BaseCase):
132
132
```python
133
133
self.open(URL) # Navigate to the web page
134
134
self.click(SELECTOR) # Click a page element
135
-
self.update_text(SELECTOR, TEXT) # Type text (Add "\n" to text for pressing enter/return.)
135
+
self.type(SELECTOR, TEXT) # Type text (Add "\n" to text for pressing enter/return.)
136
136
self.assert_element(SELECTOR) # Assert element is visible
137
137
self.assert_text(TEXT) # Assert text is visible (has optional SELECTOR arg)
138
138
self.assert_title(PAGE_TITLE) # Assert page title
@@ -163,7 +163,7 @@ SeleniumBase automatically handles common WebDriver actions such as spinning up
163
163
SeleniumBase uses simple syntax for commands, such as:
164
164
165
165
```python
166
-
self.update_text("input", "dogs\n")
166
+
self.type("input", "dogs\n")
167
167
```
168
168
169
169
The same command with regular WebDriver is very messy:
@@ -523,10 +523,10 @@ self.click("div#my_id")
523
523
524
524
<h4>Typing Text</h4>
525
525
526
-
self.update_text(selector, text) # updates the text from the specified element with the specified value. An exception is raised if the element is missing or if the text field is not editable. Example:
526
+
self.type(selector, text) # updates the text from the specified element with the specified value. An exception is raised if the element is missing or if the text field is not editable. Example:
527
527
528
528
```python
529
-
self.update_text("input#id_value", "2012")
529
+
self.type("input#id_value", "2012")
530
530
```
531
531
You can also use self.add_text() or the WebDriver .send_keys() command, but those won't clear the text box first if there's already text inside.
532
532
If you want to type in special keys, that's easy too. Here's an example:
0 commit comments