Robot Framework-Locator not found-Ebay website

Question:

I am trying to make a small robot framework with e bay website but every time I get locator not found in my Click Element, I have tried everything even Sleep and Wait until Element is visible. My code is this one.

*** Settings ***
Documentation  Basic Search Functionality
Library  SeleniumLibrary
*** variables ***

*** Test Cases ***
Verify basic search functionality
    [documentation]  This test case verifies the basic search functionality
    [tags]  Functional

    Open Browser  http://www.ebay.com  chrome
    Maximize Browser Window
    Input Text  //*[@id="gh-ac"]  mobile
    Press Keys  //*[@id="gh-btn"]  [Return]
    Page Should Contain  results for mobile
    Sleep  10s
    Wait Until Element Is Visible  xpath=//* 
    [@id="nid-pZ5-4"]/button/span
    Click Element  xpath=//*[@id="nid-pZ5- 
    4"]/button/span
    Close Browser

The element is in the picture.
The element I am trying click it can be seen in the picture

Asked By: Albert Rmz

||

Answers:

This xpath

xpath=//*[@id="nid-pZ5-4"]/button/span 

does look correct. Since I could not locate any element in UI.

try this instead :

xpath = //span[text()='Condition']/ancestor::button
Answered By: cruisepandey
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.