<commit_before>*** Settings ***
Suite Setup     Go To Page "links.html"
Resource        ../resource.txt

*** Test Cases ***
Assign Id To Element
    [Documentation]  Tests also Reload Page keyword.
    Page Should Not Contain Element  my id
    Assign ID to Element  xpath=//div[@id="first_div"]  my id
    Page Should Contain Element  my id
    Reload Page
    Page Should Not Contain Element  my id

Get Element Attribute
    ${id}=  Get Element Attribute  link=Link with id@id
    Should Be Equal  ${id}  some_id
    ${id}=  Get Element Attribute  dom=document.getElementsByTagName('a')[3]@id
    Should Be Equal  ${id}  some_id
    ${class}=  Get Element Attribute  second_div@class
    Should Be Equal  ${class}  Second Class

Get Matching XPath Count
    ${count}=  Get Matching XPath Count  //a
    Should Be Equal  ${count}  19
    ${count}=  Get Matching XPath Count  //div[@id="first_div"]/a
    Should Be Equal  ${count}  2

Get Horizontal Position
    ${pos}=  Get Horizontal Position  link=Link
    Should Be True  ${pos} > ${0}
    Run Keyword And Expect Error  Could not determine position for 'non-existent'  Get Horizontal Position  non-existent

Get Vertical Position
    ${pos}=  Get Vertical Position  link=Link
    Should Be True  ${pos} > ${0}
    Run Keyword And Expect Error  Could not determine position for 'non-existent'  Get Horizontal Position  non-existent
<commit_msg>added test for Keyword Highlight Element<commit_after>*** Settings ***
Suite Setup     Go To Page "links.html"
Resource        ../resource.txt

*** Test Cases ***
Assign Id To Element
    [Documentation]  Tests also Reload Page keyword.
    Page Should Not Contain Element  my id
    Assign ID to Element  xpath=//div[@id="first_div"]  my id
    Page Should Contain Element  my id
    Reload Page
    Page Should Not Contain Element  my id

Get Element Attribute
    ${id}=  Get Element Attribute  link=Link with id@id
    Should Be Equal  ${id}  some_id
    ${id}=  Get Element Attribute  dom=document.getElementsByTagName('a')[3]@id
    Should Be Equal  ${id}  some_id
    ${class}=  Get Element Attribute  second_div@class
    Should Be Equal  ${class}  Second Class

Get Matching XPath Count
    ${count}=  Get Matching XPath Count  //a
    Should Be Equal  ${count}  19
    ${count}=  Get Matching XPath Count  //div[@id="first_div"]/a
    Should Be Equal  ${count}  2

Get Horizontal Position
    ${pos}=  Get Horizontal Position  link=Link
    Should Be True  ${pos} > ${0}
    Run Keyword And Expect Error  Could not determine position for 'non-existent'  Get Horizontal Position  non-existent

Get Vertical Position
    ${pos}=  Get Vertical Position  link=Link
    Should Be True  ${pos} > ${0}
    Run Keyword And Expect Error  Could not determine position for 'non-existent'  Get Horizontal Position  non-existent
    
Highlight Element
    Highlight Element  link=Link
    Highlight Element  xpath=//div[@id="first_div"]
{'fraction_non_alphanumeric': 0.08799454297407913, 'fraction_numerical': 0.004092769440654843, 'mean_word_length': 3.202005730659026, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4316960', 'n_tokens_mistral': 880, 'n_tokens_neox': 840, 'n_words': 351}