LoginSignup
3
1

More than 3 years have passed since last update.

ChromeのSelenium IDEで変数設定とループ処理

Posted at

環境

chrome:バージョン: 79.0...
chrome拡張:Selenium IDE 3.16.1

Selenium IDEの使い方

Recボタンを押してのブラウザ操作すると簡単に記録はできます。
この記録をした上で、繰り返し等を自分でコードに埋め込む形です。

コード

Command Target Value 説明
times 5 繰り返し(Targetの回数),indexは不明
store taro name 変数に値格納、使用時は${name}
store ${name}さん name 文字の結合、 1つ上と合わせるとtaroさんとなる
execute script return Number(${seq})+1 seq  seqに加算、seqはstoreとかである前提
wait for element present css=.user > .name 3000 指定したセレクタの出現待ち。ajaxとかで非同期の時に、処理を待ちたくて組み合わせた

まとめ

やりたい事は簡単なのに、表の内容がわからず調べるのにかなり時間がかかりました。
わかれば後は組み合わせるだけで、大した事ないんですけどね。
※参考はどこか忘れちゃったので、次に書くときがあれば入れればと。

3
1
0

Register as a new user and use Qiita more conveniently

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