未找到Robot FrameworkLocator易趣网站

2024-09-26 23:26:45 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图用e-bay网站制作一个小型机器人框架,但每次我在我的点击元素中找不到定位器时,我都会尝试一切,甚至是睡觉,直到元素可见为止。我的代码是这个

*** 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


Tags: thebrowserid元素searchbasicbuttonelement

热门问题