Hello,
I am trying to select a value from a drop down list. Previously it worked very well but since the update of my CMS it no longer works.
There is a difference between the source code of the page seen by the browser and the source code that I retrieve via webviewer.
browser (edge)
HTML Code:
<select id="jform_catid" name="jform[catid]" required class="required">
<option value="2">XXXXXXXXX</option>
<option value="3">XXXXXXXXX</option>
<option value="9">XXXXXXXXX</option>
</select>
My old code that worked is:
Code:
WebView21.ExecuteScriptAsync("document.getElementById('jform_catid').value = '8';")
webviewer2 see :
HTML Code:
<joomla-field-fancy-select placeholder="- Catégorie -"><div class="choices" data-type="select-multiple" role="combobox" aria-autocomplete="list" aria-haspopup="true" aria-expanded="false">
<div class="choices__inner">
<select id="filter_category_id" name="filter[category_id][]" multiple="" onchange="this.form.submit();" class="choices__input" hidden="" tabindex="-1" data-choice="active"></select>
<div class="choices__list choices__list--multiple"></div>
<input type="text" class="choices__input choices__input--cloned" autocomplete="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" aria-label="- Catégorie -" placeholder="- Catégorie -" style="min-width: 14ch; width: 1ch;">
</div>
<div class="choices__list choices__list--dropdown" aria-expanded="false">
<div class="choices__list" aria-multiselectable="true" role="listbox"><div id="choices--filter_category_id-item-choice-1" class="choices__item choices__item--choice choices__item--selectable is-highlighted" role="option" data-choice="" data-id="1" data-value="2" data-select-text="Cliquer pour sélectionner" data-choice-selectable="" aria-selected="true">XXXXXXXXXXX</div>
<div id="choices--filter_category_id-item-choice-2" class="choices__item choices__item--choice choices__item--selectable" role="option" data-choice="" data-id="2" data-value="3" data-select-text="Cliquer pour sélectionner" data-choice-selectable="">XXXXXXXXXXX</div>
<div id="choices--filter_category_id-item-choice-3" class="choices__item choices__item--choice choices__item--selectable" role="option" data-choice="" data-id="3" data-value="9" data-select-text="Cliquer pour sélectionner" data-choice-selectable="">XXXXXXXXXXX</div></div></div></div>
</joomla-field-fancy-select>
I try this :
Code:
WebView21.ExecuteScriptAsync("document.getElementById('choices--filter_category_id-item-choice-3')[0].click();")
It does not work. I tried many solutions but nothing works
Thank you for your precious help