How to get option value of select element

后端 未结 6 1094
故里飘歌
故里飘歌 2021-01-03 23:40

I am trying to get the option value of a select element using Protractor. However, I\'m not able to find the option element.

HTML

&l         


        
6条回答
  •  不知归路
    2021-01-04 00:09

    ok again I have now been able to figure out how to grab the option element with protractor.

    the example code below shows how to accomplish this.

    ptor.findElement(protractor.By.css('select option:nth-child(value of the option you require IE: the number)')).click();
    

提交回复
热议问题