自动将证书上传到Plesk(使用Selenium-IDE)不起作用。

huangapple go评论68阅读模式
英文:

Automate certificate uploads into Plesk (using Selenium-IDE) not working

问题

I would like to automate the uploading of renewed certificates into different Plesk environments, by setting up a Selenium-IDE script. All is working so far, except for the upload part of the script. I understand that I somehow need to send the file to the input field, but would not know how to target that input field without the id -- it has no id!

这里是要自动化上传更新的证书到不同的 Plesk 环境,通过设置一个 Selenium-IDE 脚本。到目前为止,一切都正常,除了脚本的上传部分。我理解我需要以某种方式将文件发送到 input 字段,但是不知道如何定位那个没有 idinput 字段!

This is what the page looks like; it is the middle "Upload .pem file" button that one would use to upload the file.

这是页面的样子;这是中间的 "上传 .pem 文件" 按钮,用于上传文件。

Maybe there is a way to target the accept=".pem" section, which is unique on the page.

也许有一种方法可以定位页面上唯一的 accept=".pem" 部分。

Clicking on the button records:
command: click target: css=.ext-sslit-certificate-dropzone .pul-button__inner > span > span

单击按钮记录:
命令:单击 目标:css=.ext-sslit-certificate-dropzone .pul-button__inner > span > span

Selecting my .pem file records:
command: type target: css=.ext-sslit-certificate-dropzone value: C:\fakepath\wildcard___my_domain_name.pem

选择我的 .pem 文件记录:
命令:输入 目标:css=.ext-sslit-certificate-dropzone 值:C:\fakepath\wildcard___my_domain_name.pem

But playing it back it is stuck and not inserting the text into the "browse to file window" of the file I selected.

但是播放回放时卡住了,没有将文本插入我选择的文件的 "浏览到文件窗口"。

The file gets posted to a URL:
https://plesk.cc:8443/modules/sslit/index.php/index/upload/

该文件被上传到一个 URL:
https://plesk.cc:8443/modules/sslit/index.php/index/upload/

I tried different things, but can't get it to work.

我尝试了不同的方法,但无法使其工作。

(And, why is my file location getting renamed with C:\fakepath\?)

(还有,为什么我的文件位置被重命名为 C:\fakepath\?)

英文:

I would like to automate the uploading of renewed certificates into different Plesk environments, by setting up a Selenium-IDE script. All is working so far, except for the upload part of the script. I understand that I somehow need to send the file to the input field, but would not know how to target that input field without the id -- it has no id!

This is what the page looks like; it is the middle "Upload .pem file" button that one would use to upload the file.

自动将证书上传到Plesk(使用Selenium-IDE)不起作用。

The code of the middle section "Upload .pem file" is:

<div class="ext-sslit-certificate-dropzone" style="position: relative;" multiply="false" aria-disabled="false">
  <button class="pul-button" type="button" data-test-id="ext-sslit__certificate-upload-button">
    <span class="pul-button__inner">
      <span>
        <span>Upload .pem file</span>
      </span>
    </span>
  </button>
  <input accept=".pem" type="file" 
    style="position: absolute; inset: 0px; opacity: 0.00001; pointer-events: none;" 
    multiple="" autocomplete="off">
</div>

Maybe there is a way to target the accept=".pem" section, which is unique on the page.

Clicking on the button records:

command: click 
target:  css=.ext-sslit-certificate-dropzone .pul-button__inner > span > span

Selecting my .pem file records:

command: type
target:  css=.ext-sslit-certificate-dropzone
value:   C:\fakepath\wildcard___my_domain_name.pem

But playing it back it is stuck and not inserting the text into the "brows to file window" of the file I selected.

The file gets posted to a URL:

https://plesk.cc:8443/modules/sslit/index.php/index/upload/

I tired different things, but can't get it to work.

(And, why is my file location getting renamed with C:\fakepath\?)

答案1

得分: 0

我发现UI.Vision提供了XType功能,但卡在那里就像之前一样; 我的UI.Vision支持论坛帖子链接 ...

我用UI.Vision让它工作了。

英文:

I found that UI.Vision offers XType functionality, but got stuck there just as much; link to my post on UI.Vision's support forum ...

I got it working using UI.Vision.

huangapple
  • 本文由 发表于 2023年5月25日 12:45:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/76329006.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定