0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[T-DASH] 偽証明書を使っているサイトを自動化する

Last updated at Posted at 2025-02-25

Outline

テスト環境では、偽証明書を使って開発する場合がある。
その場合、以下のように、ブラウザを起動すると警告が表示され、詳細設定で受け入れを行う必要がある。
テスト自動化では、これはうざい。

image.png

これを回避する

技術的情報

chromeでは起動オプションで証明書エラーを回避する方法などがある。
これらオプションを利用することで、自動化起動毎に警告は表示されなくなる。

参考

T-DASH 実装

カスタム動作

robotframework library
以下設定ファイルを browsercustom.yaml で保存する

@browsercustom.yaml
ACT-CAT-CUSTOM-6cb0946e-0fbc-4fe0-a2a9-ea40de045bf1:
  action_category_name: browser
  icon: ''
  color: '#ee7312'
  custom_data:
    file_name: Custom
    pip_list: []
    library_list:
    - SeleniumLibrary
    - String
  actions:
    ACT-CUSTOM-c4589bee-0905-4dbf-a335-000425dabc42:
      action_name: 警告をスキップしてchrome起動
      action_type: operation
      action_format: 警告を無視してchrome起動し、URL「設定値1」にアクセスする
      action_note: ''
      action_args:
      - value1
      action_def:
      - - ${chrome_options} =
        - Evaluate
        - selenium.webdriver.ChromeOptions()
      - - Call Method
        - ${chrome_options}
        - add_argument
        - --ignore-certificate-errors
      - - Call Method
        - ${chrome_options}
        - add_argument
        - --ignore-ssl-errors
      - - Call Method
        - ${chrome_options}
        - add_argument
        - --start-maximized
      - - 'Open Browser    '
        - ${value1}
        - browser=chrome
        - options=${chrome_options}

次に、browsercustom.yamlをT-DASHの動作定義 -> カスタム動作 -> カスタム動作をインポート にてインポートし、実際にインポートされた設定内容を開く

作られたカスタム動作を開くと、以下のような設定になっている。(特に手を加える必要はない)

image.png

テストケース

ブラウザ起動を、このカスタム動作で起動させる

image.png

テスト実行

偽証明書のサイトの環境がないため、検証できてませんが、普通のブラウザ起動と同様な動きになります。

image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?