Skip to content
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

Fixed failure when inputting text and RF is not running #1747

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/SeleniumLibrary/keywords/formelement.py
Expand Up @@ -17,7 +17,7 @@
import os
from typing import Optional, Union

from robot.libraries.BuiltIn import BuiltIn
from robot.libraries.BuiltIn import BuiltIn, RobotNotRunningError
from selenium.webdriver.remote.webelement import WebElement

from SeleniumLibrary.base import LibraryComponent, keyword
Expand Down Expand Up @@ -504,11 +504,17 @@ def _input_text_into_text_field(self, locator, text, clear=True, disable_log=Fal
element = self.find_element(locator)
if clear:
element.clear()

if disable_log:
self.info("Temporally setting log level to: NONE")
previous_level = BuiltIn().set_log_level("NONE")
try:
self.info("Temporally setting log level to: NONE")
previous_level = BuiltIn().set_log_level("NONE")
except RobotNotRunningError:
self.info('RF log levels not available when RF is not running.')

try:
element.send_keys(text)
finally:
if disable_log:
if disable_log and 'previous_level' in locals():
BuiltIn().set_log_level(previous_level)