Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Set Scan Wait Rate doesnt set scan rate properly.

オープン
#189 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java
領域
testing-qa

調査の方向性

まず、ScreenKeywords.java がどのように Region を作成し、SettingsKeywords.java がどのように Settings.WaitScanRate を変更するかを追跡し、次に SikuliApi における Region の初期化を調べます。既存のリージョンが後から行われるスキャンレートの変更をどのように受け取るべきかを判断します。完了条件は、Set wait scan rate キーワードが screen keywords で使用されるリージョンを制御し、適切な動作が関連するテストで検証されていることです。

索引モデルが issue の本文から書いたものです。

説明

Hey there, thankyou for this library, so far its great!

When playing with the Set Scan Rate key word, I noticed that the set scan rate doesn't seem to apply properly.

I dont have an IDE available, nor do I have a example script to demonstrate this at the moment otherwise I would do a pull request or give the script to demonstate... But the problem is due to the following:

@RobotKeywords
public class ScreenKeywords {

    private static double DEFAULT_TIMEOUT = 3.0;
    private static Screen screen = new Screen();
    private static Region region = new Region(screen);

Note in ScreenKeywords.java, the region is created

and in SettingsKeywords.java

This is good, but this is an issue with how the Region class is then initialised in SikuliApi, which at its initialisation, it only ever calls Settings.WaitScanRate once.

public class Region extends Element {
   ...
  /**
   * set the regions individual WaitScanRate
   *
   * @param waitScanRate decimal number
   */
  public void setWaitScanRate(float waitScanRate) {
    this.waitScanRate = waitScanRate;
  }

  private float waitScanRateDefault = Settings.WaitScanRate;
  private float waitScanRate = waitScanRateDefault;

So the following logic, doesn't quite control the scan rate for the region defined in the region key words.

   @RobotKeyword("Set wait scan rate"   + "\n Specify the number of times actual search operations are performed per second while waiting for a pattern to appear or vanish.")
   @ArgumentNames({"delay"})

   public void setWaitScanRate(float scanRate) {
      Settings.WaitScanRate = scanRate;
    }

So this is where it gets a little tricky because the two classes containing the key words don't effectively work with one-another.

Could always do the lazy option and move the Set wait scan rate into ScreenKeywords.java and then do a
region.setWaitScanRate(float scanRate) instead (I wont complain, this will solve my issue ;) )

or.. if you are looking for a cleaner/ more elegant solution..

Create a settings class service, with an inbuilt observer pattern to notify settings changes made from SettingsKeywords.java to ScreenKeywords.java.

I would normally suggest DI, but being that I'm not super experienced with robot keywords yet and how that impacts keyword registration, A Singleton pattern may be better suited here even though its more of a anti-pattern.

主要言語
Java
スター
163
フォーク
60
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

MarketSquare/robotframework-SikuliLibrary のほかの issue

MarketSquare/robotframework-SikuliLibrary の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。