ChromeFindElements can't figure out how to act on an element

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
toopnad
Junior Coder
Posts: 34
Joined: Mon Apr 12, 2021 10:10 am
Location: Russian Totalitarian Republic, Perm city

ChromeFindElements can't figure out how to act on an element

Post by toopnad » Wed Aug 11, 2021 12:16 pm

I am having difficulty how I can deploy advanced search on the site.
It looks like this:
when it is hidden
<nf-accordion-item no-fit="" label="Расширенный поиск" _size="small" style="padding-bottom: 0px;">
when deployed
<nf-accordion-item no-fit="" label="Расширенный поиск" _size="small" style="padding-bottom: 16px;" opened="">

how should I interact with this?
I need to expand a given item, initially it is collapsed
Thats full code

Code: Select all

<nf-accordion-item no-fit="" label="Расширенный поиск" _size="small" style="padding-bottom: 16px;" opened="">
                            <nf-layout no-fit="true" vertical="true" class=" layout vertical no-wrap start">
                                <nf-layout no-fit="true" class=" layout horizontal no-wrap start">
                                    <nf-filter-item field="nosology" operator="=">
                                        <nf-combonsi label="Нозология" nsi-code="1.2.643.5.1.13.13.99.2.641" size="medium"></nf-combonsi>
                                    </nf-filter-item>
                                    <nf-filter-item field="diagnosis_main" operator="=">
                                        <nf-combobox class="w100p" label="Диагноз" value-property="mkb" text-property="desease" drop-down-h-offset="-1" selected-index="-1" variant="vertical" size="medium"></nf-combobox>
                                    </nf-filter-item>
                                    <nf-filter-item field="diagnosis_complication" operator="=" null-string="null">
                                        <nf-combobox class="w100p" label="Осложнение основного диагноза" value-property="mkb" text-property="desease" variant="vertical" size="medium"></nf-combobox>
                                    </nf-filter-item>
                                    <nf-filter-item field="approved_date" operator=">=">
                                        <nf-datetime label="Установлен с" min-date="Sun Jan 01 1899 00:00:00 GMT+0230 (Moscow Standard Time)" class="datw" type="date" size="medium"></nf-datetime>
                                    </nf-filter-item>
                                    <nf-filter-item field="approved_date" operator="<=">
                                        <nf-datetime label="Установлен до" class="datw" type="date" size="medium"></nf-datetime>
                                    </nf-filter-item>
                                </nf-layout>
                                <nf-layout no-fit="true" class=" layout horizontal no-wrap start">
                                    <nf-filter-item field="created_on" operator="=">
                                        <nf-datetime max-date="Thu Dec 31 2099 00:00:00 GMT+0300 (Moscow Standard Time)" min-date="Sun Jan 01 1899 00:00:00 GMT+0230 (Moscow Standard Time)" label="Дата создания РЗ" class="datw" type="date" size="medium"></nf-datetime>
                                    </nf-filter-item>
                                    <nf-filter-item field="disease_outcome_date" operator="=">
                                        <nf-datetime max-date="Thu Dec 31 2099 00:00:00 GMT+0300 (Moscow Standard Time)" min-date="Sun Jan 01 1899 00:00:00 GMT+0230 (Moscow Standard Time)" label="Дата исключения " class="datw" type="date" size="medium"></nf-datetime>
                                    </nf-filter-item>
                                    <nf-filter-item field="stage_type" operator="=">
                                        <nf-combonsi label="Вид лечения" nsi-code="1.2.643.5.1.13.13.99.2.595" size="medium"></nf-combonsi>
                                    </nf-filter-item>
                                    <nf-filter-item field="on_treatment" operator="=">
                                        <nf-combobox value-property="id" label="Находится на лечении" variant="vertical" size="medium"></nf-combobox>
                                    </nf-filter-item>
                                    <nf-filter-item field="disease_outcome_filter" operator="=" cast="right-any">
                                        <nf-combonsi label="Исход заболевания" nsi-code="1.2.643.5.1.13.13.99.2.558" cache-key="disease_outcome" multi="true" size="medium"></nf-combonsi>
                                    </nf-filter-item>
                                </nf-layout>
                                <nf-layout no-fit="true" class=" layout horizontal no-wrap start">
                                    <nf-filter-item field="mo_regionid" operator="=" hidden="">
                                        <nf-combonsi label="Субъект РФ" nsi-code="1.2.643.5.1.13.13.99.2.206" size="medium"></nf-combonsi>
                                    </nf-filter-item>
                                    <nf-filter-item field="modeptid" operator="=" cast="right-any" hidden="">
                                        <nf-listbox-select label="Ведомственная принадлежность" text-property="full_name" value-property="id" multi="true" size="medium" hidden=""></nf-listbox-select>
                                    </nf-filter-item>
                                    <nf-filter-item field="mo" operator="=">
                                        <nf-mosearchinput show-count="15" label="Медицинская организация" tabindex="0" aria-disabled="false" hidden=""></nf-mosearchinput>
                                    </nf-filter-item>
                                    <nf-filter-item field="medical_worker" operator="=">
                                        <nf-combobox label="Медицинский работник" value-property="id" drop-down-h-offset="-1" selected-index="-1" variant="vertical" size="medium"></nf-combobox>
                                    </nf-filter-item>
                                </nf-layout>
                                <nf-layout no-fit="true" class=" layout horizontal no-wrap start">
                                    <nf-filter-item field="disease_severity" operator="=">
                                        <nf-combonsi label="Степень тяжести" nsi-code="1.2.643.5.1.13.13.11.1006" filter-method="filterDiseaseSeverity" size="medium"></nf-combonsi>
                                    </nf-filter-item>
                                    <nf-filter-item field="ivl" operator="=">
                                        <nf-combobox label="Пациент на ИВЛ" value-property="id" variant="vertical" size="medium"></nf-combobox>
                                    </nf-filter-item>
                                    <nf-filter-item field="ekmo" operator="=">
                                        <nf-combobox label="Пациент на ЭКМО" value-property="id" drop-down-h-offset="-1" selected-index="-1" variant="vertical" size="medium"></nf-combobox>
                                    </nf-filter-item>
                                    <nf-filter-item field="orit" operator="=">
                                        <nf-combobox label="Пациент размещен в ОРИТ" value-property="id" drop-down-h-offset="-1" selected-index="-1" variant="vertical" size="medium"></nf-combobox>
                                    </nf-filter-item>
                                </nf-layout>
                                <nf-layout no-fit="true" class=" layout horizontal no-wrap start">
                                    <nf-filter-item field="diagnosis_postmortem" operator="=">
                                        <nf-listbox-select label="Посмертный диагноз" text-property="caption" value-property="pathology" key-field="pathology" parent-field="pathology_parent" selectonlyleaf="true" size="medium"></nf-listbox-select>
                                    </nf-filter-item>
                                    <nf-filter-item>
                                        <nf-combobox value-property="id" label="ПАЗ" selected-index="-1" variant="vertical" size="medium"></nf-combobox>
                                    </nf-filter-item>
                                    <nf-filter-item field="epgu_status" operator="=">
                                        <nf-listbox-select label="Статус ЕПГУ" text-property="caption" value-property="id" key-field="pathology" size="medium"></nf-listbox-select>
                                    </nf-filter-item>
                                </nf-layout>
                                <nf-layout class=" layout horizontal no-wrap start fit">
                                    <nf-filter-item>
                                        <nf-combonsi label="Тип полиса" nsi-code="1.2.643.5.1.13.13.99.2.245" caption-field="polictype" selectonlyleaf="true" size="medium"></nf-combonsi>
                                    </nf-filter-item>
                                    <nf-filter-item>
                                        <nf-input label="Серия полиса" auto-validate="true" minlength="2" maxlength="6" tabindex="0" size="medium" aria-disabled="true" variant="vertical" disabled="" style="pointer-events: none;">
                                            <nf-input-mask scale="2" max-year="2099" min-year="1899" lazy="true"></nf-input-mask>
                                        </nf-input>
                                    </nf-filter-item>
                                    <nf-filter-item>
                                        <nf-input label="Номер полиса" auto-validate="true" tabindex="0" size="medium" aria-disabled="true" variant="vertical" disabled="" style="pointer-events: none;">
                                            <nf-input-mask scale="2" max-year="2099" min-year="1899" lazy="true"></nf-input-mask>
                                        </nf-input>
                                    </nf-filter-item>
                                    <nf-filter-item></nf-filter-item>
                                </nf-layout>
                                <nf-layout class=" layout horizontal no-wrap start fit">
                                    <nf-filter-item>
                                        <nf-combonsi label="Тип ДУЛ" nsi-code="1.2.643.5.1.13.13.99.2.48" caption-field="name" parent-field="parent_id" selectonlyleaf="true" size="medium"></nf-combonsi>
                                    </nf-filter-item>
                                    <nf-filter-item>
                                        <nf-input label="Серия ДУЛ" auto-validate="true" tabindex="0" size="medium" aria-disabled="true" variant="vertical" disabled="" style="pointer-events: none;">
                                            <nf-input-mask scale="2" max-year="2099" min-year="1899" lazy="true">
                                            </nf-input-mask>
                                        </nf-input>
                                    </nf-filter-item>
                                    <nf-filter-item>
                                        <nf-input label="Номер ДУЛ" auto-validate="true" tabindex="0" size="medium" aria-disabled="true" variant="vertical" disabled="" style="pointer-events: none;">
                                            <nf-input-mask scale="2" max-year="2099" min-year="1899" lazy="true"></nf-input-mask>
                                        </nf-input>
                                    </nf-filter-item>
                                    <nf-filter-item></nf-filter-item>
                                </nf-layout>
                            </nf-layout>
                        </nf-accordion-item>

User avatar
Grovkillen
Automation Wizard
Posts: 1009
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: ChromeFindElements can't figure out how to act on an element

Post by Grovkillen » Wed Aug 11, 2021 1:04 pm

Do you really need to expand the element? Usually you just interact with the forms directly. Only a human need to open up stuff, to a computer it doesn't matter if it's visually hidden.

So, take a step back and see if you really are addressing the real problem here.
Let>ME=%Script%

Running: 15.0.24
version history

toopnad
Junior Coder
Posts: 34
Joined: Mon Apr 12, 2021 10:10 am
Location: Russian Totalitarian Republic, Perm city

Re: ChromeFindElements can't figure out how to act on an element

Post by toopnad » Thu Aug 12, 2021 4:06 am

Thank you, I have little experience in this matter. Your comment helped a lot! I will try.

toopnad
Junior Coder
Posts: 34
Joined: Mon Apr 12, 2021 10:10 am
Location: Russian Totalitarian Republic, Perm city

Re: ChromeFindElements can't figure out how to act on an element

Post by toopnad » Thu Aug 12, 2021 4:25 am

P.S.
Okay, tell me how can I access this field and change its title? There it is done as a drop-down list. But I think that you can change the attributes.
<iron-input class = "input-element" id = "input-23">
<input id = "nativeInput" autocomplete = "off" placeholder = "" readonly = "" size = "medium" autocapitalize = "none" autocorrect = "off" aria-describedby = "" aria-labelledby = "" title = " Outpatient treatment ">
</iron-input>

User avatar
Grovkillen
Automation Wizard
Posts: 1009
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: ChromeFindElements can't figure out how to act on an element

Post by Grovkillen » Thu Aug 12, 2021 4:46 am

You set the value with element with id=nativeInput to what you want it to be.
Let>ME=%Script%

Running: 15.0.24
version history

toopnad
Junior Coder
Posts: 34
Joined: Mon Apr 12, 2021 10:10 am
Location: Russian Totalitarian Republic, Perm city

Re: ChromeFindElements can't figure out how to act on an element

Post by toopnad » Thu Aug 12, 2021 5:02 am

Can you write the code?
ChromeFindElements>session_id,id,input-23,elements

id = nativeInput there are a lot of elements with this id, how does it know which one it is referring to?
this is next field
<iron-input class="input-element" id="input-24">
<input id="nativeInput" autocomplete="off" placeholder="" size="medium" autocapitalize="none" autocorrect="off" aria-describedby="" aria-labelledby="">
</iron-input>

toopnad
Junior Coder
Posts: 34
Joined: Mon Apr 12, 2021 10:10 am
Location: Russian Totalitarian Republic, Perm city

Re: ChromeFindElements can't figure out how to act on an element

Post by toopnad » Thu Aug 12, 2021 6:05 am

I think I will need to use xpath and it is worth delving deeper into this topic to deal with my task. I am automating the registration of COVID patients. And in the future, it will be necessary to establish the transfer of data from one database to another. A very difficult and interesting project for my level.

User avatar
Grovkillen
Automation Wizard
Posts: 1009
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: ChromeFindElements can't figure out how to act on an element

Post by Grovkillen » Thu Aug 12, 2021 7:00 am

If I should write the code I need to have the website. If not it's just a guessing game.
Let>ME=%Script%

Running: 15.0.24
version history

toopnad
Junior Coder
Posts: 34
Joined: Mon Apr 12, 2021 10:10 am
Location: Russian Totalitarian Republic, Perm city

Re: ChromeFindElements can't figure out how to act on an element

Post by toopnad » Thu Aug 12, 2021 9:23 am

Unfortunately, this is not possible, this is the base of the Russian health care system. They'll jail me for this. I think I found something to read to move on.
https://www.mjtnet.com/blog/category/scripting/
https://www.w3schools.com/xml/xpath_intro.asp

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts