working on utf8 character where browser disable paste function

Asked by yan ho ting

I am working on an automation tools on a website.
There is an attribute that disable paste(CTRL+V) but I need to enter utf8 character in it.
Therefore, I cannot use paste(unicode(string,"utf8"))
Any solution to that?

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Roman Podolyan (podolyan-roman) said :
#1

AFAIK there are Unicode input codes, alt + dddd where d is digit (0-9). See here: ( http://www.utf8-chartable.de/unicode-utf8-table.pl?utf8=dec )

I'd try to write custom function to enter symbols I want used keyUp and keyDown (alt down , 3 numbers up-down, gotcha).

Here is code which I use to type "§" character to text editor AkelPad (Windows) 5 times.
_______
#moving mouse out of menu area and clicking
mouseMove(100,100)
click()

# Doing our key sequence (typing character 3 times)
for i in range(0,5):
    keyDown(Key.ALT)
    keyDown(Key.NUM0)
    keyUp(Key.NUM0)
    keyDown(Key.NUM1)
    keyUp(Key.NUM1)
    keyDown(Key.NUM6)
    keyUp(Key.NUM6)
    keyDown(Key.NUM7)
    keyUp(Key.NUM7)
    keyUp(Key.ALT)
________

Try it with your browser (modify code to move to the text field), then look for the code you need for that symbol.

Revision history for this message
masuo (masuo-ohara) said :
#2

If you use Selenium API from Sikuli script, it will be able to enter strings.

The best way to implement Selenium in Sikuli is here.
https://answers.launchpad.net/sikuli/+question/404578

Can you help with this problem?

Provide an answer of your own, or ask yan ho ting for more information if necessary.

To post a message you must log in.