html - Dynamically-populated <select> not populated during testing with Codeception -
i relatively new codeception , trying perform acceptance testing of form using , selenium webdriver firefox. form (available @ http://www.brighton-hove.gov.uk/content/parking-and-travel/parking/find-your-parking-zone ) consists of text box , auto-populated inserted dom in event input text box results in multiple matches; each field has submit button.
the issue experiencing that, when tested in firefox behaves expected , auto-populated in cases initial, textual search returns multiple matches (for example, entering brighton postcode, although particular scenario search 'brighton town hall, bartholomew square', returns 3 results). however, when attempting test via codeception (either running complete test or attempting each step via console), gets inserted dom never appears populated real results (the element contains being 'please select address...').
my test steps follows:
$i->amonurl('http://www.brighton-hove.gov.uk/content/parking-and-travel/parking/find-your-parking-zone'); $i->fillfield('enter postcode or house number , street','brighton town hall, bartholomew square'); // xpath used here form elements' 'id's, 'class'es , 'name's auto-generated (the 1 above happens have label). $i->click("//div[@id='achieveform']/form/div/div/div[1]/div[1]/div/div[3]/div/input[@type='submit' , @value='search'])"; // i've tried using 'submitform(...)' here, rather clicking button. // wait unnecessarily long amount of time in hope dropdown appears , populated... $i->waitforelement("//div[@id='achieveform']/form/div/div/div[1]/div[1]/div/div[7]/div/div[3]/div/div[1]/span/select", 5); // first option there... $i->seeelementindom("//div[@id='achieveform']/form/div/div/div[1]/div[1]/div/div[7]/div/div[3]/div/div[1]/span/select/option[1]"); // ...but doesn't have 4 options, expected. $i->seenumberofelements("//div[@id='achieveform']/form/div/div/div[1]/div[1]/div/div[7]/div/div[3]/div/div[1]/span/select/option", 4);
although test looking perform black-box next course of action attempt tracing form submissions , dom updates, though level of knowledge of underlying structure of system should not necessary. overlooking simple? pointers appreciated.
apologies, turns out wasn't codecepetion after all: issue partly backend logic behind search form (which doesn't seem comma) , partly due me not noticing behaviour empty dropdown did occur when performing same actions outside of codeception.
moderators: thread can closed/removed (as issue non-issue within context of codeception) now.
Comments
Post a Comment