How to use select list in selenium?

前端 未结 4 1971
说谎
说谎 2020-12-20 12:58

I\'m trying to select an element from a select list in selenium using java with WebDriver - based syntax.

I\'ve got the select list by

    elements =         


        
4条回答
  •  囚心锁ツ
    2020-12-20 13:53

    A little side note which applies to Java:

    In my case, when I was writing the test according the example of @nilesh, I got a strange error, that the constructor is invalid. My import was:

    import org.openqa.jetty.html.Select;
    

    If you happen to have similar errors, you have to correct that import to this:

    import org.openqa.selenium.support.ui.Select;
    

    If you use this second import, everything will work.

提交回复
热议问题