Gee Ahn
Gee Ahn

Reputation: 11

from invalid argument: 'value' must be a single Unicode code point error using ActionChains class of Selenium through Python

File "C:/Users/User/Test.py", line 58, in <module> 
.send_keys(DTD) \

selenium.common.exceptions.InvalidArgumentException: Message: invalid argument
from invalid argument: 'value' must be a single Unicode code point

This is the error I encountered when I send_keys to Date filed on Chrome browser.

The followings are my data and part of code.

  1. Data

enter image description here

  1. Part of code
    wb = pandas.read_excel(excel.xlsx)
    Journal = wb.values.tolist()

    for JV in Journal:
        DTD = str(JV[0])         #Date
        Actions(driver) \        #Make entry to the filed on google chrome browser
            .send_keys(DTD) \
            .perform()

Upvotes: 0

Views: 1587

Answers (1)

undetected Selenium
undetected Selenium

Reputation: 193078

This error message...

selenium.common.exceptions.InvalidArgumentException: Message: invalid argument
from invalid argument: 'value' must be a single Unicode code point

...implies that there was a compatibility issue while converting a non w3c command to w3c standard command.

As per the discussion in ActionChains perform returns exception 'value' must be a single unicode point this issue was observed with Version 1.11.1 when used along with ChromeDriver v2.45 setting the standards mode with:

goog:chromeOptions.w3c:true

Excert from release notes:

Resolved issue 2536: Make standards mode (goog:chromeOptions.w3c:true) the default [Pri-2]


Solution

An immediate solution would be to:


tl; dr

A couple of relevant discussions are as follows:

Upvotes: 1

Related Questions