【发布时间】:2021-10-25 03:59:15
【问题描述】:
我正在尝试使用 ebay 网站制作一个小型机器人框架,但每次我在 Click Element 中找不到定位器时,我都会尝试一切,甚至是睡眠并等待元素可见。我的代码就是这个。
*** 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
【问题讨论】:
标签: python xpath robotframework