-3

I am trying to click a button/element on a popup window using Selenium 2 Library in Robot framework, but I get an error.

This is the code:

Test Click Like
    Wait Until Page Contains Element    //iframe[@title="Facebook Social Plugin"]
    Select Frame    //iframe[@title="Facebook Social Plugin"]
    #Frame Should Contain    //*[@id="u_0_0"]/div/div/div[2]/div[1]/a/img[@src="https://www.facebook.com/rsrc.php/v1/yi/r/odA9sNLrE86.jpg"]
    Click Element    xpath=//*[@id='u_0_0']/div/div/div[3]/div[1]/div[2]/div/div[2]/div/div[2]/a[1]/em/*[@data-intl-translation="Thích"]
    Sleep    5s
    Capture Page Screenshot
    Wait Until Page Contains Element    xpath=//*[@id='u_0_0']/div/div/div[3]/div[1]/div[2]/div/div[2]/div/div[2]/a[1]/em/*[@data-intl-translation="Bỏ thích"]
    Sleep    5s
    Capture Page Screenshot

This is the error:

Error
ValueError: Element locator 'xpath=//*[@id='u_0_0']/div/div/div[3]/div[1]/div[2]/div/div[2]/div/div[2]/a[1]/em/*[@data-intl-translation="Thích"]' did not match any elements.

I have this HTML code:

<a href="#">
<em class="_4qba" data-intl-translation="Thích" data-intl-trid="">Thích</em>
</a>
Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685

1 Answers1

0

You have to select that pop-up window first for performing any actions on that opened pop-up window.

Lokman Liton
  • 58
  • 1
  • 8