Как выбрать опцию из выпадающего списка в IE, который не полностью предварительно загружен с VBA? - PullRequest
0 голосов
/ 16 января 2020

Я пытаюсь создать VBA macro, который будет автоматически выбирать элемент из раскрывающегося списка на веб-сайте. Несмотря на то, что опции в раскрывающемся списке имеют тег id, но не весь список равен preloaded, поэтому при жестком коде выбора идентификатора опции будет возникать ошибка.

[! [Enter описание изображения здесь] [1]] [1]

First pi c: это когда выпадающий список при первом нажатии (отображаются не все параметры)

[! [Введите описание изображения здесь] [2]] [2]

Второй пи c: после прокрутки раскрывающегося списка вниз, дополнительные параметры и их идентификаторы тегов отображаются!

Несмотря на то, что я знаю идентификатор тега последней опции в раскрывающемся меню, я не смог жестко выбрать его, потому что он does not exist на веб-странице до тех пор, пока раскрывающееся меню не прокрутится вниз и не отобразятся параметры.

Как я могу сделать это через VBA, чтобы отобразить все параметры?

Заранее спасибо ! :)

<!DOCTYPE html>
<html>
(head removed)

<body class="mainframe new-component-style" id="mainBody">
  <form name="form1" class="ng-pristine ng-valid" id="form1" onsubmit="doSubmit();return true;" action="/pagesUTF8/auftrag_allgemeinauftrag.jsp" method="post" accept-charset="utf-8">
    <div class="bgcContent" id="bg_site">
      <div id="bg_site_inner">
        <div class="ContentBox ContentBox2Spalten">
          <div class="ContentBoxContainer">
            <div>
              <table width="100%" id="AjaxCon35" aria-live="polite" style="border: 0px currentColor; border-image: none;" cellspacing="0" cellpadding="2">
                <tbody>
                  <tr>
                    <td style="padding: 0px;" colspan="4">
                      <div style="padding: 4px 0px; width: 100%; -ms-overflow-y: auto; max-height: 570px;">
                        <table style="width: 100%;">
                          <tbody>
                            <tr class="OutTabBodyBack_white" id="AjaxCon32" aria-live="polite">
                              <td class="OutTabBody_NoBorder">
                                <div class="component-group" style="width: 100%;">
                                  <div class="tagbox-wrapper ng-non-bindable">
                                    <div class="tagBox single-select" id="ATagBox10ASSPLJ" style="top: 431.69px; width: 258.02px; position: fixed; z-index: 9999;" name="ATagBox05ASSPLJ">
                                      <div class="tagBoxWrapper focus" id="ATagBox05ASSPLJ" name="ATagBox05ASSPLJ">
                                        <div class="selectWrapper" style="display: none;">
                                          <div>
                                            <select name="ASSPLJ" class="form-element ng-non-bindable" id="ASSPLJ">
                                              <option id="ATagBox07#ASSPLJ#1187" selected="selected" value="1187"></option>
                                            </select>
                                          </div>
                                        </div>
                                        <script type="text/javascript">
                                          /* <![CDATA[ */
                                          addToGwtFunctionQueue('initTagBox', ['ASSPLJ', {
                                            "noEntryFoundTxt": "No entries found",
                                            "stdTxt": "Please select",
                                            "isMultiSelect": false,
                                            "autoReturn": "DoAjaxProjekt(\"AjaxCon32\", \"ASSPLJ\", \"3\", \"2001906\");",
                                            "isOpenToTop": false
                                          }]);
                                          /* ]]> */
                                        </script>
                                        <div class="outerWrapper" style="width: 100%;">
                                          <div class="dropDownButtonContainer"><button class="dropDownButton" id="TagBoxDropDownASSPLJ" type="button"><span class="icon-arrow-down"></span></button></div>
                                          <div class="fakeSelect" id="ATagBox03ATagBox08ASSPLJ" style="width: 225px;">
                                            <div class="fakeSelectInnerWrapper active">
                                              <div title="Yin" class="tag-value ellipsis" id="ATagBox06#ASSPLJ#1187"><span>Yin</span></div>
                                              <div class="textBoxSearchWrapper"><input class="textBoxSearchWrapper" id="ATagBox01ASSPLJ" type="text" autocomplete="off"></div>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                      <div class="fakeDropDown" style="height: 400px; overflow: auto; display: block; position: absolute; -ms-overflow-y: scroll; -ms-zoom: 1;">
                                        <div style="position: relative; -ms-zoom: 1;">
                                          <div>
                                            <div class="tag" id="ATagBox02#ASSPLJ#1">
                                              <div class="ellipsis" style="padding-right: 2px; float: left;">John 1</div>
                                            </div>
                                            <div class="tag" id="ATagBox02#ASSPLJ#261">
                                              <div class="ellipsis" style="padding-right: 2px; float: left;">John 2</div>
                                            </div>
                                            <div class="tag" id="ATagBox02#ASSPLJ#385">
                                              <div class="ellipsis" style="padding-right: 2px; float: left;">John 3</div>
                                            </div>
                                            <div class="tag" id="ATagBox02#ASSPLJ#1045">
                                              <div class="ellipsis" style="padding-right: 2px; float: left;">John 4</div>
                                            </div>
                                            <div class="tag" id="ATagBox02#ASSPLJ#1032">
                                              <div class="ellipsis" style="padding-right: 2px; float: left;">John 5</div>
                                            </div>
                                            <div class="tag" id="ATagBox02#ASSPLJ#257">
                                              <div class="ellipsis" style="padding-right: 2px; float: left;">John 6a</div>
                                            </div>
                                            <div class="tag" id="ATagBox02#ASSPLJ#708">
                                              <div class="ellipsis" style="padding-right: 2px; float: left;">John 7</div>
                                            </div>
                                            <div class="tag" id="ATagBox02#ASSPLJ#1123">
                                              <div class="ellipsis" style="padding-right: 2px; float: left;">John 8</div>
                                            </div>
                                            <div class="tag" id="ATagBox02#ASSPLJ#4">
                                              <div class="ellipsis" style="padding-right: 2px; float: left;">John 9</div>
                                            </div>
                                            <div class="tag" id="ATagBox02#ASSPLJ#6">
                                              <div class="ellipsis" style="padding-right: 2px; float: left;">John 10</div>
                                            </div>
                                            <div class="tag" id="ATagBox02#ASSPLJ#10">
                                              <div class="ellipsis" style="padding-right: 2px; float: left;">John 11</div>
                                            </div>
                                            <div class="tag" id="ATagBox02#ASSPLJ#1034">
                                              <div class="ellipsis" style="padding-right: 2px; float: left;">John 12</div>
                                            </div>
                                            <div class="tag" id="ATagBox02#ASSPLJ#269">
                                              <div class="ellipsis" style="padding-right: 2px; float: left;">John 13</div>
                                            </div>
                                            <div class="tag" id="ATagBox02#ASSPLJ#9">
                                              <div class="ellipsis" style="padding-right: 2px; float: left;">John 14</div>
                                            </div>
                                            <div class="tag" id="ATagBox02#ASSPLJ#1049">
                                              <div class="ellipsis" style="padding-right: 2px; float: left;">John 15</div>
                                            </div>
                                            <div class="tag" id="ATagBox02#ASSPLJ#454">
                                              <div class="ellipsis" style="padding-right: 2px; float: left;">John 16</div>
                                            </div>
                                            <div class="tag" id="ATagBox02#ASSPLJ#706">
                                              <div class="ellipsis" style="padding-right: 2px; float: left;">John 17</div>
                                            </div>
                                            <div class="tag" id="ATagBox02#ASSPLJ#1175">
                                              <div class="ellipsis" style="padding-right: 2px; float: left;">John 18</div>
                                            </div>
                                            <div class="tag" id="ATagBox02#ASSPLJ#1037">
                                              <div class="ellipsis" style="padding-right: 2px; float: left;">John 19</div>
                                            </div>
                                            <div class="tag" id="ATagBox02#ASSPLJ#709">
                                              <div class="ellipsis" style="padding-right: 2px; float: left;">John 20</div>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                  <div tabindex="0" class="dropdown">
                                    <ul class="dropdown-menu" role="menu">
                                      <li role="presentation"><a role="menuitem" onclick="SelectTabelle('OSG021187');"><span>Go to details</span></a></li>
                                      <li role="presentation"><a role="menuitem" onclick="SelectTabelle('OSG352-1187');"><span>Send e-mail</span></a></li>
                                    </ul>
                                    <div class="btn-group new-componenent-style"><a class="btn btncol-secondary dropdown-toggle" aria-label="Options" data-tooltip="Options"><span class="icon-more"></span></a></div>
                                  </div>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
    </div>
  </form>
</body>

</html>
...