using System; using System.Drawing; using Arp.Prova.ImageLibrary; using Arp.Prova.CsvLib; using Arp.Prova.PlayLib; //このサンプルは、「Microsoft Edge」設定にある「[スタート]、[ホーム]、および[新規]タブ」で「これらのページを開く:」のURLを設定します。 // CodeClass public class CodeClass { public static int CodeStart() { // 新しいページに設定するURL // 設定したいURLに変更して実行してください。 string settingURL = "https://www.setrobo.jp"; /************************ここから設定の変更を行います************************/ //■ 「Microsoft Edge」を表示 PlayLib.ProcessStart("msedge.exe"); // 「Microsoft? Edge」画面を確認 if(PlayLib.WaitWindow("*Microsoft? Edge*", true, 60) == true) { //操作しやすいよう設定画面を最大化する if(PlayLib.Window("*Microsoft? Edge*").WaitUIControl("UIButton", "最大化", true, 10)) { PlayLib.Window("*Microsoft? Edge*").UIButton("最大化").Click(); PlayLib.Sleep(1000); } // 「設定-[スタート]、[ホーム]、および[新規]タブ」を開く // ※もし「UIEdit&1」で動かない場合、2→3と数値を変更しご確認ください。 PlayLib.Window("*Microsoft? Edge*").UIEdit("UIEdit&1").Input("{Ctrl_Down}A{Ctrl_Up}{Del}"); PlayLib.Sleep(1000); PlayLib.Window("*Microsoft? Edge*").UIEdit("UIEdit&1").Input("edge://settings/startHomeNTP{Enter}"); PlayLib.Sleep(1000); if(PlayLib.WaitWindow("設定*Microsoft? Edge", true, 60) == true) { /// ■「Microsoft Edge の起動時」を設定 // 「これらのページを開く:」を選択 PlayLib.Window("設定*Microsoft? Edge").UIRadioButton("これらのページを開く:").Click(); PlayLib.Sleep(1000); //「特定のページまたはページセットを開く」ラジオボタンが選択状態か確認する if(PlayLib.Window("設定*Microsoft? Edge").UIRadioButton("これらのページを開く:").Checked == 0) { //選択ができていなかった場合、ログを出力し、処理を終了する PlayLib.TestLogError("「これらのページを開く:」ラジオボタンが選択できませんでした"); return -1; } // 「新しいページを追加してください」をクリック PlayLib.Window("設定*Microsoft? Edge").UIButton("新しいページを追加してください").Click(); PlayLib.Sleep(1000); // 「URLを入力してください」にsettingURLを入力 PlayLib.Window("設定*Microsoft? Edge").Input(settingURL); PlayLib.Sleep(1000); // 「追加」ボタンをクリック PlayLib.Window("設定*Microsoft? Edge").UIButton("追加").Click(); PlayLib.Sleep(1000); //「設定 - Google Chrome」画面を閉じる PlayLib.Window("設定*Microsoft? Edge").Close(); } else //「"設定 - 個人 - Microsoft? Edge"」画面が開かなかった場合、ログを出力し、処理を終了する { PlayLib.TestLogError("「設定*Microsoft? Edge」画面が開きませんでした"); return -1; } } else { PlayLib.TestLog("「Microsoft? Edge」画面が開きませんでした"); return -1; } return 0; } }