<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ranorex機能 - テスト自動化ツール 『Ranorex』</title>
	<atom:link href="https://ranorex.techmatrix.jp/blog/category/ranorex-function/feed/" rel="self" type="application/rss+xml" />
	<link>https://ranorex.techmatrix.jp</link>
	<description>Windowsデスクトップ・Web・モバイルアプリ対応</description>
	<lastBuildDate>Tue, 27 Oct 2026 05:53:46 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>

<image>
	<url>https://ranorex.techmatrix.jp/wp-content/uploads/cropped-RNX-new_favicon-32x32.png</url>
	<title>Ranorex機能 - テスト自動化ツール 『Ranorex』</title>
	<link>https://ranorex.techmatrix.jp</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">212958218</site>	<item>
		<title>MESCIUS(旧GrapeCity)コンポーネントを使用したデスクトップアプリのテスト自動化</title>
		<link>https://ranorex.techmatrix.jp/blog/2026/10/05/mescius/</link>
		
		<dc:creator><![CDATA[Ranorex編集部]]></dc:creator>
		<pubDate>Mon, 05 Oct 2026 06:24:04 +0000</pubDate>
				<category><![CDATA[Ranorex機能]]></category>
		<category><![CDATA[ニュース]]></category>
		<category><![CDATA[事例・ソリューション]]></category>
		<guid isPermaLink="false">https://ranorex.techmatrix.jp/?p=32505</guid>

					<description><![CDATA[<p>MESCIUS（メシウス）社のコンポーネントは、多くのデスクトップおよびWebアプリケーションで採用されています。アプリケーションの品質維持にはUIテストが不可欠であり、その自動化には、利用するツールが対象のコンポーネン [&#8230;]</p>
<p>The post <a href="https://ranorex.techmatrix.jp/blog/2026/10/05/mescius/">MESCIUS(旧GrapeCity)コンポーネントを使用したデスクトップアプリのテスト自動化</a> first appeared on <a href="https://ranorex.techmatrix.jp">テスト自動化ツール 『Ranorex』</a>.</p>]]></description>
										<content:encoded><![CDATA[<div class="veu_autoEyeCatchBox"><img fetchpriority="high" decoding="async" width="724" height="483" src="https://ranorex.techmatrix.jp/wp-content/uploads/iStock-MESCIUS_アイキャッチ.jpg" class="attachment-large size-large wp-post-image" alt="" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/iStock-MESCIUS_アイキャッチ.jpg 724w, https://ranorex.techmatrix.jp/wp-content/uploads/iStock-MESCIUS_アイキャッチ-300x200.jpg 300w" sizes="(max-width: 724px) 100vw, 724px" /></div>
<p class="wp-block-paragraph"><a href="https://developer.mescius.jp/" title="">MESCIUS</a>（メシウス）社のコンポーネントは、多くのデスクトップおよびWebアプリケーションで採用されています。アプリケーションの品質維持にはUIテストが不可欠であり、その自動化には、利用するツールが対象のコンポーネントに対応していることが重要です。</p>



<p class="wp-block-paragraph">これまでRanorexは、一部のMESCIUS社コンポーネントの自動化に対応していましたが、このたびデスクトップアプリケーション向けの主要コンポーネントについても正式にサポートを開始しました。</p>



<p class="wp-block-paragraph">本記事では、新たにRanorexが対応した「SPREAD for Windows Forms」、「SPREAD for WPF」、「MultiRowPlus for Windows Forms」のテスト自動化についてご紹介します。</p>



<h2 class="wp-block-heading h2-blog"><strong>MESCIUSコンポーネントとは</strong></h2>



<p class="wp-block-paragraph">MESCIUSコンポーネントは、ソフトウェア開発者向けの高品質なUIコンポーネントおよびツール群で、特にスプレッドシート機能や明細書作成機能で広く利用されています。ここでは、Ranorexが新たにサポートした3つのデスクトップアプリ用のコンポーネントについて紹介します ※そのほかのコンポーネントや詳細情報については、MESCIUS社の<a href="https://developer.mescius.jp/products">Webサイト</a>をご参照ください。</p>



<h3 class="wp-block-heading"><strong>SPREAD for Windows Forms</strong></h3>



<p class="wp-block-paragraph">SPREAD for Windows Formsは、Windows Formsアプリ向けのスプレッドシートコンポーネントです。Windows Formsアプリに組み込むだけで、使いやすい表計算機能を簡単に実装できます。</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><img decoding="async" width="1024" height="546" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-183-1024x546.png" alt="" class="wp-image-32727" style="width:614px;height:auto" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-183-1024x546.png 1024w, https://ranorex.techmatrix.jp/wp-content/uploads/image-183-300x160.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/image-183-768x410.png 768w, https://ranorex.techmatrix.jp/wp-content/uploads/image-183.png 1042w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><strong>SPREAD for Windows Formsのサンプルイメージ</strong></figcaption></figure>
</div>


<h3 class="wp-block-heading"><strong>SPREAD for WPF</strong></h3>



<p class="wp-block-paragraph">SPREAD for WPFは、WPFアプリ向けのスプレッドシートコンポーネントで、WPF技術を活用した豊かな表現力と柔軟なカスタマイズ性を備えています。Windows Forms版に比べ、より細かなUI調整が可能です。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" width="1013" height="408" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-184.png" alt="" class="wp-image-32731" style="width:629px;height:auto" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-184.png 1013w, https://ranorex.techmatrix.jp/wp-content/uploads/image-184-300x121.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/image-184-768x309.png 768w" sizes="(max-width: 1013px) 100vw, 1013px" /><figcaption class="wp-element-caption"><strong>SPREAD for WPFのサンプルイメージ</strong></figcaption></figure>
</div>


<h3 class="wp-block-heading"><strong>MultiRowPlus for Windows Forms</strong></h3>



<p class="wp-block-paragraph">MultiRowPlus for Windows Formsは、Windows Formsアプリ向けのデータグリッドコンポーネントで、複数行にまたがるセル構成や複雑なレイアウトを自由に表現できる点が特徴です。Windows Forms標準のDataGridViewよりも柔軟で多彩なセルテンプレートを使うことができます。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="1017" height="597" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-185.png" alt="" class="wp-image-32734" style="width:628px;height:auto" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-185.png 1017w, https://ranorex.techmatrix.jp/wp-content/uploads/image-185-300x176.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/image-185-768x451.png 768w" sizes="(max-width: 1017px) 100vw, 1017px" /><figcaption class="wp-element-caption"><strong>MultiRowPlus for Windows Formsのサンプルイメージ</strong></figcaption></figure>
</div>


<div style="height:28px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="wp-block-paragraph">そのほか、帳票・レポート開発コンポーネント「<strong>ActiveReports</strong>」や入力支援コンポーネント「<strong>InputMan</strong>」、コンポーネントセット「<strong>ComponentOne</strong>」などがあります。デスクトップアプリだけでなく、Webアプリ用のコンポーネントもあります。</p>



<h2 class="wp-block-heading h2-blog"><strong>テスト自動化ツール「Ranorex」とは</strong></h2>



<p class="wp-block-paragraph">Ranorexで、MESCIUSコンポーネントを使用した<a href="https://ranorex.techmatrix.jp/desktop/" title="">デスクトップアプリ</a>のUIテストを自動化できます。アプリ改修時などにリグレッションテストを自動化することで、テスト工数を削減できます。また、人為的ミスも回避できるためシステムの品質も維持できます。</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="709" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-187-1024x709.png" alt="" class="wp-image-32773" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-187-1024x709.png 1024w, https://ranorex.techmatrix.jp/wp-content/uploads/image-187-300x208.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/image-187-768x532.png 768w, https://ranorex.techmatrix.jp/wp-content/uploads/image-187.png 1364w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"><strong>RanorexによるMESCIUSコンポーネントのテスト自動化</strong></figcaption></figure>
</div>


<p class="wp-block-paragraph">テスト操作をレコーディングすることで、簡単に自動化するための<a href="https://ranorex.techmatrix.jp/test-create/" title="">テストを作成</a>できます。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="902" height="571" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-186.png" alt="" class="wp-image-32759" style="width:657px;height:auto" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-186.png 902w, https://ranorex.techmatrix.jp/wp-content/uploads/image-186-300x190.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/image-186-768x486.png 768w" sizes="(max-width: 902px) 100vw, 902px" /><figcaption class="wp-element-caption"><strong>Ranorexのレコーディングによる自動テストの作成</strong></figcaption></figure>
</div>


<p class="wp-block-paragraph">Ranorexの特長などの製品紹介資料は以下からダウンロードいただけます。</p>



<div id=rx-banner_gray>
<a href="https://s.techmatrix.co.jp/form/RXdoc0003IND?k3ad=rx-blog_mescius" target="_blank" rel="noopener noreferrer">
  <img decoding="async" src="https://ranorex.techmatrix.jp/wp-content/uploads/Ranorex_popup-2504_930x100_html.png">
</a>
</div>



<div style="height:28px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="wp-block-paragraph">Ranorexは、14日間の体験版を無償でご利用いただけます。MESCIUSコンポーネントを使用したデスクトップアプリのUIテスト自動化を検討のお客様は、体験版をダウンロードしてご評価ください。</p>



<div style="height:28px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-group has-background" style="background-color:#f0f0f0"><div class="wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained">
<div style="height:9px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-text-align-center wp-block-paragraph">Ranorexは、14日間の体験版を無償でご利用いただけます。<br>体験版をダウンロードしてご評価ください。</p>



<div style="width: 500px; margin: 0 auto; text-align: center;"><a href="https://s.techmatrix.co.jp/form/RXtry0001IND?k3ad=rx-blog_mescius" class="btn btn_commonpages" target="_blank">Ranorex体験版のダウンロードはこちら<a></div>



<div style="height:8px" aria-hidden="true" class="wp-block-spacer"></div>
</div></div>



<div style="height:13px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading h2-blog"><strong>「Ranorex」によるMESCIUSコンポーネントを使用したデスクトップアプリのテスト自動化</strong></h2>



<p class="wp-block-paragraph">RanorexによるMESCIUSコンポーネントを使用したデスクトップアプリのテスト自動化については、ホワイトペーパーをご用意しています。ぜひ資料をダウンロードしてご確認ください。</p>



<div class="wp-block-group has-background" style="background-color:#f0f0f0"><div class="wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained">
<div style="height:9px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-text-align-center has-medium-font-size wp-block-paragraph"><strong>ホワイトペーパーは</strong><br><strong>以下からダウンロードください。</strong></p>



<p class="has-text-align-center wp-block-paragraph">※過去のホワイトペーパーもすべてダウンロードいただけます。</p>



<div style="width: 500px; margin: 0 auto; text-align: center;"><a href="https://s.techmatrix.co.jp/form/RXdoc0022TMX?k3ad=rx-blog_mescius" class="btn btn_commonpages" target="_blank">ホワイトペーパーのダウンロードはこちら<a></div>



<div style="height:8px" aria-hidden="true" class="wp-block-spacer"></div>
</div></div>



<div style="height:60px" aria-hidden="true" class="wp-block-spacer"></div><p>The post <a href="https://ranorex.techmatrix.jp/blog/2026/10/05/mescius/">MESCIUS(旧GrapeCity)コンポーネントを使用したデスクトップアプリのテスト自動化</a> first appeared on <a href="https://ranorex.techmatrix.jp">テスト自動化ツール 『Ranorex』</a>.</p>]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">32505</post-id>	</item>
		<item>
		<title>変更に強いRanoreXPathの設計方法</title>
		<link>https://ranorex.techmatrix.jp/blog/2026/09/09/ranorexpath_generate/</link>
		
		<dc:creator><![CDATA[Ranorex編集部]]></dc:creator>
		<pubDate>Wed, 09 Sep 2026 08:03:48 +0000</pubDate>
				<category><![CDATA[Ranorex機能]]></category>
		<category><![CDATA[ノウハウ]]></category>
		<guid isPermaLink="false">https://ranorex.techmatrix.jp/?p=32577</guid>

					<description><![CDATA[<p>※本記事は、RanoreXPathに関する基礎知識をお持ちの方向けの内容となります。※Ranorex ハンズオンセミナーを受講することで、RanoreXPathについて学習いただけます。 ブラウザー/Window OS/ [&#8230;]</p>
<p>The post <a href="https://ranorex.techmatrix.jp/blog/2026/09/09/ranorexpath_generate/">変更に強いRanoreXPathの設計方法</a> first appeared on <a href="https://ranorex.techmatrix.jp">テスト自動化ツール 『Ranorex』</a>.</p>]]></description>
										<content:encoded><![CDATA[<div class="veu_autoEyeCatchBox"><img loading="lazy" decoding="async" width="678" height="515" src="https://ranorex.techmatrix.jp/wp-content/uploads/iStock-自動テスト.jpg" class="attachment-large size-large wp-post-image" alt="" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/iStock-自動テスト.jpg 678w, https://ranorex.techmatrix.jp/wp-content/uploads/iStock-自動テスト-300x228.jpg 300w" sizes="(max-width: 678px) 100vw, 678px" /></div>
<p class="wp-block-paragraph"><em>※本記事は、RanoreXPathに関する基礎知識をお持ちの方向けの内容となります。</em><br><em>※Ranorex <a href="https://ranorex.techmatrix.jp/handson-details/" title="">ハンズオンセミナー</a>を受講することで、RanoreXPathについて学習いただけます。</em></p>



<p class="wp-block-paragraph">ブラウザー/Window OS/テスト対象アプリケーションのアップデートや、テスト対象アプリケーションの特性などにより、オブジェクト情報が意図せず変化しRanoreXPathの修正が必要となることで、メンテナンス工数が発生する場合があります。</p>



<p class="wp-block-paragraph">本記事では、RanoreXPathの変化にともなうメンテナンス工数を抑えるための、RanoreXPathの設計方法について説明します。</p>



<p class="wp-block-paragraph">本記事の最後に、RanoreXPathの設計方法に関する詳細資料を公開しておりますので、ダウンロードのうえ、是非ご活用ください。</p>



<h3 class="wp-block-heading"><strong>目次</strong></h3>



<ol class="wp-block-list">
<li>RanoreXPathに影響を与える主な要因</li>



<li>変更に強いRanoreXPath設計のポイント</li>



<li>メンテナンス工数を抑えるための方法</li>



<li>RanoreXPath設計の進め方と推奨設定</li>



<li>資料ダウンロードのご案内</li>
</ol>



<h3 class="wp-block-heading anchor" id="factor"><strong>RanoreXPathに影響を与える主な要因</strong></h3>



<p class="wp-block-paragraph">RanoreXPathは主に以下の要因で変化します。これらの要因をあらかじめ理解し、堅牢なRanoreXPathを設計することが重要です。</p>



<ul class="wp-block-list">
<li>ブラウザーのアップデート</li>



<li>Windows OSのアップデート</li>



<li>テスト対象アプリケーションのアップデート</li>



<li>動的な属性の使用</li>
</ul>



<h3 class="wp-block-heading anchor" id="point"><strong>変更に強いRanoreXPath設計のポイント</strong></h3>



<p class="wp-block-paragraph">RanoreXPathのメンテナンス工数を抑えるためには、さまざまな変更要因の影響を受けにくいパス設計をおこなうことが重要です。その対応として、以下の方法があります。</p>



<h4 class="wp-block-heading"><strong>1. 変更されにくい属性を使用する</strong></h4>



<p class="wp-block-paragraph">テスト対象アプリケーションのユーザーインターフェース（UI）は操作や開発によって変化しやすく、それにともない、RanoreXPath内の属性情報も変化する場合があります。RanoreXPath内の属性情報に、UI変化の影響を受けにくいものを使用することで、RanoreXPathの耐久性を向上させ、テストの安定性とメンテナンス効率の改善が期待されます。</p>



<p class="wp-block-paragraph">例として、以下のようなRanoreXPathにおいて、text属性に動的な値（<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-cyan-blue-color">img_w3bnz2p1t58q2xi0</mark>）が使用されている場合、変更されにくい他の属性を使用することで、RanoreXPathを堅牢にすることができます。</p>



<ul style="background-color:#f0f0f0" class="wp-block-list has-background">
<li><strong>変更前のRanoreXPath例：</strong><br><strong><strong><strong>/form[@controlname=&#8217;RxMainFrame&#8217;]/?/?/tabpage[@controlname=&#8217;RxTabDynamic&#8217;]/text[<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-cyan-blue-color">@text=&#8217;img_w3bnz2p1t58q2xi0&#8242;</mark>]</strong></strong></strong></li>
</ul>



<p class="wp-block-paragraph">対象のリポジトリアイテムのパスエディター画面のツリー要素から、対象の要素（<strong>text</strong>要素）を選択し、属性の編集画面の<strong>text</strong>属性のチェックを無効にし<strong>、controlname</strong>属性などの他の属性を有効にします。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="580" height="275" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-176.png" alt="" class="wp-image-32581" style="width:515px;height:auto" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-176.png 580w, https://ranorex.techmatrix.jp/wp-content/uploads/image-176-300x142.png 300w" sizes="(max-width: 580px) 100vw, 580px" /></figure>
</div>


<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained">
<ul style="background-color:#f0f0f0" class="wp-block-list has-background">
<li><strong>変更後のRanoreXPath例：</strong><br><strong><strong>/form[@controlname=&#8217;RxMainFrame&#8217;]/?/?/tabpage[@controlname=&#8217;RxTabDynamic&#8217;]/text[<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-cyan-blue-color">@controlname=&#8217;txtBoxID&#8217;</mark>]</strong></strong></li>
</ul>
</div></div>



<h4 class="wp-block-heading"><strong>2. 属性値を正規表現で指定する</strong></h4>



<p class="wp-block-paragraph">自動生成されたRanoreXPathの中に、特定の形式の動的な属性値が存在する場合は、その形式に合わせて属性値を正規表現で指定することが可能です。属性値が変わった場合も、設定した正規表現に一致することにより、対象の要素を認識することができます。</p>



<p class="wp-block-paragraph">例として、以下のようなRanoreXPathにおいて、text属性に特定の形式で変化する値（<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-cyan-blue-color">img_w3bnz2p1t58q2xi0</mark>）が使用されている場合、正規表現で指定することで、RanoreXPathを堅牢にすることができます。</p>



<ul style="background-color:#f0f0f0" class="wp-block-list has-background">
<li><strong>変更前のRanoreXPath例：</strong><br><strong>/form[@controlname=&#8217;RxMainFrame&#8217;]/?/?/tabpage[@controlname=&#8217;RxTabDynamic&#8217;]/text[<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-cyan-blue-color">@text=&#8217;img_w3bnz2p1t58q2xi0&#8242;</mark>]</strong></li>
</ul>



<p class="wp-block-paragraph">対象のリポジトリアイテムのパスエディター画面のツリーの要素から、対象の要素（<strong>text</strong>要素）を選択し、属性の編集画面の<strong>text</strong>属性の演算子を、<strong>～（Regex Match）</strong>に変更し、属性値を指定する入力フォームに正規表現を使用した値を（<strong>img_.*</strong>）を設定します。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="568" height="92" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-177.png" alt="" class="wp-image-32583" style="width:519px;height:auto" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-177.png 568w, https://ranorex.techmatrix.jp/wp-content/uploads/image-177-300x49.png 300w" sizes="(max-width: 568px) 100vw, 568px" /></figure>
</div>


<ul style="background-color:#f0f0f0" class="wp-block-list has-background">
<li><strong>変更後のRanoreXPath例：</strong><br><strong><strong>/form[@controlname=&#8217;RxMainFrame&#8217;]/?/?/tabpage[@controlname=&#8217;RxTabDynamic&#8217;]/text[<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-cyan-blue-color">@text=&#8217;img_.*&#8217;</mark>]</strong></strong></li>
</ul>



<h4 class="wp-block-heading"><strong>3. パス構造を簡略化する</strong></h4>



<p class="wp-block-paragraph">アプリケーションのアップデートにより画面に変更が加えられることで、ツリー構造が変わり、既存のRanoreXPathでオブジェクトを認識できなくなる場合があります。このような場合、ワイルドカード演算子を使用してパス構造を簡略化することで、パス構造の変更に柔軟に対応できます。</p>



<p class="wp-block-paragraph">例として、以下のようなRanoreXPathにおいて、Tabpage内の画面構成が今後変更される可能性がある場合は、<strong>//（any descendants）</strong>を使用することで、画面変更の影響を受けないRanoreXPathにすることができます。</p>



<ul class="wp-block-list">
<li><strong>アップデート前のアプリケーションとツリー構造例：</strong></li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="525" height="256" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-181.png" alt="" class="wp-image-32620" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-181.png 525w, https://ranorex.techmatrix.jp/wp-content/uploads/image-181-300x146.png 300w" sizes="(max-width: 525px) 100vw, 525px" /></figure>
</div>


<ul style="background-color:#f0f0f0" class="wp-block-list has-background">
<li><strong>変更前のRanoreXPath例：</strong><br><strong><strong>/form[@title=&#8217;〇〇アプリ&#8217;]/tabpage[@controlname=&#8217;HOME&#8217;]<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-cyan-blue-color">/</mark>button[@controltext=&#8217;ログイン&#8217;]</strong></strong></li>
</ul>



<ul class="wp-block-list">
<li><strong>アップデート後のアプリケーションとツリー構造例：</strong></li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="574" height="292" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-182.png" alt="" class="wp-image-32621" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-182.png 574w, https://ranorex.techmatrix.jp/wp-content/uploads/image-182-300x153.png 300w" sizes="(max-width: 574px) 100vw, 574px" /></figure>
</div>


<ul style="background-color:#f0f0f0" class="wp-block-list has-background">
<li><strong>変更後のRanoreXPath例：</strong><br><strong><strong><strong>/form[@title=&#8217;〇〇アプリ&#8217;]/tabpage[@controlname=&#8217;HOME&#8217;]<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-cyan-blue-color">//</mark>button[@controltext=&#8217;ログイン&#8217;]</strong></strong></strong></li>
</ul>



<h3 class="wp-block-heading anchor" id="method"><strong>メンテナンス工数を抑えるための方法</strong></h3>



<p class="wp-block-paragraph">RanoreXPathの自動生成に関する設定として、<strong>「速度と堅牢性の設定」</strong>と<strong>「重み付けルールの設定」</strong>があります。これらの設定は、RanoreXPathを生成する前に、テスト対象アプリケーションの特性や運用方針に応じてあらかじめ設定しておくことで、変更に強いRanoreXPathを生成しやすくなり、後から修正する工数を抑えることができます。</p>



<h4 class="wp-block-heading"><strong>1. 速度と堅牢性の設定</strong></h4>



<p class="wp-block-paragraph">テスト実行時におけるオブジェクトの認識の速さや、アプリケーションの画面の変更にともなうオブジェクトの認識の強さは、RanoreXPathの構造に大きく依存しますが、RanoreXPathは<strong>「速度」</strong>と<strong>「堅牢性（壊れにくさ）」</strong>の２つの軸を基にバランスを見て生成されます。</p>



<p class="wp-block-paragraph">どちらの設定に重点を置くかは、テスト対象アプリケーションの内部構造や改修頻度に合わせて調整する必要がありますが、テスト実行時にオブジェクト認識の速さに影響しない場合は、将来発生する可能性のあるメンテナンス工数を抑えるために、原則として<strong>「堅牢性」</strong>重視の設定をおこなうことを推奨します。</p>



<h4 class="wp-block-heading"><strong>2. 重み付けルールの設定</strong></h4>



<p class="wp-block-paragraph">Ranorexで自動生成されたRanoreXPathに使用される属性には、動的な情報が含まれる場合がありますが、テスト実行の度に属性値が変わることでオブジェクトが検出できずに失敗する場合があります。そのため、対象のオブジェクトのRanoreXPathを修正し、他のユニークな属性に変更するなどの修正が必要となります。</p>



<p class="wp-block-paragraph">RanoreXPathの生成時に、どの属性を使用するかは <strong>「重み付けルール」</strong>の設定で管理されます。重み付けルールでは、各属性に数値が設定されており、数値が高い属性から優先的に使用されます。</p>



<p class="wp-block-paragraph"><em>※各設定方法の詳細は、以下Blog記事の<strong>「<a href="https://ranorex.techmatrix.jp/blog/2021/11/05/ranorexpath_basic/" title="">RanoreXPathの生成条件</a>」</strong>または本記事でダウンロード可能な<strong>「<a href="https://ranorex.techmatrix.jp/wp-content/uploads/変更に強いRanoreXPathの設計方法.zip" target="_blank" rel="noopener" title="">RanoreXPathの設計方法に関する詳細資料</a>」</strong>をご参照ください。</em></p>



<figure class="wp-block-embed is-type-wp-embed is-provider-ranorex wp-block-embed-ranorex"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="d8xaf5Xzhz"><a href="https://ranorex.techmatrix.jp/blog/2021/11/05/ranorexpath_basic/">RanoreXPathの基本構造</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="&#8220;RanoreXPathの基本構造&#8221; &#8212; テスト自動化ツール 『Ranorex』" src="https://ranorex.techmatrix.jp/blog/2021/11/05/ranorexpath_basic/embed/#?secret=ralYpXtRwE#?secret=d8xaf5Xzhz" data-secret="d8xaf5Xzhz" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>



<h3 class="wp-block-heading anchor" id="setting"><strong>RanoreXPath設計の進め方と推奨設定</strong></h3>



<p class="wp-block-paragraph">RanoreXPathのメンテナンス工数を抑えるためには、変更に強いパス構造を理解したうえで、目的や状態に応じて適切な設計方法を選択することが重要です。以下では、RanoreXPath設計における基本的な進め方と、代表的なケースごとに推奨される設定について説明します。</p>



<h4 class="wp-block-heading"><strong>1. 基本的な進め方</strong></h4>



<h5 class="wp-block-heading"><strong>Step1. 変更に強いRanoreXPath構造を理解する</strong></h5>



<ul class="wp-block-list">
<li>RanoreXPathに影響を与える主な要因を理解する</li>



<li>変更に強い（メンテナンス工数を抑える）RanoreXPathの考え方を理解する</li>
</ul>



<h5 class="wp-block-heading"><strong>Step2. 変更に強いRanoreXPathを作成する</strong></h5>



<ul class="wp-block-list">
<li>変更されにくい属性を使用する</li>



<li>属性値を正規表現で指定する</li>



<li>パス構造を簡略化する</li>
</ul>



<h5 class="wp-block-heading"><strong>Step3. ケースに応じたRanoreXPathの生成設定をおこなう</strong></h5>



<ul class="wp-block-list">
<li>速度と堅牢性の設定をおこなう</li>



<li>重み付けルールの設定をおこなう</li>
</ul>



<h4 class="wp-block-heading"><strong>2. ケース別の推奨設定</strong></h4>



<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td class="has-text-align-center" data-align="center"><strong>ケース</strong></td><td class="has-text-align-center" data-align="center"><strong>推奨される設定</strong></td></tr><tr><td class="has-text-align-center" data-align="center">一部のテスト対象オブジェクトのRanoreXPathに動的な属性が使用されている場合</td><td class="has-text-align-center" data-align="center">変更されにくい属性をパスエディターから指定</td></tr><tr><td class="has-text-align-center" data-align="center">属性値の一部が特定の形式で変化する場合</td><td class="has-text-align-center" data-align="center">属性値を正規表現で指定</td></tr><tr><td class="has-text-align-center" data-align="center">一部のオブジェクトの階層構造が変更された/今後変更される可能性のある場合</td><td class="has-text-align-center" data-align="center">パス構造の簡略化</td></tr><tr><td class="has-text-align-center" data-align="center">テスト対象アプリケーションのアップデートにより、内部構造に変更が発生する可能性がある場合</td><td class="has-text-align-center" data-align="center">速度と堅牢性の設定（堅牢性重視型）</td></tr><tr><td class="has-text-align-center" data-align="center">ブラウザーやWindows OSのアップデート後に、テスト対象オブジェクトの認識が安定しない場合</td><td class="has-text-align-center" data-align="center">速度と堅牢性の設定（堅牢性重視型）</td></tr><tr><td class="has-text-align-center" data-align="center">オブジェクト認識速度の向上を優先したい場合</td><td class="has-text-align-center" data-align="center">速度と堅牢性の設定（速度重視型）</td></tr><tr><td class="has-text-align-center" data-align="center">複数のテスト対象オブジェクトのRanoreXPathに動的な属性が使用されている場合</td><td class="has-text-align-center" data-align="center">重み付けルールの設定</td></tr><tr><td class="has-text-align-center" data-align="center">テスト対象アプリケーションの特徴に応じて、特定の属性を優先的に使用したい場合</td><td class="has-text-align-center" data-align="center">特定の属性をパスエディターから指定<br>重み付けルールの設定</td></tr></tbody></table></figure>



<h4 class="wp-block-heading"><strong>3. まとめ</strong></h4>



<p class="wp-block-paragraph">メンテナンス工数を抑えるためには、アプリケーションの内部構造や生成されるRanoreXPathの特性を理解したうえで、どのような設定をおこなうかを検討することが重要です。</p>



<p class="wp-block-paragraph">すべてのテストケースを作成した後にRanoreXPathの設定やパスの修正をしようとすると、本来修正しなくても良いパスも修正することになり、メンテナンス工数が掛かります。初期段階で適切な設定をおこなうことで、将来的にパスを修正する工数も軽減されます。</p>



<h3 class="wp-block-heading anchor" id="download"><strong>資料ダウンロードのご案内</strong></h3>



<p class="wp-block-paragraph">本記事に関する、RanoreXPathの設計方法に関する詳細資料は、以下のリンクからダウンロード可能です。</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button aligncenter"><a class="wp-block-button__link wp-element-button" href="https://ranorex.techmatrix.jp/wp-content/uploads/変更に強いRanoreXPathの設計方法.zip" target="_blank" rel="noreferrer noopener">資料ダウンロード</a></div>
</div>



<p class="wp-block-paragraph"></p><p>The post <a href="https://ranorex.techmatrix.jp/blog/2026/09/09/ranorexpath_generate/">変更に強いRanoreXPathの設計方法</a> first appeared on <a href="https://ranorex.techmatrix.jp">テスト自動化ツール 『Ranorex』</a>.</p>]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">32577</post-id>	</item>
		<item>
		<title>環境差に対応した柔軟な画像比較 (Ranorex + OpenCV連携)</title>
		<link>https://ranorex.techmatrix.jp/blog/2026/08/17/opencv-imagevalidation/</link>
		
		<dc:creator><![CDATA[Ranorex編集部]]></dc:creator>
		<pubDate>Mon, 17 Aug 2026 00:00:00 +0000</pubDate>
				<category><![CDATA[Ranorex機能]]></category>
		<category><![CDATA[ツール連携]]></category>
		<guid isPermaLink="false">https://ranorex.techmatrix.jp/?p=32187</guid>

					<description><![CDATA[<p>テスト環境の違いにより、人の目では判別しにくい微細な差異が原因で画像検証が失敗するケースがあります。OSSツールであるOpenCVとRanorexを連携し、OpenCVの高度な画像検証アルゴリズムを活用することで、微細な [&#8230;]</p>
<p>The post <a href="https://ranorex.techmatrix.jp/blog/2026/08/17/opencv-imagevalidation/">環境差に対応した柔軟な画像比較 (Ranorex + OpenCV連携)</a> first appeared on <a href="https://ranorex.techmatrix.jp">テスト自動化ツール 『Ranorex』</a>.</p>]]></description>
										<content:encoded><![CDATA[<div class="veu_autoEyeCatchBox"><img loading="lazy" decoding="async" width="788" height="443" src="https://ranorex.techmatrix.jp/wp-content/uploads/iStock-OpenCV連携.jpg" class="attachment-large size-large wp-post-image" alt="" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/iStock-OpenCV連携.jpg 788w, https://ranorex.techmatrix.jp/wp-content/uploads/iStock-OpenCV連携-300x169.jpg 300w, https://ranorex.techmatrix.jp/wp-content/uploads/iStock-OpenCV連携-768x432.jpg 768w, https://ranorex.techmatrix.jp/wp-content/uploads/iStock-OpenCV連携-320x180.jpg 320w" sizes="(max-width: 788px) 100vw, 788px" /></div>
<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">テスト環境の違いにより、人の目では判別しにくい微細な差異が原因で画像検証が失敗するケースがあります。OSSツールであるOpenCVとRanorexを連携し、OpenCVの高度な画像検証アルゴリズムを活用することで、微細な差分を自動的に許容して検証成功と判定できることを確認しました。</p>



<p class="wp-block-paragraph">今回の記事では、RanorexとOpenCVを組み合わせた画像検証手法についてご紹介します。</p>



<h3 class="wp-block-heading"><strong>OpenCVとは</strong></h3>



<p class="wp-block-paragraph">OpenCV（Open Source Computer Vision Library）は、Intelが開発した画像処理・画像解析・コンピュータビジョン向けのオープンソースライブラリです。</p>



<p class="wp-block-paragraph">2,500以上の最適化されたアルゴリズムが含まれており、<strong>画像の読み込み</strong>、<strong>保存</strong>、<strong>リサイズ</strong>、<strong>回転</strong>、<strong>グレースケール化</strong>、<strong>ノイズ除去</strong>などの基本的な処理に加え、画像比較に使われる<strong>構造類似度指標</strong>（<strong>SSIM</strong>: Structural Similarity Index Measure）などの高度なアルゴリズムも備えています。</p>



<p class="wp-block-paragraph">SSIMは単純なピクセル差分ではなく、画像の明るさ、コントラスト、構造の類似性を評価し、<strong>人間の視覚に近い形で画像の差異を検出</strong>することができます。OpenCVはこのように幅広い画像処理機能に加え、高度な画像比較技術も提供しており、幅広い分野で利用されています。</p>



<p class="wp-block-paragraph">OpenCVの公式サイトは以下です。(2026年8月時点)<br><a href="https://opencv.org/" title="">https://opencv.org/</a></p>



<h3 class="wp-block-heading"><strong>RanorexとOpenCVの連携でできること</strong></h3>



<p class="wp-block-paragraph">Ranorexの画像検証機能は、ピクセル単位での厳密な比較で高精度な画像比較ができます。さらに、OpenCVと連携することで、OpenCVの<strong>構造類似度指標（SSIM）</strong>を用いたより高度な画像比較を利用できるようになります。この連携により、<strong>表示環境の違いによる微細な差分を柔軟に許容した画像検証が可能</strong>になります。</p>



<p class="wp-block-paragraph">たとえば、<strong>ブラウザーや実行環境の違いにより発生する文字やグラフィックのわずかなズレや揺れを自動検知・調整</strong>することで、<strong>人間の目では認識できない微細な差分を許容</strong>し<strong>、</strong>より実用的な判定をおこなうことができます。※画像の複雑さなどで対応できないケースもあります。</p>



<h3 class="wp-block-heading"><strong>RanorexとOpenCVの連携</strong></h3>



<p class="wp-block-paragraph">Ranorexは <strong>C# / .NET Framework</strong> ベースで動作するツールのため、C#用のオープンソースラッパーである OpenCvSharp を利用します。ここでは、弊社環境で検証した画像比較の設定をご紹介します。※2026年8月時点の情報です。</p>



<div style="height:19px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph"><strong>1.RanorexプロジェクトにOpenCvSarpを追加する</strong></p>



<p class="wp-block-paragraph">1.Ranorexのプロジェクトで、NuGet パッケージ マネージャーを開く。<br>メニューバー「プロジェクト」&gt;「パッケージの管理」</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="397" height="350" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-147.png" alt="" class="wp-image-32195" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-147.png 397w, https://ranorex.techmatrix.jp/wp-content/uploads/image-147-300x264.png 300w" sizes="(max-width: 397px) 100vw, 397px" /></figure>



<p class="wp-block-paragraph">2.検索ボックスに「OpenCvSharp」を入力し、<strong>OpenCvSharp core library</strong> と <strong>OpenCvSharp4 native bindings for Windows x64</strong> をプロジェクトにインストールする。</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" width="1024" height="324" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-148-1024x324.png" alt="" class="wp-image-32197" style="width:848px;height:auto" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-148-1024x324.png 1024w, https://ranorex.techmatrix.jp/wp-content/uploads/image-148-300x95.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/image-148-768x243.png 768w, https://ranorex.techmatrix.jp/wp-content/uploads/image-148.png 1376w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">※今回、ご紹介するユーザーコードでは <strong>StronglyTyped.PixelMatch.net</strong> のパッケージも利用しますので、追加が必要です。</p>



<div style="height:19px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph"><strong>2.ビルド対象（プラットフォームターゲット）を統一する</strong></p>



<p class="wp-block-paragraph">1.Ranorexのプロジェクトで、プロジェクトオプションを開く。<br>メニューバー <strong>プロジェクト</strong> &gt; <strong>パッケージの管理 </strong></p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="442" height="545" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-149.png" alt="" class="wp-image-32201" style="width:301px;height:auto" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-149.png 442w, https://ranorex.techmatrix.jp/wp-content/uploads/image-149-243x300.png 243w" sizes="(max-width: 442px) 100vw, 442px" /></figure>



<p class="wp-block-paragraph">2.ターゲットCPUをインストールしたOpenCsSharpのビット数に合わせる。上記でインストールしたパッケージは64bitのため、<strong>64-bit Intel-compatible processor</strong> に設定する。</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="972" height="533" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-150.png" alt="" class="wp-image-32204" style="width:777px;height:auto" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-150.png 972w, https://ranorex.techmatrix.jp/wp-content/uploads/image-150-300x165.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/image-150-768x421.png 768w" sizes="(max-width: 972px) 100vw, 972px" /></figure>



<div style="height:19px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph"><strong>3.期待画像のスクリーンショットを用意する</strong></p>



<p class="wp-block-paragraph">今回、ご紹介するユーザーコードでは、手動で取得したスクリーンショットを期待画像として設定できますので、期待画像をローカルマシンに保存ください。また、今回の画像形式はPNGにしています。</p>



<div style="height:19px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph"><strong>4.TMX提供のオートメーションヘルパーの「ReportPageScreenshot」でスクリーンショットの取得アクションを追加する</strong></p>



<p class="wp-block-paragraph"><strong><a href="https://ranorex.techmatrix.jp/blog/2026/06/12/tmx_automation_helpers_reportpagescreenshot/" title="">TMX Automation Helpers リファレンス６：スクリーンショットの出力</a></strong>をご参照ください。<br>アクションを追加すると以下のような設定ができます。画像ファイルは <strong>モジュール名_yyyyMMdd_HHmm_出力画像ファイル名.png</strong> の名前で出力されます。</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="908" height="54" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-162.png" alt="" class="wp-image-32277" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-162.png 908w, https://ranorex.techmatrix.jp/wp-content/uploads/image-162-300x18.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/image-162-768x46.png 768w" sizes="(max-width: 908px) 100vw, 908px" /></figure>



<div style="height:19px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph"><strong>5.OpenCVを利用して、期待画像と実行時に取得した画像を比較するコードを記述する</strong></p>



<p class="wp-block-paragraph">1.ユーザーコードコレクションをプロジェクトに追加する</p>



<p class="wp-block-paragraph">追加方法やメソッドの作成についての詳細は<strong><a href="https://ranorex.techmatrix.jp/blog/2020/06/19/creating-tests-using-source-code_user-code-collection/" title="">ソースコードを使用したテスト作成 / ユーザーコードコレクション</a></strong>をご参照ください。</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="376" height="117" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-163.png" alt="" class="wp-image-32282" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-163.png 376w, https://ranorex.techmatrix.jp/wp-content/uploads/image-163-300x93.png 300w" sizes="(max-width: 376px) 100vw, 376px" /></figure>



<p class="wp-block-paragraph">2.作成されたユーザーコードコレクションファイルに使用するパッケージを追加する</p>



<pre class="wp-block-code"><code>using System.IO;
using OpenCvSharp;         
using OpenCvSharp.Quality; </code></pre>



<p class="wp-block-paragraph">3.クラスに以下のメソッドを記述する</p>



<div style="background-color: #272822; color: #f8f8f2; padding: 15px; border-radius: 8px;
            max-height: 500px; overflow-x: auto; overflow-y: auto; white-space: pre; font-size: 14px; line-height: 1.5;">
  <code style="color: #f8f8f2;">
//取得したスクリーンショットの検索メソッド
private static string FindExistingImagePath(string currentImgDirPath, string mdName, string currentImgName, System.DateTime baseTime)
{
    int[] offsets = { -1, 0, 1 };  // ここでoffsetsを定義

    foreach (int offset in offsets)
    {
        System.DateTime checkTime = baseTime.AddMinutes(offset);
        string nowTimeStr = checkTime.ToString("yyyyMMdd_HHmm");
        string candidateFileName = $"{mdName}_{nowTimeStr}_{currentImgName}.png";
        string candidatePath = Path.Combine(currentImgDirPath, candidateFileName);

        if (File.Exists(candidatePath))
        {
            Report.Info($"存在する画像ファイルを発見: {candidatePath}");
            return candidatePath;
        }
    }
    return null;
}

//OpenCVを利用したSSIMによる画像検証メソッド
public static bool CompareImageBySSIM(string baseImgPath, string currentImgDirPath, string currentImgName, double ssimThreshold = 0.95)
{
    var curModule = TestModuleLeaf.Current;
    string mdName = curModule.Name;
    System.DateTime datetime = System.DateTime.Now;

    string currentImgPath = FindExistingImagePath(currentImgDirPath, mdName, currentImgName, datetime);
    if (currentImgPath == null)
    {
        Report.Error("±1分差のファイルが見つかりませんでした。ファイル名やディレクトリを確認してください。");
        return false;
    }

    using (Mat mat1Gray = Cv2.ImRead(baseImgPath, ImreadModes.Grayscale))
    using (Mat mat2Gray = Cv2.ImRead(currentImgPath, ImreadModes.Grayscale))
    {
        if (mat1Gray.Empty() || mat2Gray.Empty())
        {
            Report.Error("画像の読み込みに失敗しました。ファイルパスを確認してください。");
            return false;
        }

        // 背景（白）ではない「文字が存在する最小の四角枠」を自動検出
        Rect textRegion;
        using (Mat inverted = new Mat())
        {
            Cv2.Threshold(mat1Gray, inverted, 250, 255, ThresholdTypes.BinaryInv);
            textRegion = Cv2.BoundingRect(inverted);
        }

        if (textRegion.Width == 0 || textRegion.Height == 0)
        {
            textRegion = new Rect(0, 0, mat1Gray.Width, mat1Gray.Height);
        }
        else
        {
            textRegion.X = Math.Max(0, textRegion.X - 20);
            textRegion.Y = Math.Max(0, textRegion.Y - 20);
            textRegion.Width = Math.Min(mat1Gray.Width - textRegion.X, textRegion.Width + 40);
            textRegion.Height = Math.Min(mat1Gray.Height - textRegion.Y, textRegion.Height + 40);
        }

        // 割り出した「文字エリア」をテンプレート画像として切り出す
        using (Mat templateMat = new Mat(mat1Gray, textRegion))
        using (Mat matchResult = new Mat())
        {
            Cv2.MatchTemplate(mat2Gray, templateMat, matchResult, TemplateMatchModes.CCoeffNormed);
            Cv2.MinMaxLoc(matchResult, out _, out _, out _, out OpenCvSharp.Point maxLoc);

            float shiftX = textRegion.X - maxLoc.X;
            float shiftY = textRegion.Y - maxLoc.Y;

            Report.Info($"[位置補正自動計算] 検出された文字エリアのズレ -&gt; X方向: {shiftX}px, Y方向: {shiftY}px");

            // アフィン変換行列を作成してテスト対象画像を全体シフト
            using (Mat translationMatrix = new Mat(2, 3, MatType.CV_32FC1))
            {
                translationMatrix.Set&lt;float&gt;(0, 0, 1.0f);
                translationMatrix.Set&lt;float&gt;(0, 1, 0.0f);
                translationMatrix.Set&lt;float&gt;(0, 2, shiftX);
                translationMatrix.Set&lt;float&gt;(1, 0, 0.0f);
                translationMatrix.Set&lt;float&gt;(1, 1, 1.0f);
                translationMatrix.Set&lt;float&gt;(1, 2, shiftY);

                using (Mat resizedMat2AlignedAll = new Mat())
                {
                    OpenCvSharp.Size baseSize = mat1Gray.Size();
                    Cv2.WarpAffine(mat2Gray, resizedMat2AlignedAll, translationMatrix, baseSize);

                    // 文字エリア（ROI）を切り出す
                    using (Mat roiBaseRaw = new Mat(mat1Gray, textRegion))
                    using (Mat roiTargetAlignedRaw = new Mat(resizedMat2AlignedAll, textRegion))
                    {
                        // --- 【修正】二値化＋モルフォロジー演算でエッジのガタつきを平滑化 ---
                        using (Mat binBase = new Mat())
                        using (Mat binTarget = new Mat())
                        using (Mat roiBase = new Mat())
                        using (Mat roiTargetAligned = new Mat())
                        {
                            // 固定値（200）で一律二値化し、判定基準のブレを無くす
                            Cv2.Threshold(roiBaseRaw, binBase, 200, 255, ThresholdTypes.Binary);
                            Cv2.Threshold(roiTargetAlignedRaw, binTarget, 200, 255, ThresholdTypes.Binary);

                            // 3x3の構造要素（カーネル）を作成
                            using (Mat kernel = Cv2.GetStructuringElement(MorphShapes.Rect, new OpenCvSharp.Size(3, 3)))
                            {
                                // クロージング処理（文字のフチの微細なギザギザ・ノイズを埋めて滑らかにする）
                                Cv2.MorphologyEx(binBase, roiBase, MorphTypes.Close, kernel);
                                Cv2.MorphologyEx(binTarget, roiTargetAligned, MorphTypes.Close, kernel);
                            }

                            // 平滑化された画像同士でSSIMを計算
                            using (var ssimCalc = QualitySSIM.Create(roiBase))
                            {
                                Scalar score = ssimCalc.Compute(roiTargetAligned);
                                double meanSSIM = score.Val0;

                                Report.Info($"[SSIM判定] エッジ平滑化後のスコア: {meanSSIM:F4} (閾値: {ssimThreshold})");

                                // 差分画像の保存処理
                                try
                                {
                                    using (Mat diffMat = new Mat())
                                    {
                                        Cv2.Absdiff(roiBase, roiTargetAligned, diffMat);
                                        using (Mat threshDiff = new Mat())
                                        {
                                            Cv2.Threshold(diffMat, threshDiff, 1, 255, ThresholdTypes.Binary);
                                            using (Mat highlightMat = new Mat())
                                            {
                                                Cv2.CvtColor(roiTargetAlignedRaw, highlightMat, ColorConversionCodes.GRAY2BGR);
                                                highlightMat.SetTo(new Scalar(0, 0, 255), threshDiff);

                                                string directory = Path.GetDirectoryName(currentImgPath);
                                                string filename = Path.GetFileNameWithoutExtension(currentImgPath);
                                                string diffImgPath = Path.Combine(directory, filename + "_diff.png");

                                                Cv2.ImWrite(diffImgPath, highlightMat);
                                                Report.Info($"差分画像を保存しました: {diffImgPath}");
                                            }
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    Report.Warn($"差分画像の生成中にエラーが発生しました: {ex.Message}");
                                }

                                if (meanSSIM &gt;= ssimThreshold)
                                {
                                    Report.Success("文字の位置ズレ、滲み、微細なガタつきはすべて許容されました。");
                                    return true;
                                }
                                else
                                {
                                    Report.Failure("形状平滑化後もスコアが低いため、文字の欠落やレイアウト崩れが発生しています。");
                                    return false;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
  </code>
</div>



<div style="height:19px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="wp-block-paragraph">記述内容：</p>



<ul class="wp-block-list">
<li>文字が存在する領域（最小の四角枠）を自動検出</li>



<li>文字領域をテンプレートして、文字領域の位置ズレを補正</li>



<li>文字領域のクロージング処理で文字の輪郭の微細なギザギザやノイズを滑らかに補正</li>



<li>SSIM（構造類似度指数）を用いた画像比較</li>



<li>2つの画像の異なる箇所を赤色でハイライトした差分画像を保存</li>
</ul>



<p class="wp-block-paragraph">4.手順3で作成したメソッドを使ったユーザーコードアクションを「ReportPageScreenshot」メソッドのユーザーコードアクションの次に追加する</p>



<ul class="wp-block-list">
<li>レコーディングモジュールの <strong>新しいアクションの追加</strong> のプルダウンメニューから、<strong>ユーザーコード（User code）</strong>‐<strong>ライブラリから選択</strong>を選択します。</li>
</ul>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="792" height="246" src="https://ranorex.techmatrix.jp/wp-content/uploads/2020/04/図6.png" alt="" class="wp-image-4073" style="width:512px;height:auto" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/2020/04/図6.png 792w, https://ranorex.techmatrix.jp/wp-content/uploads/2020/04/図6-300x93.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/2020/04/図6-768x239.png 768w" sizes="(max-width: 792px) 100vw, 792px" /></figure>



<ul class="wp-block-list">
<li>以下の <strong>CompareImageBySSIM</strong> メソッドを選択します。</li>
</ul>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="834" height="170" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-166.png" alt="" class="wp-image-32319" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-166.png 834w, https://ranorex.techmatrix.jp/wp-content/uploads/image-166-300x61.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/image-166-768x157.png 768w" sizes="(max-width: 834px) 100vw, 834px" /></figure>



<p class="wp-block-paragraph">アクションを追加すると以下のような設定ができます。閾値は1に近い数値を設定することで、人の目では分からない微差のみを成功とできます。<br>※0.98以下になると人の目でも認識できる差分が成功となるケースがあります。</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="921" height="83" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-165.png" alt="" class="wp-image-32316" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-165.png 921w, https://ranorex.techmatrix.jp/wp-content/uploads/image-165-300x27.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/image-165-768x69.png 768w" sizes="(max-width: 921px) 100vw, 921px" /></figure>



<h3 class="wp-block-heading"><strong>検証結果</strong></h3>



<p class="has-medium-font-size wp-block-paragraph"><strong>検証対象の画像</strong></p>



<p class="wp-block-paragraph">環境の違いにより、全体的な文字ズレと文字の滲み・ギザギザ感が発生している画像を検証対象とします。たとえば、Chromeブラウザーで取得した期待画像を設定しており、テスト実行環境ではEdge Chromiumブラウザーでテストするケースなど。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="421" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-167-1024x421.png" alt="" class="wp-image-32340" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-167-1024x421.png 1024w, https://ranorex.techmatrix.jp/wp-content/uploads/image-167-300x123.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/image-167-768x315.png 768w, https://ranorex.techmatrix.jp/wp-content/uploads/image-167-1536x631.png 1536w, https://ranorex.techmatrix.jp/wp-content/uploads/image-167.png 1709w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="792" height="725" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-168.png" alt="" class="wp-image-32423" style="width:416px;height:auto" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-168.png 792w, https://ranorex.techmatrix.jp/wp-content/uploads/image-168-300x275.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/image-168-768x703.png 768w" sizes="(max-width: 792px) 100vw, 792px" /></figure>
</div>


<div style="height:19px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph"><strong>検証結果レポート</strong></p>



<p class="wp-block-paragraph">文字の位置ズレや微細なガタつきを自動検出して、画像検証された結果、スコアは1で完全に一致と判定され、画像検証は成功しました。</p>



<p class="wp-block-paragraph"><strong>成功パターン</strong></p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" width="1024" height="538" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-172-1024x538.png" alt="" class="wp-image-32418" style="width:930px;height:auto" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-172-1024x538.png 1024w, https://ranorex.techmatrix.jp/wp-content/uploads/image-172-300x158.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/image-172-768x404.png 768w, https://ranorex.techmatrix.jp/wp-content/uploads/image-172.png 1499w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">人の目でも認識できる差分がある場合は、画像検証が失敗します。</p>



<p class="wp-block-paragraph"><strong>失敗パターン</strong></p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" width="1024" height="681" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-171-1024x681.png" alt="" class="wp-image-32415" style="width:935px;height:auto" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-171-1024x681.png 1024w, https://ranorex.techmatrix.jp/wp-content/uploads/image-171-300x199.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/image-171-768x511.png 768w, https://ranorex.techmatrix.jp/wp-content/uploads/image-171.png 1382w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">差分画像は出力先(currentImgDirPath)に保存されます。</p>



<p class="wp-block-paragraph"><strong>差分画像</strong></p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="760" height="453" src="https://ranorex.techmatrix.jp/wp-content/uploads/Recording1_20260813_1558_実際の画像_diff.png" alt="" class="wp-image-32412" style="width:589px;height:auto" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/Recording1_20260813_1558_実際の画像_diff.png 760w, https://ranorex.techmatrix.jp/wp-content/uploads/Recording1_20260813_1558_実際の画像_diff-300x179.png 300w" sizes="(max-width: 760px) 100vw, 760px" /></figure>



<div style="height:19px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph"><strong>サンプルソリューション</strong></p>



<p class="wp-block-paragraph">本検証ができるサンプルソリューションは、以下のボタンからダウンロードできます。<br>※ダウンロードが始まらない場合は、Edgeブラウザーでお試しください。</p>



<div class="wp-block-file"><a id="wp-block-file--media-160afd91-6602-4015-8483-dc2ad511bcbb" href="https://ranorex.techmatrix.jp/wp-content/uploads/画像検証_OpenCV連携.zip">画像検証_OpenCV連携ソリューション</a><a href="https://ranorex.techmatrix.jp/wp-content/uploads/画像検証_OpenCV連携.zip" class="wp-block-file__button wp-element-button" download aria-describedby="wp-block-file--media-160afd91-6602-4015-8483-dc2ad511bcbb">ダウンロード</a></div>



<h3 class="wp-block-heading"><strong>まとめ</strong></h3>



<p class="wp-block-paragraph">Ranorexの画像検証機能は、ピクセル単位での厳密な比較で高精度な画像比較ができます。さらに、OpenCVと連携することで、OpenCVの<strong>構造類似度指標（SSIM）</strong>を用いたより高度な画像比較を利用できるようになり、人の目では判別しづらい微細な文字のズレやガタつきを補正し、許容範囲として正確に判定できます。</p>



<p class="wp-block-paragraph">今回ご紹介したコードのように、お客様ご自身でOpenCVと連携したカスタム画像検証を実装することで、より実用的で柔軟な画像比較が可能になります。ぜひOpenCVの強力なアルゴリズムを活用し、お客様のニーズに合った画像検証環境を構築ください。</p><p>The post <a href="https://ranorex.techmatrix.jp/blog/2026/08/17/opencv-imagevalidation/">環境差に対応した柔軟な画像比較 (Ranorex + OpenCV連携)</a> first appeared on <a href="https://ranorex.techmatrix.jp">テスト自動化ツール 『Ranorex』</a>.</p>]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">32187</post-id>	</item>
		<item>
		<title>iOS 証明書・プロビジョニングプロファイルの作成手順</title>
		<link>https://ranorex.techmatrix.jp/blog/2026/06/19/ios_certificate/</link>
		
		<dc:creator><![CDATA[Ranorex編集部]]></dc:creator>
		<pubDate>Thu, 18 Jun 2026 23:44:14 +0000</pubDate>
				<category><![CDATA[Ranorex機能]]></category>
		<guid isPermaLink="false">https://ranorex.techmatrix.jp/?p=31512</guid>

					<description><![CDATA[<p>Appleの配布ポリシーの変更により、アプリケーションの配布および利用に関する制限が強化されました。これまでは、Ranorex（外部企業）が署名した各アプリケーション（例：RxServiceApp、RxBrowser、R [&#8230;]</p>
<p>The post <a href="https://ranorex.techmatrix.jp/blog/2026/06/19/ios_certificate/">iOS 証明書・プロビジョニングプロファイルの作成手順</a> first appeared on <a href="https://ranorex.techmatrix.jp">テスト自動化ツール 『Ranorex』</a>.</p>]]></description>
										<content:encoded><![CDATA[<div class="veu_autoEyeCatchBox"><img loading="lazy" decoding="async" width="763" height="400" src="https://ranorex.techmatrix.jp/wp-content/uploads/iStock-モバイルエラー.jpg" class="attachment-large size-large wp-post-image" alt="" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/iStock-モバイルエラー.jpg 763w, https://ranorex.techmatrix.jp/wp-content/uploads/iStock-モバイルエラー-300x157.jpg 300w" sizes="(max-width: 763px) 100vw, 763px" /></div>
<p class="wp-block-paragraph">Appleの配布ポリシーの変更により、アプリケーションの配布および利用に関する制限が強化されました。<br>これまでは、Ranorex（外部企業）が署名した各アプリケーション（例：RxServiceApp、RxBrowser、RxMiniKeePass）をユーザー様環境でそのままご利用いただくことが可能でしたが、今後は、iOSのモバイルアプリケーションテストの際に、アプリケーションの署名元と利用元が一致している必要があります。<br>この変更にともない、RanorexでiOSのモバイルアプリケーションのテストをおこなう際は、ユーザー様ご自身で証明書およびプロビジョニングプロファイルを事前に作成のうえ、Ranorexが提供する各アプリケーションをインストールしてご利用いただく必要があります。<br><br>本記事では、証明書およびプロビジョニングプロファイルの概要と作成の流れを説明します。<br>本記事の最後に、作成手順の詳細資料を公開しておりますので、ダウンロードのうえ、是非ご活用ください。</p>



<h3 class="wp-block-heading"><strong>目次</strong></h3>



<ol class="wp-block-list">
<li>事前準備</li>



<li>証明書作成の流れ</li>



<li>プロビジョニングプロファイル作成の流れ</li>



<li>作成手順資料のご案内</li>
</ol>



<h3 class="wp-block-heading"><strong>事前準備</strong></h3>



<ul class="wp-block-list">
<li>証明書の作成には、インターネット接続が可能なmacOS端末が必要となります。</li>



<li>証明書の作成およびプロビジョニングプロファイルの作成には、Apple社が提供する<a href="https://developer.apple.com/account" title="">Apple Developer Program</a>のメンバーシップ（有料）への登録が必要となります。</li>
</ul>



<h3 class="wp-block-heading"><strong>証明書作成の流れ</strong></h3>



<p class="wp-block-paragraph">証明書は、iOSアプリケーションの署名に使用される電子証明書を指します。<br>テスト対象のiOS端末にアプリケーションをインストールするためには、有効な証明書による署名が必要となります。</p>



<ol class="wp-block-list">
<li>証明書要求（.certSigningRequest）の作成</li>



<li>証明書（.cer）の作成</li>



<li>証明書ファイル（.p12）の作成</li>
</ol>



<h3 class="wp-block-heading"><strong>プロビジョニングプロファイル作成の流れ</strong></h3>



<p class="wp-block-paragraph">プロビジョニングプロファイルは、テスト対象のアプリケーションや証明書、実行端末の各情報がまとまったファイルを指します。<br>テスト対象のiOS端末でアプリケーションを実行するために必要となります。</p>



<ol class="wp-block-list">
<li>アプリ識別子（Identifiers）の作成</li>



<li>端末の登録</li>



<li>プロビジョニングプロファイル（.mobileprovision）の作成</li>
</ol>



<h3 class="wp-block-heading"><strong>作成手順資料のご案内</strong></h3>



<p class="wp-block-paragraph">証明書およびプロビジョニングプロファイルの詳細手順に関する資料は、以下のリンクからダウンロード可能です。<br><em>※証明書およびプロビジョニングプロファイルを使用した、RanorexでのIPAファイルのインストルメント手順については、<a href="https://support.ranorex.com/hc/en-us/articles/39337747693457-Install-RxServiceApp-RxBrowser-and-RxMiniKeePass?lang=ja" title="">Ranorex ユーザーガイド</a>をご確認ください。</em></p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button aligncenter"><a class="wp-block-button__link wp-element-button" href="https://ranorex.techmatrix.jp/wp-content/uploads/Ranorex_iOS-証明書・プロビジョニングプロファイル作成手順-1.zip" target="_blank" rel="noreferrer noopener">資料ダウンロード</a></div>
</div>



<p class="wp-block-paragraph"></p><p>The post <a href="https://ranorex.techmatrix.jp/blog/2026/06/19/ios_certificate/">iOS 証明書・プロビジョニングプロファイルの作成手順</a> first appeared on <a href="https://ranorex.techmatrix.jp">テスト自動化ツール 『Ranorex』</a>.</p>]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">31512</post-id>	</item>
		<item>
		<title>Ranorex StudioでSwiftUIアプリをシームレスにテスト</title>
		<link>https://ranorex.techmatrix.jp/blog/2025/02/21/seamlessly-test-swiftui-apps-with-ranorex-studio/</link>
		
		<dc:creator><![CDATA[Ranorex編集部]]></dc:creator>
		<pubDate>Fri, 21 Feb 2025 02:11:52 +0000</pubDate>
				<category><![CDATA[Ranorex機能]]></category>
		<category><![CDATA[事例・ソリューション]]></category>
		<guid isPermaLink="false">https://ranorex.techmatrix.jp/?p=27142</guid>

					<description><![CDATA[<p>モバイル開発が進化するにつれ、AppleのSwiftUIフレームワークは、直感的なクロスプラットフォームUIを構築できることから、開発者の間で人気が高まっています。しかし、SwiftUIの採用が広まるにつれて、これらのア [&#8230;]</p>
<p>The post <a href="https://ranorex.techmatrix.jp/blog/2025/02/21/seamlessly-test-swiftui-apps-with-ranorex-studio/">Ranorex StudioでSwiftUIアプリをシームレスにテスト</a> first appeared on <a href="https://ranorex.techmatrix.jp">テスト自動化ツール 『Ranorex』</a>.</p>]]></description>
										<content:encoded><![CDATA[<div class="veu_autoEyeCatchBox"><img loading="lazy" decoding="async" width="1024" height="536" src="https://ranorex.techmatrix.jp/wp-content/uploads/Ranorex-SwiftUI-Blog-1024x536.png" class="attachment-large size-large wp-post-image" alt="" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/Ranorex-SwiftUI-Blog-1024x536.png 1024w, https://ranorex.techmatrix.jp/wp-content/uploads/Ranorex-SwiftUI-Blog-300x157.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/Ranorex-SwiftUI-Blog-768x402.png 768w, https://ranorex.techmatrix.jp/wp-content/uploads/Ranorex-SwiftUI-Blog.png 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /></div>
<p class="wp-block-paragraph">モバイル開発が進化するにつれ、AppleのSwiftUIフレームワークは、直感的なクロスプラットフォームUIを構築できることから、開発者の間で人気が高まっています。しかし、SwiftUIの採用が広まるにつれて、これらのアプリケーションが高い品質基準を満たすことを保証するためには、強力で効率的なテストソリューションが必要になります。</p>



<p class="wp-block-paragraph">そこで、<strong><a href="https://ranorex.techmatrix.jp/" target="_blank" rel="noopener" title="">Ranorex Studio</a></strong>の出番です。SwiftUIの完全なサポートにより、Ranorex Studioは開発チームにおけるiOSのテストワークフローを合理化し、包括的なカバレッジと信頼性の高いパフォーマンスを保証します。これにより、Ranorex Studioは<strong><a href="https://www.ranorex.com/blog/ios-automation-testing-guide/" target="_blank" rel="noopener" title="">すべてのiOSアプリケーションの機能テスト自動化</a></strong>のための最適なソリューションとなります。</p>



<h3 class="wp-block-heading"><strong>? </strong>SwiftUIとは？</h3>



<p class="wp-block-paragraph">SwiftUIは、iOS、macOS、watchOS、tvOSなどのプラットフォーム間でユーザーインターフェイスを構築するためのAppleの宣言型UIフレームワークです。<br>直感的なデザインとXcodeとの統合により、開発者はより少ないコードでより速くアプリを作成できます。</p>



<p class="wp-block-paragraph">SwiftUIの台頭は、UIテストがこの最新のフレームワークを効果的に扱えることを保証するという、特徴的な課題をQAチームにもたらします。<br>SwiftUIを活用するアプリケーションが増えるにつれて、SwiftUIのコンポーネントとシームレスに連携できる<strong><a href="https://www.ranorex.com/blog/devops-test-automation-best-practices-tools/" target="_blank" rel="noopener" title="">テスト自動化ツール</a></strong>が、品質と効率を維持するために不可欠になります。</p>



<h3 class="wp-block-heading"><strong><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /></strong> Ranorex StudioにおけるSwiftUIサポートのメイン機能</h3>



<p class="wp-block-paragraph">Ranorex StudioのSwiftUIサポートは、SwiftUIアプリケーションのテストプロセスを簡素化するように設計された堅牢な機能を導入します。<br>これらの機能により、テスト担当者は時間と労力を最小限に抑えながら最大限のカバレッジを達成できるため、Ranorex Studioは強力な味方となります。</p>



<ul class="wp-block-list">
<li><strong>正確なオブジェクト認識</strong>：SwiftUIの<strong><a href="https://www.ranorex.com/blog/7-common-object-recognition-challenges/" target="_blank" rel="noopener" title="">要素を簡単に識別</a></strong>して操作できるため、信頼性が高く一貫性のあるテスト作成が可能になります。</li>



<li><strong>包括的なカバレッジ</strong>：すべてのUI要素の機能を検証し、デバイス全体でE2Eの保証を提供します。</li>



<li><strong>合理化されたテスト作成</strong>：<strong>&nbsp;</strong>Ranorex SpyやRecorderなどのRanorexツールを使用して、SwiftUIベースのアプリのテストをすばやく作成および管理します。</li>



<li><strong>既存のワークフローとの統合</strong>：最小限の対応でSwiftUIテストを自動化戦略に組み込みます。</li>
</ul>



<h3 class="wp-block-heading"><strong>?</strong> SwiftUIサポートがワークフローにとって重要な理由</h3>



<p class="wp-block-paragraph">SwiftUIをサポートすることで、Ranorex Studioは、高品質なiOSアプリケーションを提供することに重きを置く開発チームにとって将来を見据えたソリューションとなります。</p>



<ul class="wp-block-list">
<li><strong>効率性の向上</strong>：インテリジェントなオブジェクト認識と再利用可能なテストモジュールにより、テストの作成と管理に必要な手作業の労力を削減します。</li>



<li><strong>コラボレーションの改善</strong>：QAチームはSwiftUIテストを既存のプロジェクトにシームレスに統合できるため、<strong><a href="https://www.ranorex.com/blog/qualities-leaders-collaborative-agile-teams/" target="_blank" rel="noopener" title="">開発者とテスト担当者間の連携が向上</a></strong>します。</li>



<li><strong>スケーラブルなソリューション</strong>：SwiftUIがAppleプラットフォームの標準になるにつれて、Ranorex Studioは開発トレンドに合わせてテスト戦略を進化させます。</li>
</ul>



<h3 class="wp-block-heading">実際のアプリケーション: Ranorexを使用したSwiftUIアプリのテスト</h3>



<p class="wp-block-paragraph">次のシナリオを考えてみましょう。あなたの開発チームは、動的なUIを作成するために、SwiftUIを使用してiOSアプリを作成しています。<br>この合理化されたアプローチにより、時間が節約され、メンテナンスの手間が軽減され、サポートされているすべてのプラットフォームでアプリが問題なく動作することが保証されます。</p>



<p class="wp-block-paragraph">Ranorex Studioでは、&nbsp;Ranorex Spyを使用してSwiftUIコンポーネントをすばやく識別し、オブジェクトリポジトリに追加して再利用できます。Ranorex Recorderを活用することで、複雑なスクリプトを書くことなく自動テストを作成できます。何よりも、これらのテストを実際のiOSデバイスで実行して、包括的なカバレッジを確保し、潜在的な問題を早期に特定できます。</p>



<h3 class="wp-block-heading"><strong><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2699.png" alt="⚙" class="wp-smiley" style="height: 1em; max-height: 1em;" /> </strong>Ranorex StudioでiOSテストを効率化</h3>



<p class="wp-block-paragraph">Ranorexは、デスクトップ（Windows）アプリ、Webアプリをはじめ、モバイルアプリ（iOS、Android）にも対応したUIテスト自動化ツールです。<br>Ranorex バージョン 11.6.0でSwiftUIをサポートしました。</p>



<p class="wp-block-paragraph">この記事は、開発元 Ranorex 社 Blog 「<strong><a href="https://www.ranorex.com/blog/seamlessly-test-swiftui-apps-with-ranorex-studio/" target="_blank" rel="noopener" title="">Seamlessly Test SwiftUI Apps with Ranorex Studio</a></strong>」2025年1月14日の翻訳記事です。）</p><p>The post <a href="https://ranorex.techmatrix.jp/blog/2025/02/21/seamlessly-test-swiftui-apps-with-ranorex-studio/">Ranorex StudioでSwiftUIアプリをシームレスにテスト</a> first appeared on <a href="https://ranorex.techmatrix.jp">テスト自動化ツール 『Ranorex』</a>.</p>]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">27142</post-id>	</item>
		<item>
		<title>Ranorex オートメーションヘルパーの新たな機能をリリース！</title>
		<link>https://ranorex.techmatrix.jp/blog/2025/01/31/ranorex_automation_helpers_v1-0_release/</link>
		
		<dc:creator><![CDATA[Ranorex編集部]]></dc:creator>
		<pubDate>Fri, 31 Jan 2025 02:11:58 +0000</pubDate>
				<category><![CDATA[Ranorex機能]]></category>
		<category><![CDATA[ニュース]]></category>
		<guid isPermaLink="false">https://ranorex.techmatrix.jp/?p=26957</guid>

					<description><![CDATA[<p>Ranorexでは、オートメーションヘルパー機能として、コードモジュールとユーザーコードメソッドのコレクションが実装されており、このコレクションを使用することで、通常はコーディングスキルが必要な機能をノーコードでテストに [&#8230;]</p>
<p>The post <a href="https://ranorex.techmatrix.jp/blog/2025/01/31/ranorex_automation_helpers_v1-0_release/">Ranorex オートメーションヘルパーの新たな機能をリリース！</a> first appeared on <a href="https://ranorex.techmatrix.jp">テスト自動化ツール 『Ranorex』</a>.</p>]]></description>
										<content:encoded><![CDATA[<div class="veu_autoEyeCatchBox"><img loading="lazy" decoding="async" width="1024" height="576" src="https://ranorex.techmatrix.jp/wp-content/uploads/20250123_今すぐ開始-は、次のテキストを使用して表示されます-1024x576.jpg" class="attachment-large size-large wp-post-image" alt="" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/20250123_今すぐ開始-は、次のテキストを使用して表示されます-1024x576.jpg 1024w, https://ranorex.techmatrix.jp/wp-content/uploads/20250123_今すぐ開始-は、次のテキストを使用して表示されます-300x169.jpg 300w, https://ranorex.techmatrix.jp/wp-content/uploads/20250123_今すぐ開始-は、次のテキストを使用して表示されます-768x432.jpg 768w, https://ranorex.techmatrix.jp/wp-content/uploads/20250123_今すぐ開始-は、次のテキストを使用して表示されます-1536x864.jpg 1536w, https://ranorex.techmatrix.jp/wp-content/uploads/20250123_今すぐ開始-は、次のテキストを使用して表示されます-2048x1152.jpg 2048w, https://ranorex.techmatrix.jp/wp-content/uploads/20250123_今すぐ開始-は、次のテキストを使用して表示されます-320x180.jpg 320w" sizes="(max-width: 1024px) 100vw, 1024px" /></div>
<p class="wp-block-paragraph">Ranorexでは、オートメーションヘルパー機能として、コードモジュールとユーザーコードメソッドのコレクションが実装されており、このコレクションを使用することで、通常はコーディングスキルが必要な機能をノーコードでテストに使用することができます。</p>



<p class="wp-block-paragraph">この度、Ranorexユーザー様のお声を元に、弊社、テクマトリックスにて作成したコードモジュールおよびユーザーコードメソッドをTMX版のオートメーションヘルパーとしてリリースしました。今回のリリース（バージョン 1.0）では、以下のユーザーコードメソッドを提供します。</p>



<h3 class="wp-block-heading"><strong>メソッド 一覧</strong></h3>



<ul class="wp-block-list">
<li><strong>TmxCalculateLibrary：四則演算や数値処理に関するメソッド</strong>
<ul class="wp-block-list">
<li>CalculateAddition：指定した2つの数値の加算します</li>



<li>CalculateSubtraction：指定した2つの数値の減算します</li>
</ul>
</li>



<li><strong>TmxSystemLibrary：システムに関するメソッド</strong>
<ul class="wp-block-list">
<li>GetDateTimeAsString_en：英語ロケールで、システム日付を取得します</li>
</ul>
</li>



<li><strong>TmxValidationLibrary：検証に関するメソッド</strong>
<ul class="wp-block-list">
<li>CompareImageFiles：指定した2つの画像ファイルを比較します</li>



<li>ValidateLocation：オブジェクト画面の中央の座標位置が、期待する座標位置かを検証します</li>



<li>ValidateDiffText：指定した2つのテキストを比較します</li>



<li>ValidateDiffTextFile：指定した2つのテキストファイルを比較します</li>



<li>ValidateBiggerThan2：2つの数字の大小を比較し、期待する数値が大きいかを検証します</li>



<li>ValidateSmallerThan2：2つの数字の大小を比較し、期待する数値が小さいかを検証します</li>
</ul>
</li>



<li><strong>TmxReportLibrary：レポートに関するメソッド</strong>
<ul class="wp-block-list">
<li><s>AttachImageToExcel：指定した画像ファイルをExcelに張り付けます</s>（※変更履歴を参照）</li>



<li>ReportPageScreenshot：取得したスクリーンショットを指定したファイル名と場所に保存します</li>
</ul>
</li>
</ul>



<h3 class="wp-block-heading"><strong>TMX版のオートメーションヘルパーの利用方法</strong></h3>



<p class="wp-block-paragraph">TMX版のオートメーションヘルパーを以下のリンクからダウンロードしてください。<br>ダウンロードしたzipファイルを解凍し、フォルダ－に入っているユーザーガイドに沿って、ご利用ください。</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://rx_sp:RX969nKOGr@as3.techmatrix.co.jp/se/ranorex/support/TechMatrix%20Automation%20Helpers_v1.0.zip">TMX版 オートメーションヘルパー ダウンロード</a></div>
</div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p class="wp-block-paragraph">TMX版のオートメーションヘルパーは、今後も新しいコレクションをリリースしていく予定であり、Ranorexユーザー様からのリクエストもお待ちしています。<br><em>※欲しい機能やメソッドなどのリクエストがございましたら、弊社、担当営業までご相談ください。<br>リクエストの内容によっては、実装が難しい場合もございますので、あらかじめご了承ください。</em></p>



<h3 class="wp-block-heading"><strong>変更履歴</strong></h3>



<ul class="wp-block-list">
<li>2025年05月26日：AttachImageToExcelメソッドにて一部、不具合が見つかったため、一旦、リストから外しました。</li>



<li>2025年05月26日：ユーザガイドのCompareImageFilesメソッド名に誤りがあったため、修正しました。</li>



<li>2025年05月26日：ユーザガイドのセットアップにて、注意事項に「Visual Studio 2022および、Visual Studio Build Tools 2025をインストールされているマシンでの利用」を追加しました。</li>
</ul><p>The post <a href="https://ranorex.techmatrix.jp/blog/2025/01/31/ranorex_automation_helpers_v1-0_release/">Ranorex オートメーションヘルパーの新たな機能をリリース！</a> first appeared on <a href="https://ranorex.techmatrix.jp">テスト自動化ツール 『Ranorex』</a>.</p>]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">26957</post-id>	</item>
		<item>
		<title>Ranorex：デバッグ実行</title>
		<link>https://ranorex.techmatrix.jp/blog/2024/02/02/debug/</link>
		
		<dc:creator><![CDATA[Ranorex編集部]]></dc:creator>
		<pubDate>Fri, 02 Feb 2024 02:00:49 +0000</pubDate>
				<category><![CDATA[Ranorex機能]]></category>
		<guid isPermaLink="false">https://ranorex.techmatrix.jp/?p=24267</guid>

					<description><![CDATA[<p>Ranorexで作成したテストが「うまく動かない」となったとき、通常は、レポートのエラーメッセージを確認してテストを修正したり、メンテナンスモードを使用してエラー箇所を特定します。しかし、エラーの原因が特定できなかったり [&#8230;]</p>
<p>The post <a href="https://ranorex.techmatrix.jp/blog/2024/02/02/debug/">Ranorex：デバッグ実行</a> first appeared on <a href="https://ranorex.techmatrix.jp">テスト自動化ツール 『Ranorex』</a>.</p>]]></description>
										<content:encoded><![CDATA[<div class="veu_autoEyeCatchBox"><img loading="lazy" decoding="async" width="1024" height="695" src="https://ranorex.techmatrix.jp/wp-content/uploads/20240129_プログラマーはコンピューターのバグを見つけます-1024x695.png" class="attachment-large size-large wp-post-image" alt="" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/20240129_プログラマーはコンピューターのバグを見つけます-1024x695.png 1024w, https://ranorex.techmatrix.jp/wp-content/uploads/20240129_プログラマーはコンピューターのバグを見つけます-300x204.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/20240129_プログラマーはコンピューターのバグを見つけます-768x521.png 768w, https://ranorex.techmatrix.jp/wp-content/uploads/20240129_プログラマーはコンピューターのバグを見つけます-1536x1042.png 1536w, https://ranorex.techmatrix.jp/wp-content/uploads/20240129_プログラマーはコンピューターのバグを見つけます-2048x1390.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></div>
<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Ranorexで作成したテストが「うまく動かない」となったとき、通常は、<a href="https://ranorex.techmatrix.jp/blog/2021/12/17/error_analysis/">レポートのエラーメッセージ</a>を確認してテストを修正したり、<a href="https://ranorex.techmatrix.jp/blog/2021/12/03/maintenance-mode/">メンテナンスモード</a>を使用してエラー箇所を特定します。しかし、エラーの原因が特定できなかったり、ユーザーコードを使用してテストを作成している場合は、RanorexのGUI上から、直接テストコードをデバッグすることもできます。</p>



<p class="wp-block-paragraph">そこで、本記事では、Ranorexによるデバッグ実行についてご紹介します。</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<h3 class="wp-block-heading"><strong>Ranorexによるデバッグ実行</strong></h3>



<p class="wp-block-paragraph">デバッグ実行を行う際には、事前にデバッグ機能を有効化する必要があります。</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<h5 class="wp-block-heading"><strong>1．デバッグの有効化</strong></h5>



<p class="wp-block-paragraph">デバッグ機能を使用するためには、以下のいずれかの方法でデバッグを有効化します。</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">①Ranorex Studioにて、”デバッグ”メニューを開き、&#8221;デバッグの有効化&#8221;にチェックを入れます。</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="578" height="144" src="https://ranorex.techmatrix.jp/wp-content/uploads/20240202_2_1.png" alt="" class="wp-image-24283" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/20240202_2_1.png 578w, https://ranorex.techmatrix.jp/wp-content/uploads/20240202_2_1-300x75.png 300w" sizes="(max-width: 578px) 100vw, 578px" /></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">②Ranorex Studioのツールバーから、&#8221;デバッグの有効化&#8221;をクリックします。</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="432" height="146" src="https://ranorex.techmatrix.jp/wp-content/uploads/20240202_2_2.png" alt="" class="wp-image-24284" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/20240202_2_2.png 432w, https://ranorex.techmatrix.jp/wp-content/uploads/20240202_2_2-300x101.png 300w" sizes="(max-width: 432px) 100vw, 432px" /></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">有効化すると、デバッグの項目がツールバーに表示されます。</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="436" height="86" src="https://ranorex.techmatrix.jp/wp-content/uploads/20240202_3_4.png" alt="" class="wp-image-24299" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/20240202_3_4.png 436w, https://ranorex.techmatrix.jp/wp-content/uploads/20240202_3_4-300x59.png 300w" sizes="(max-width: 436px) 100vw, 436px" /></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><em>※注意：デバッグの有効化を行った上でテストを実行する場合、Ranorex Studioを管理者権限で起動する必要があります。<br></em></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<h5 class="wp-block-heading"><strong>2．ブレークポイントの設定</strong></h5>



<p class="wp-block-paragraph">特定の位置でテストを一時停止する場合は、ブレークポイントを設定します。</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">1.Ranorexにてソースコードを開きます。<br>　例）レコーディングモジュールの*.UserCode.csファイル</p>



<p class="wp-block-paragraph">2.プログラムを一時停止したい箇所にブレークポイントを設定します。</p>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="590" height="102" src="https://ranorex.techmatrix.jp/wp-content/uploads/20240202_1_1.png" alt="" class="wp-image-24285" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/20240202_1_1.png 590w, https://ranorex.techmatrix.jp/wp-content/uploads/20240202_1_1-300x52.png 300w" sizes="(max-width: 590px) 100vw, 590px" /></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<h5 class="wp-block-heading"><strong>3．デバッグ実行</strong></h5>



<p class="wp-block-paragraph">RUNボタンをクリックし、デバッグ実行を行います。</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="375" height="194" src="https://ranorex.techmatrix.jp/wp-content/uploads/20240202_3_3.png" alt="" class="wp-image-24280" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/20240202_3_3.png 375w, https://ranorex.techmatrix.jp/wp-content/uploads/20240202_3_3-300x155.png 300w" sizes="(max-width: 375px) 100vw, 375px" /></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">ブレークポイントを設定している場合、テスト実行中に、変数の状態やコールスタック（関数の呼び出し経路）などを確認することができます。</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="568" height="268" src="https://ranorex.techmatrix.jp/wp-content/uploads/20240202_3_2.png" alt="" class="wp-image-24281" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/20240202_3_2.png 568w, https://ranorex.techmatrix.jp/wp-content/uploads/20240202_3_2-300x142.png 300w" sizes="(max-width: 568px) 100vw, 568px" /></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">また、デバッグ実行中は「ステップオーバー」「ステップイン」「ステップアウト」が利用できます。</p>



<p class="wp-block-paragraph">※ツールバーのアイコンをクリック、または、&#8221;デバッグ&#8221;メニューから利用します。</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="931" height="447" src="https://ranorex.techmatrix.jp/wp-content/uploads/20240202_3_7.png" alt="" class="wp-image-24313" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/20240202_3_7.png 931w, https://ranorex.techmatrix.jp/wp-content/uploads/20240202_3_7-300x144.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/20240202_3_7-768x369.png 768w" sizes="(max-width: 931px) 100vw, 931px" /></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">・ステップオーバー：1行単位でステップ実行する中でメソッドがあった場合に、メソッドの中には入らず次の行に進みます。</p>



<p class="wp-block-paragraph">・ステップイン：1行単位でステップ実行する中でメソッドがあった場合に、メソッドの中に入って実行します。</p>



<p class="wp-block-paragraph">・ステップアウト：親のメソッドに戻るまで、今実行しているメソッドの処理を進めます。</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<h3 class="wp-block-heading"><strong>まとめ</strong></h3>



<p class="wp-block-paragraph">本記事では、Ranorexのデバッグ機能についてご紹介しました。<br>詳細については以下のページをご参照ください。</p>



<p class="wp-block-paragraph">・<a href="https://support2.ranorex.com/ja/userguide/ranorex-studio-expert/ranorex-studio-ide/debugging/" title="">Ranorex Studio IDE &#8211; デバッグ</a></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p><p>The post <a href="https://ranorex.techmatrix.jp/blog/2024/02/02/debug/">Ranorex：デバッグ実行</a> first appeared on <a href="https://ranorex.techmatrix.jp">テスト自動化ツール 『Ranorex』</a>.</p>]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">24267</post-id>	</item>
		<item>
		<title>Ranorex：ライセンス管理</title>
		<link>https://ranorex.techmatrix.jp/blog/2023/10/13/link-license-key-to-user-pc/</link>
		
		<dc:creator><![CDATA[Ranorex編集部]]></dc:creator>
		<pubDate>Fri, 13 Oct 2023 02:00:38 +0000</pubDate>
				<category><![CDATA[Ranorex機能]]></category>
		<guid isPermaLink="false">https://ranorex.techmatrix.jp/?p=22308</guid>

					<description><![CDATA[<p>Ranorexバージョン10.7のライセンス管理サーバー（Ranorex License Manager）において、ライセンスキー（フローティングライセンス）を利用するクライアント（Ranorexを利用するマシン）を制限 [&#8230;]</p>
<p>The post <a href="https://ranorex.techmatrix.jp/blog/2023/10/13/link-license-key-to-user-pc/">Ranorex：ライセンス管理</a> first appeared on <a href="https://ranorex.techmatrix.jp">テスト自動化ツール 『Ranorex』</a>.</p>]]></description>
										<content:encoded><![CDATA[<div class="veu_autoEyeCatchBox"><img loading="lazy" decoding="async" width="1024" height="640" src="https://ranorex.techmatrix.jp/wp-content/uploads/20231012_blog-eyecatch_img1-1024x640.jpg" class="attachment-large size-large wp-post-image" alt="" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/20231012_blog-eyecatch_img1-1024x640.jpg 1024w, https://ranorex.techmatrix.jp/wp-content/uploads/20231012_blog-eyecatch_img1-300x188.jpg 300w, https://ranorex.techmatrix.jp/wp-content/uploads/20231012_blog-eyecatch_img1-768x480.jpg 768w, https://ranorex.techmatrix.jp/wp-content/uploads/20231012_blog-eyecatch_img1.jpg 1296w" sizes="(max-width: 1024px) 100vw, 1024px" /></div>
<p class="wp-block-paragraph">Ranorexバージョン10.7のライセンス管理サーバー（Ranorex License Manager）において、ライセンスキー（フローティングライセンス）を利用するクライアント（Ranorexを利用するマシン）を制限することができる機能が追加されました。開発プロジェクトやチーム別で使用するライセンスキーを振り分けたい場合、これまではライセンス管理サーバーをそれぞれ用意する必要がありましたが、この機能を使用することで１つのライセンス管理サーバーで対応することが可能となります。</p>



<p class="wp-block-paragraph">対応方法として、ライセンスキーと利用したいクライアントマシンのIPアドレスを紐づけることで、ライセンスキーに紐づいたIPアドレスを持つクライアントのみ、そのライセンスキーを利用することができるようになります。</p>



<p class="wp-block-paragraph"><em>※国内リリース版のRanorexでは、バージョン10.7.2以上のRanorex License Manager（RanorexLicenseManager-10.7.2-ja.exe）で本機能を使用することができます。</em></p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://ranorex.techmatrix.jp/wp-content/uploads/20231004_img1-1024x776.png" alt="" class="wp-image-22963" width="663" height="502" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/20231004_img1-1024x776.png 1024w, https://ranorex.techmatrix.jp/wp-content/uploads/20231004_img1-300x227.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/20231004_img1-768x582.png 768w, https://ranorex.techmatrix.jp/wp-content/uploads/20231004_img1-1536x1164.png 1536w, https://ranorex.techmatrix.jp/wp-content/uploads/20231004_img1-2048x1552.png 2048w" sizes="(max-width: 663px) 100vw, 663px" /><figcaption class="wp-element-caption">(クライアントと紐づいたライセンスキーの管理イメージ）</figcaption></figure>
</div>


<h3 class="wp-block-heading"><strong>設定方法</strong></h3>



<h5 class="wp-block-heading"><strong>１．ライセンスキーとクライアントの紐づけ</strong></h5>



<p class="wp-block-paragraph">① ライセンス管理サーバー（Ranorex License Manager）にて、ライセンス設定画面を管理者権限で起動します。<br>Windowsのアプリ一覧から&#8221;Ranorex License Manager&#8221; &#8211; &#8220;Ranorex License Manager X.x&#8221;を右クリックし、表示されるメニューにて「その他」‐「管理者として実行」を選択します。</p>



<p class="wp-block-paragraph">② 「許可されたIPアドレス」タブを開きます。</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img1-1024x315.png" alt="" class="wp-image-22941" width="545" height="168" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img1-1024x315.png 1024w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img1-300x92.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img1-768x237.png 768w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img1-1536x473.png 1536w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img1-2048x631.png 2048w" sizes="(max-width: 545px) 100vw, 545px" /></figure>



<p class="wp-block-paragraph">③ <strong>ライセンス</strong>のリストからクライアントに紐づけしたいライセンスキーを選択します。</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img2-1024x314.png" alt="" class="wp-image-22942" width="552" height="169" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img2-1024x314.png 1024w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img2-300x92.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img2-768x235.png 768w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img2-1536x470.png 1536w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img2-2048x627.png 2048w" sizes="(max-width: 552px) 100vw, 552px" /></figure>



<p class="wp-block-paragraph">④ <strong>IPアドレス</strong>の入力フォームにクライアントのIPアドレスを入力し、「IPアドレスを追加」をクリックします。</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img3-1024x333.png" alt="" class="wp-image-22946" width="553" height="180" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img3-1024x333.png 1024w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img3-300x98.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img3-768x250.png 768w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img3-1536x500.png 1536w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img3-2048x667.png 2048w" sizes="(max-width: 553px) 100vw, 553px" /></figure>



<p class="wp-block-paragraph">以下のように、対象ライセンスキーに対して、追加したIPアドレスが登録されます。</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img4-1024x334.png" alt="" class="wp-image-22947" width="556" height="181" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img4-1024x334.png 1024w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img4-300x98.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img4-768x250.png 768w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img4-1536x501.png 1536w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img4-2048x668.png 2048w" sizes="(max-width: 556px) 100vw, 556px" /></figure>



<p class="wp-block-paragraph"><em>※紐づけされたライセンスキーは、対象クライアント（IPアドレス）以外から利用することができなくなります。また、何も紐づけされていないライセンスキーは、どのクライアントからも利用することが可能です。</em></p>



<p class="wp-block-paragraph">※紐づけされた情報は、&#8221;<strong>C:\Program Files (x86)\Ranorex\License Manager\Bin\LicensorInfo.json</strong>&#8220;ファイルに保存されます。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>[
  {
    &quot;HostsList&quot;: [
      {
        &quot;IP&quot;: &quot;192.168.11.1&quot;,
        &quot;IsEnabled&quot;: false
      },
      {
        &quot;IP&quot;: &quot;192.168.11.2&quot;,
        &quot;IsEnabled&quot;: false
      }
    ],
    &quot;LicenseKeyName&quot;: &quot;WAH6-HVX9-2DGH-####-####-6YAF-VQYL-4M7E-3M4K-2D4&quot;
  },
  {
    &quot;HostsList&quot;: [
      {
        &quot;IP&quot;: &quot;192.168.11.1&quot;,
        &quot;IsEnabled&quot;: false
      },
      {
        &quot;IP&quot;: &quot;192.168.11.3&quot;,
        &quot;IsEnabled&quot;: false
      }
    ],
    &quot;LicenseKeyName&quot;: &quot;PVSM-EMZW-E4VQ-####-####-Y994-FFXW-2ZFL-M9K2-LF2&quot;
  }
]</code></pre></div>



<h5 class="wp-block-heading"><strong>2．<strong>ライセンスキーに紐づけされたクライアントの</strong>確認</strong></h5>



<p class="wp-block-paragraph"><strong>ライセンス</strong>のリストからライセンスキーを選択することで、そのライセンスキーに紐づいたクライアント（IPアドレス）の情報を確認することができます。</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img5-1024x334.png" alt="" class="wp-image-22951" width="552" height="181" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img5-1024x334.png 1024w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img5-300x98.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img5-768x251.png 768w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img5-1536x501.png 1536w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img5-2048x669.png 2048w" sizes="(max-width: 552px) 100vw, 552px" /></figure>



<h5 class="wp-block-heading"><strong>3．<strong>ライセンスキーとクライアントの</strong>紐づけ解除</strong></h5>



<p class="wp-block-paragraph"><strong>ライセンス</strong>のリストからライセンスキーを選択後、解除したいクライアントのチェックボックスを有効にし、「IPアドレスの削除」をクリックします。</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img6-1024x331.png" alt="" class="wp-image-22952" width="554" height="179" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img6-1024x331.png 1024w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img6-300x97.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img6-768x248.png 768w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img6-1536x497.png 1536w, https://ranorex.techmatrix.jp/wp-content/uploads/20231005_img6-2048x663.png 2048w" sizes="(max-width: 554px) 100vw, 554px" /></figure><p>The post <a href="https://ranorex.techmatrix.jp/blog/2023/10/13/link-license-key-to-user-pc/">Ranorex：ライセンス管理</a> first appeared on <a href="https://ranorex.techmatrix.jp">テスト自動化ツール 『Ranorex』</a>.</p>]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">22308</post-id>	</item>
		<item>
		<title>Safariブラウザのテスト</title>
		<link>https://ranorex.techmatrix.jp/blog/2023/09/28/safari_test/</link>
		
		<dc:creator><![CDATA[Ranorex編集部]]></dc:creator>
		<pubDate>Thu, 28 Sep 2023 02:23:20 +0000</pubDate>
				<category><![CDATA[Ranorex機能]]></category>
		<guid isPermaLink="false">https://ranorex.techmatrix.jp/?p=22532</guid>

					<description><![CDATA[<p>Ranorex 10.7より、iOS端末のSafariブラウザでのテストが可能となりました。そこで、本記事では、iOS端末のSafariブラウザでRanorexのテストを実施する方法をご紹介します。 ※本記事では、Saf [&#8230;]</p>
<p>The post <a href="https://ranorex.techmatrix.jp/blog/2023/09/28/safari_test/">Safariブラウザのテスト</a> first appeared on <a href="https://ranorex.techmatrix.jp">テスト自動化ツール 『Ranorex』</a>.</p>]]></description>
										<content:encoded><![CDATA[<div class="veu_autoEyeCatchBox"><img loading="lazy" decoding="async" width="1024" height="665" src="https://ranorex.techmatrix.jp/wp-content/uploads/20230920_アイソメトリックスマートフォンベクトルイラスト-1024x665.png" class="attachment-large size-large wp-post-image" alt="" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/20230920_アイソメトリックスマートフォンベクトルイラスト-1024x665.png 1024w, https://ranorex.techmatrix.jp/wp-content/uploads/20230920_アイソメトリックスマートフォンベクトルイラスト-300x195.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/20230920_アイソメトリックスマートフォンベクトルイラスト-768x499.png 768w, https://ranorex.techmatrix.jp/wp-content/uploads/20230920_アイソメトリックスマートフォンベクトルイラスト-1536x998.png 1536w, https://ranorex.techmatrix.jp/wp-content/uploads/20230920_アイソメトリックスマートフォンベクトルイラスト-2048x1331.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></div>
<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Ranorex 10.7より、iOS端末のSafariブラウザでのテストが可能となりました。そこで、本記事では、iOS端末のSafariブラウザでRanorexのテストを実施する方法をご紹介します。</p>



<p class="wp-block-paragraph">※本記事では、Safariブラウザでのテストに必要な設定をご紹介していますので、Ranorexでモバイルテストを実施する際に必要なモバイルデバイスの登録、及び、RxServiceAppのインストールは<a href="https://support.ranorex.com/ja/help/latest/web-mobile-testing/mobile-testing/prepare-your-device/">こちら</a>をご参照ください。<br>※本記事の手順では、iOSバージョン16を使用しています。iOSのバージョンによっては表示される画面が異なる場合があります。</p>



<h3 class="wp-block-heading"><strong>Safari ブラウザのテストの注意事項</strong></h3>



<p class="wp-block-paragraph">RanorexにおけるSafariブラウザのテストでは、以下の操作がおこなえません。</p>



<ul class="wp-block-list">
<li>Safariブラウザを閉じる</li>



<li>複数のタブを開く(新規にURLを開いた場合、既存のタブは終了されます)</li>
</ul>



<p class="wp-block-paragraph">これらの操作の自動化が必要な場合、RxBrowserでのテスト、あるいはAppium連携でのテストをご検討ください。</p>



<h3 class="wp-block-heading"><strong>iOS端末の設定</strong></h3>



<p class="wp-block-paragraph">Safariブラウザでテストを実施する場合は、事前にiOS端末のセットアップが必要となります。<br>※RxServiceAppをインストールしてから実施します。</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">1.iOS端末にて、[設定]アプリを開きます。</p>



<p class="wp-block-paragraph">2.[Safari]から、[拡張機能]をタッチします。</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="563" height="526" src="https://ranorex.techmatrix.jp/wp-content/uploads/1-1-1.png" alt="" class="wp-image-22551" style="width:422px;height:395px" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/1-1-1.png 563w, https://ranorex.techmatrix.jp/wp-content/uploads/1-1-1-300x280.png 300w" sizes="(max-width: 563px) 100vw, 563px" /></figure>



<p class="wp-block-paragraph">3.[Ranorex Safari Extension]をオンにします。</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="543" height="520" src="https://ranorex.techmatrix.jp/wp-content/uploads/1-2-1.png" alt="" class="wp-image-22552" style="width:407px;height:390px" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/1-2-1.png 543w, https://ranorex.techmatrix.jp/wp-content/uploads/1-2-1-300x287.png 300w" sizes="(max-width: 543px) 100vw, 543px" /></figure>



<p class="wp-block-paragraph">4.[すべてのWebサイト]をタッチし、[許可]を選択します。</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="537" height="518" src="https://ranorex.techmatrix.jp/wp-content/uploads/1-3-1.png" alt="" class="wp-image-22553" style="width:403px;height:389px" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/1-3-1.png 537w, https://ranorex.techmatrix.jp/wp-content/uploads/1-3-1-300x289.png 300w" sizes="(max-width: 537px) 100vw, 537px" /></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">ここまで設定をおこなったら、[設定]アプリは閉じます。</p>



<p class="wp-block-paragraph"></p>



<h3 class="wp-block-heading"><strong>テストの作成</strong></h3>



<p class="wp-block-paragraph">テストの作成は、RxBrowserやネイティブアプリと同じ方法で実施しますが、作成時のテスト対象アプリには[RxServiceApp]を選択します。</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">1.iOSデバイス上でRxServiceAppを起動します。</p>



<p class="wp-block-paragraph">2.Ranorex Studioで[RECORD]ボタンをクリックし、[アプリの選択または追加]から、[RxServiceApp]を選択します。</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="627" height="626" src="https://ranorex.techmatrix.jp/wp-content/uploads/2-1-1.png" alt="" class="wp-image-22547" style="width:470px;height:470px" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/2-1-1.png 627w, https://ranorex.techmatrix.jp/wp-content/uploads/2-1-1-300x300.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/2-1-1-150x150.png 150w" sizes="(max-width: 627px) 100vw, 627px" /></figure>



<p class="wp-block-paragraph">3.WebサイトのURLを指定し、[作成]をクリックします。iOS端末にてSafariブラウザが起動されるので、オブジェクトを取得していきます。<br>※モバイル端末でのテストの作成方法は<a href="https://support2.ranorex.com/ja/help/latest/web-mobile-testing/mobile-testing/create-a-mobile-test/" title="">こちら</a></p>



<figure class="wp-block-video"><video height="1080" style="aspect-ratio: 1920 / 1080;" width="1920" autoplay loop muted src="https://ranorex.techmatrix.jp/wp-content/uploads/movie1.mp4"></video></figure>



<p class="wp-block-paragraph"></p>



<h3 class="wp-block-heading"><strong>テストの実行</strong></h3>



<p class="wp-block-paragraph">テストの実行は、RxBrowserやネイティブアプリと同じ方法で実施します。Ranorex Studioから[RUN]ボタンをクリックすることで、Safariブラウザ上でのテストが実行できます。</p>



<figure class="wp-block-video"><video height="1080" style="aspect-ratio: 1920 / 1080;" width="1920" autoplay loop muted src="https://ranorex.techmatrix.jp/wp-content/uploads/movie2.mp4"></video></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<h3 class="wp-block-heading"><strong>注意点</strong></h3>



<li>Safariブラウザでのテストは、iOS15以降が対象となります。</li>



<li>テストの作成/実行の際には、iOS端末にてRxServiceAppを開いた状態で開始してください。</li>



<li>RxBrowserで作成済みのRanorexソリューションをSafariブラウザでテスト実行することはできません。</li>



<li><a href="https://ranorex.techmatrix.jp/faq/12_bug-limitation_5/" target="_blank" rel="noopener noreferrer">iOS 18.5以降でSafariテストができない</a></li>



<div style="height:39px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="wp-block-paragraph"></p><p>The post <a href="https://ranorex.techmatrix.jp/blog/2023/09/28/safari_test/">Safariブラウザのテスト</a> first appeared on <a href="https://ranorex.techmatrix.jp">テスト自動化ツール 『Ranorex』</a>.</p>]]></content:encoded>
					
		
		<enclosure url="https://ranorex.techmatrix.jp/wp-content/uploads/movie1.mp4" length="0" type="video/mp4" />
<enclosure url="https://ranorex.techmatrix.jp/wp-content/uploads/movie2.mp4" length="0" type="video/mp4" />

		<post-id xmlns="com-wordpress:feed-additions:1">22532</post-id>	</item>
		<item>
		<title>ユーザーコード リファレンス：スクリーンショットの名前や出力場所の変更</title>
		<link>https://ranorex.techmatrix.jp/blog/2023/08/25/user-code-reference_screenshot_name-place_change/</link>
		
		<dc:creator><![CDATA[Ranorex編集部]]></dc:creator>
		<pubDate>Fri, 25 Aug 2023 06:59:59 +0000</pubDate>
				<category><![CDATA[Ranorex機能]]></category>
		<guid isPermaLink="false">https://ranorex.techmatrix.jp/?p=22156</guid>

					<description><![CDATA[<p>テスト実行時のエビデンスとして取得するスクリーンショットを管理しやすくするために、スクリーンショットの名前や出力場所を変更したいといったご意見をユーザー様からよくいただきます。こちらについては、Ranorex のユーザー [&#8230;]</p>
<p>The post <a href="https://ranorex.techmatrix.jp/blog/2023/08/25/user-code-reference_screenshot_name-place_change/">ユーザーコード リファレンス：スクリーンショットの名前や出力場所の変更</a> first appeared on <a href="https://ranorex.techmatrix.jp">テスト自動化ツール 『Ranorex』</a>.</p>]]></description>
										<content:encoded><![CDATA[<div class="veu_autoEyeCatchBox"><img loading="lazy" decoding="async" width="1024" height="598" src="https://ranorex.techmatrix.jp/wp-content/uploads/画像1-4-1024x598.png" class="attachment-large size-large wp-post-image" alt="" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/画像1-4-1024x598.png 1024w, https://ranorex.techmatrix.jp/wp-content/uploads/画像1-4-300x175.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/画像1-4-768x449.png 768w, https://ranorex.techmatrix.jp/wp-content/uploads/画像1-4-1536x897.png 1536w, https://ranorex.techmatrix.jp/wp-content/uploads/画像1-4-2048x1196.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></div>
<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">テスト実行時のエビデンスとして取得するスクリーンショットを管理しやすくするために、スクリーンショットの名前や出力場所を変更したいといったご意見をユーザー様からよくいただきます。こちらについては、Ranorex のユーザーコード機能を使用して、コードを書くことで簡単に実現できます。今回は、スクリーンショットの名前や出力場所を変更するサンプルのユーザーコードをご紹介します。</p>



<h3 class="wp-block-heading"><strong>ユーザーコードの作成</strong></h3>



<p class="wp-block-paragraph">ユーザーコードコレクションによるコーディングをすることで、どのレコーディングモジュールからでも、<strong>User Code</strong> アクションでユーザーコードを呼び出すことができます。<br>ユーザーコードコレクションによるコーディング方法については、<strong><a href="https://ranorex.techmatrix.jp/blog/2020/06/19/creating-tests-using-source-code_user-code-collection/" title="">こちら</a></strong>をご参照ください。</p>



<p class="wp-block-paragraph">今回、ご紹介するサンプルのユーザーコードは、以下のような処理になります。</p>



<ol class="wp-block-list">
<li><strong>対象オブジェクトのスクリーンショットの取得</strong></li>



<li><strong>スクリーンショットの取得が実行されたときのモジュール名と日時の取得</strong> (スクリーンショット名に使用するため)</li>



<li><strong>任意のスクリーンショット名でイメージファイルに出力</strong><br><strong>イメージファイル出力パス + 実行時のモジュール名と日時 + 末尾のスクリーンショット名</strong> (画像形式の拡張子も含む)</li>



<li><strong>スクリーンショットをレポートファイル(rxlog)に出力</strong></li>
</ol>



<h3 class="wp-block-heading"><strong>サンプルコード</strong></h3>



<p class="wp-block-paragraph">ここでご紹介するサンプルコードは、Ranorex 10.7で動作することを確認したものになります。</p>



<p class="wp-block-paragraph">1. ユーザーコレクションにて、以下の2つの名前空間を定義します。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-csharp" data-lang="C#"><code>using Ranorex.Core.Repository;
using System.IO;</code></pre></div>



<p class="wp-block-paragraph">2. 新規メソッドを作成し、以下のコードを記載します。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-csharp" data-lang="C#"><code>public void Screenshot(RepoItemInfo repoInfo, String outputImgPath,String outputImgName)
{
//スクリーンショットの実行
Bitmap screenShot = repoInfo.FindAdapter&lt;Unknown&gt;().CaptureCompressedImage();

//モジュール名の取得
var curModule = TestModuleLeaf.Current;
string mdName= curModule.Name;

//テスト実行時の日時の取得
System.DateTime datetime = System.DateTime.Now;
string nowTime = datetime.ToString(&quot;yyyyMMdd_HHmm&quot;);

//スクリーンショットをイメージファイルに出力（ファイル出力パス+モジュール名+日時+スクリーンショット名）
screenShot.Save(outputImgPath + &quot;/&quot; + mdName + &quot;_&quot; + nowTime + &quot;_&quot; + outputImgName);

//スクリーンショットをレポートファイルに出力
Report.LogData(ReportLevel.Info, &quot;スクリーンショット&quot;, screenShot);
}</code></pre></div>



<h3 class="wp-block-heading"><strong>解説</strong></h3>



<div class="hcb_wrap"><pre class="prism line-numbers lang-csharp" data-lang="C#"><code>public void Screenshot(RepoItemInfo repoInfo, String outputImgPath,String outputImgName)</code></pre></div>



<p class="wp-block-paragraph">引数には、スクリーンショット対象の<strong>オブジェクト</strong> (RepoItemInfo repoInfo)、イメージファイルの<strong>出力パス</strong> (String outputImgPath)、末尾の<strong>スクリーンショット名</strong> (outputImgName) を指定しています。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-csharp" data-lang="C#"><code>//スクリーンショットの実行
Bitmap screenShot = repoInfo.FindAdapter&lt;Unknown&gt;().CaptureCompressedImage();</code></pre></div>



<p class="wp-block-paragraph">Ranorex API の<strong> CaptureCompressedImage</strong> を使用して、対象のオブジェクトのスクリーンショットを取得する処理になります。<br><strong>FindAdapter</strong> の種類をサンプルのように<strong>&lt;Unknown&gt;</strong>にすることで、アダプタのタイプ(Form、WebDocument、等)を特定せずに実装いただけます。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-csharp" data-lang="C#"><code>//モジュール名の取得
var curModule = TestModuleLeaf.Current;
string mdName= curModule.Name;</code></pre></div>



<p class="wp-block-paragraph">Ranorex API の <strong>TestModuleLeaf.Current </strong>と <strong>curModule.Name</strong> を使用して、スクリーンショット時の実行モジュールの名前を取得します。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-csharp" data-lang="C#"><code>//テスト実行時の日時の取得
System.DateTime datetime = System.DateTime.Now;
string nowTime = datetime.ToString(&quot;yyyyMMdd_HHmm&quot;);</code></pre></div>



<p class="wp-block-paragraph">.NET クラスライブラリ を使用して、スクリーンショット時の<strong>年月日</strong>と<strong>時間</strong>(時間+分)を取得します。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-csharp" data-lang="C#"><code>//スクリーンショットをイメージファイルに出力（ファイル出力パス+モジュール名+日時+スクリーンショット名）
screenShot.Save(outputImgPath + &quot;/&quot; + mdName + &quot;_&quot; + nowTime + &quot;_&quot; + outputImgName);</code></pre></div>



<p class="wp-block-paragraph">引数で指定した<strong>イメージファイルの出力パス</strong>(outputImgPath)に、<strong>モジュール名</strong>+<strong>日時</strong>+<strong>スクリーンショット名</strong>(outputImgName)のイメージファイルが出力されます。<br>例：<strong>RecordingModule1_2023825_0930_FormScreenshot1.jpg</strong></p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-csharp" data-lang="C#"><code>//スクリーンショットをレポートファイルに出力 
Report.LogData(ReportLevel.Info, &quot;スクリーンショット&quot;, screenShot);</code></pre></div>



<p class="wp-block-paragraph">Ranorex API の<strong> Report.LogData</strong> を使用して、レポートにスクリーンショットを出力します。</p>



<h3 class="wp-block-heading">ユーザーコードアクションの追加と引数の指定</h3>



<p class="wp-block-paragraph">1. 対象のアクションテーブルにて、スクリーンショットを取りたい場所で右クリック &gt; <strong>新しいアクションの追加</strong> &gt; <strong>ユーザーコード(User code)</strong> &gt; <strong>ライブラリから追加</strong> を選択します。</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-47.png" alt="" class="wp-image-22248" width="498" height="418" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-47.png 866w, https://ranorex.techmatrix.jp/wp-content/uploads/image-47-300x252.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/image-47-768x645.png 768w" sizes="(max-width: 498px) 100vw, 498px" /></figure>



<p class="wp-block-paragraph">2. ライブラリ画面から、作成した対象のメソッドを選択し、<strong>選択項目を追加</strong> ボタンをクリックします。</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-55.png" alt="" class="wp-image-22278" width="657" height="125" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-55.png 893w, https://ranorex.techmatrix.jp/wp-content/uploads/image-55-300x57.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/image-55-768x146.png 768w" sizes="(max-width: 657px) 100vw, 657px" /></figure>



<p class="wp-block-paragraph">3. 追加されたユーザーコードアクションの引数<strong> repoInfo(RepoItemInfo) </strong>に、スクリーンショット対象のオブジェクトを指定します。<br>リポジトリから対象のオブジェクトを<strong> repoInfo(RepoItemInfo) </strong>にドラッグ&amp;ドロップします。</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-56.png" alt="" class="wp-image-22279" width="595" height="169" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-56.png 959w, https://ranorex.techmatrix.jp/wp-content/uploads/image-56-300x85.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/image-56-768x218.png 768w" sizes="(max-width: 595px) 100vw, 595px" /></figure>



<p class="wp-block-paragraph">4.  引数 <strong>outputImgPath(String)</strong> に、スクリーンショットを出力したいフォルダパスを指定します。</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-57-1024x110.png" alt="" class="wp-image-22280" width="712" height="76" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-57-1024x110.png 1024w, https://ranorex.techmatrix.jp/wp-content/uploads/image-57-300x32.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/image-57-768x82.png 768w, https://ranorex.techmatrix.jp/wp-content/uploads/image-57.png 1382w" sizes="(max-width: 712px) 100vw, 712px" /></figure>



<p class="wp-block-paragraph">5. 引数 <strong>outputImgName(String)</strong> に、末尾のスクリーンショット名(拡張子も含む)を指定します。<br>※JPG、PNG形式で出力できます。</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://ranorex.techmatrix.jp/wp-content/uploads/image-58-1024x84.png" alt="" class="wp-image-22281" width="809" height="66" srcset="https://ranorex.techmatrix.jp/wp-content/uploads/image-58-1024x84.png 1024w, https://ranorex.techmatrix.jp/wp-content/uploads/image-58-300x25.png 300w, https://ranorex.techmatrix.jp/wp-content/uploads/image-58-768x63.png 768w, https://ranorex.techmatrix.jp/wp-content/uploads/image-58-1536x126.png 1536w, https://ranorex.techmatrix.jp/wp-content/uploads/image-58.png 1557w" sizes="(max-width: 809px) 100vw, 809px" /></figure>



<p class="wp-block-paragraph">こちらの設定で、テスト実行することで、手順4で指定したフォルダに、対象オブジェクトのスクリーンショットが任意の名前で出力されます。</p>



<h3 class="wp-block-heading">まとめ</h3>



<p class="wp-block-paragraph">スクリーンショット名や出力フォルダを変更することで、スクリーンショットの管理がしやすくなりますので、ぜひこちらのコードを参考にして、ご活用ください。<br>また、Ranorex API の詳細につきましては、Ranorex Studio のメニューバーから <strong>ヘルプ</strong> &gt; <strong>API ドキュメント</strong> をご参照ください。</p><p>The post <a href="https://ranorex.techmatrix.jp/blog/2023/08/25/user-code-reference_screenshot_name-place_change/">ユーザーコード リファレンス：スクリーンショットの名前や出力場所の変更</a> first appeared on <a href="https://ranorex.techmatrix.jp">テスト自動化ツール 『Ranorex』</a>.</p>]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">22156</post-id>	</item>
	</channel>
</rss>
