0
votes

Unable to enter text in input box using robot framework because of the error "InvalidElementStateException: Message: invalid element state: Element must be user-editable in order to clear it."

Open Browser    https://outlook.live.com/owa/    chrome
Maximize Browser Window
sleep    5
Click Element    Xpath=/html/body/section/div/div[2]/div[2]/div/div
Input Text    Xpath=//[@id="i0281"]/div[1]/div/div[1]/div[2]/div/div/div[2]/div[2]/div/div[2]/div    [email protected]

how to fix this issue???

python2.7 version selenium 3.6.0

1
You're trying to input text on a div element, which by definition is not able to be edited - and that is what the error says. Check and fix your locator, it should end with inputTodor Minakov

1 Answers

-1
votes

Here, ID field is changing, so using absolute xpath will resolve this issue, here is my working code ...

    *** Settings ***
Library           Selenium2Library

*** Test Cases ***
RnD - Test1
    Open Browser    https://outlook.live.com/owa/    chrome
    Maximize Browser Window
    Wait Until Element Is Visible    Xpath=/html/body/section/div/div[2]/div[2]/div/div    10
    Click Element    Xpath=/html/body/section/div/div[2]/div[2]/div/div
    Wait Until Element Is Visible    xpath=//body/div[1]/form[1]/div[1]/div/div[1]/div[2]/div/div/div[2]/div[2]/div/input[1]
    Input Text    //body/div[1]/form[1]/div[1]/div/div[1]/div[2]/div/div/div[2]/div[2]/div/input[1]    [email protected]