Selenium click on link

后端 未结 3 1869
忘掉有多难
忘掉有多难 2021-01-18 10:28

I\'m using Selenium\'s IDE in FireFox to do some testing, and I want Selenium to click the second link (Text2). Any idea how I do that? Unfortunately I don\'t have access to

相关标签:
3条回答
  • 2021-01-18 10:54

    Selenium supports the link=Link Text locator as well. If you know the exact link text, you can use this locator, but not otherwise. So for your examples above: link=text2 or link=View Previous Statements. (See this site and this site for other locators.)

    0 讨论(0)
  • 2021-01-18 10:58

    You Can Try

    //a[contains(text(),'text2')]     OR  //span/a[contains(text(),'text2')]
    


    Looking for same or anything else?

    0 讨论(0)
  • 2021-01-18 11:03

    Please disregard this post. Selenium is ignoring the "Value" field and simply selecting the 1st occurrence of span.class3. Sorry about this. I should have tested more before posting.

    Original post: I have a similar webpage, and I was able to use the following Selenium IDE command: command: clickAndWait target: css=span.class3 value: Text1

    0 讨论(0)
提交回复
热议问题