汪晓康

导航

RobotFramework两种下拉框选择

浏览器悬浮显示并选择
    open browser    https://tieba.baidu.com/    chrome
    maximize browser window
    add cookie    BDUSS    RzOVVQY09oaXAyeGFETTJIS3lXU2lUWk9iYTRUxjSmRIYmswZ3c2aDFsNFplRVFBQUFBJCQAAAAAAAAAAAEAAABEE-sk1Nm4x9K7wqUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHUKX151Cl9e
    add cookie    STOKEN    3c6363cb0bede0cfd3ab8126b256cd0b7700ad471e491ce0cc56a40f147f6995
    goto    https://tieba.baidu.com/
    mouse over    xpath=//li[@class="u_username"]
    mouse over    xpath=//li[@class="u_itieba"]/a
    mouse down    xpath=//li[@class="u_itieba"]/a
    mouse up    xpath=//li[@class="u_itieba"]/a

浏览器下拉框选择
    open browser    https://tieba.baidu.com/    chrome
    maximize browser window
    add cookie    BDUSS    RzOVVQY09oaXAyeGFETTJIS3lXU2lUWiYTBtRUxjSmRIYmswZ3c2aDFsNFplRVFBQUFBJCQAAAAAAAAAAAEAAABEE-sk1Nm4x9K7wqUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHUKX151Cl9e
    add cookie    STOKEN    3c6363cb0bede0cfd3ab8126b256cd0b7700ad471e491ce0cc56a40f147f6995
    goto    https://tieba.baidu.com/
    click button    xpath=//input[@name="kw1"]
    FOR    ${i}    IN RANGE    9
    \    log    ${i}
    \    Press Key    xpath=//input[@name="kw1"]    \ue015
    \    sleep    0.5
    Press Key    xpath=//input[@name="kw1"]    \\13

posted on 2021-08-09 23:25  汪晓康  阅读(386)  评论(0编辑  收藏  举报