Codeception: How to select drop down value

Created on 22 May 2014  路  2Comments  路  Source: Codeception/Codeception

Hi,

I am having issues selecting a value from a drop down.

div id="boundlist-1114-listEl" class="x-boundlist-list-ct x-unselectable" style="overflow: auto; height: auto;"
ul class="x-list-plain"
li class="x-boundlist-item" unselectable="on" role="option">License li class="x-boundlist-item" unselectable="on" role="option">Restriction /ul
/div

I am trying to select either License or Restriction but unsure on how to select this have tried these different ways so far:

  1. $I->click('Restriction', '[@id="boundlist-1114-listEl"]/ul/li[2]');
  2. $I->click('Restriction', '//_[@id="boundlist-1114-listEl"]/ul/li[2]');
  3. $I->click('//_[@id="boundlist-1114-listEl"]/ul/li[2]');
  4. $I->click('id("boundlist-1114-listEl")/ul/li[2]');
  5. $I->click("Restriction");

Any advise would be great. Thanks

Most helpful comment

$I->selectOption('.x-list-plain','Restriction'); //css path (untested), if you have a label just use this, see link
$I->click('Update'); //whatever your submit button is named

http://codeception.com/docs/04-AcceptanceTests#Forms

All 2 comments

$I->selectOption('.x-list-plain','Restriction'); //css path (untested), if you have a label just use this, see link
$I->click('Update'); //whatever your submit button is named

http://codeception.com/docs/04-AcceptanceTests#Forms

Hi Taxaos, Worked perfectly thanks for the quick reply!!

Was this page helpful?
0 / 5 - 0 ratings