Robot Framework-找不到定位器-Ebay网站
Robot Framework-Locator not found-Ebay website
我正在尝试用 e bay 网站制作一个小型机器人框架,但每次我在我的 Click Element 中找不到定位器时,我已经尝试了所有方法,甚至 Sleep and Wait until Element is visible。我的代码是这个。
*** 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 I am trying click it can be seen in the picture
这个xpath
xpath=//*[@id="nid-pZ5-4"]/button/span
看起来确实正确。因为我无法在 UI.
中找到任何元素
试试这个:
xpath = //span[text()='Condition']/ancestor::button
我正在尝试用 e bay 网站制作一个小型机器人框架,但每次我在我的 Click Element 中找不到定位器时,我已经尝试了所有方法,甚至 Sleep and Wait until Element is visible。我的代码是这个。
*** 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 I am trying click it can be seen in the picture
这个xpath
xpath=//*[@id="nid-pZ5-4"]/button/span
看起来确实正确。因为我无法在 UI.
中找到任何元素试试这个:
xpath = //span[text()='Condition']/ancestor::button