robotframework / robotframework/SeleniumLibrary
Keyword `Input Password` throws an exception when run with Python (no robotframework)
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 1.5k
- Forks
- 787
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
For issues
Steps to reproduce the issue
from SeleniumLibrary import SeleniumLibrary
from time import sleep
library = SeleniumLibrary()
def minimal_task():
try:
library.open_browser('https://docs.robocorp.com')
library.input_password("//input[@aria-label='Search']", "playwright")
sleep(5)
finally:
library.close_all_browsers()
print("Done.")
if __name__ == "__main__":
minimal_task()
Error messages and additional information
Traceback (most recent call last):
File "task.py", line 23, in <module>
minimal_task()
File "task.py", line 15, in minimal_task
library.input_password("//input[@aria-label='Search']", "playwright")
File "C:\Users\User\AppData\Local\robocorp\live\199e494e4c733ef3\lib\site-packages\SeleniumLibrary\keywords\formelement.py", line 269, in input_password
self._input_text_into_text_field(locator, password, clear, disable_log=True)
File "C:\Users\User\AppData\Local\robocorp\live\199e494e4c733ef3\lib\site-packages\SeleniumLibrary\keywords\formelement.py", line 509, in _input_text_into_text_field
previous_level = BuiltIn().set_log_level("NONE")
File "C:\Users\User\AppData\Local\robocorp\live\199e494e4c733ef3\lib\site-packages\robot\libraries\BuiltIn.py", line 3006, in set_log_level
old = self._context.output.set_log_level(level)
File "C:\Users\User\AppData\Local\robocorp\live\199e494e4c733ef3\lib\site-packages\robot\libraries\BuiltIn.py", line 64, in _context
return self._get_context()
File "C:\Users\User\AppData\Local\robocorp\live\199e494e4c733ef3\lib\site-packages\robot\libraries\BuiltIn.py", line 69, in _get_context
raise RobotNotRunningError('Cannot access execution context')
robot.libraries.BuiltIn.RobotNotRunningError: Cannot access execution context
Expected behavior and actual behavior
Keyword Input Password works with and without Robot Framework
Environment
Browser: default by Open Browser keyword
Browser driver: Gecko
Operating System: Windows 10
Libraries
- Robot Framework: NOT USED
- Selenium: 3.141.0
- SeleniumLibrary: robotframework-seleniumlibrary==5.1.3
- Interpreter: Python 3.7.5 | packaged by conda-forge | (default, Jan 28 2021, 18:15:34) [MSC v.1916 64 bit (AMD64)] on win32
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne in SeleniumLibrary/keywords/formelement.py bei input_password und _input_text_into_text_field, den im Traceback gezeigten Einstiegspunkten. Reproduziere den Aufruf außerhalb von Robot Framework und untersuche anschließend die vorhandenen Keyword-Tests für Formularelemente. Als erledigt gilt die Aufgabe, wenn Input Password sowohl mit als auch ohne einen Robot Framework-Ausführungskontext funktioniert und eine Regressionstestabdeckung für den gemeldeten Fehler vorhanden ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- testing-qa
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100