Skip to content

Commit 69b37d7

Browse files
committed
Fix a bug with Recorder Mode
1 parent 6968f83 commit 69b37d7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

seleniumbase/extensions/recorder.zip

-56 Bytes
Binary file not shown.

seleniumbase/js_code/recorder_js.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,6 @@
424424
document.recorded_actions.pop();
425425
ra_len = document.recorded_actions.length;
426426
}
427-
// Again for click & more changes.
428427
if (ra_len > 0 && document.recorded_actions[ra_len-1][1] === selector)
429428
{
430429
document.recorded_actions.pop();
@@ -446,13 +445,11 @@
446445
document.recorded_actions[ra_len-1][1] === selector &&
447446
tag_name === 'input' && e_type === 'checkbox')
448447
{
449-
// Pop extra checkbox changes.
450448
document.recorded_actions.pop();
451449
ra_len = document.recorded_actions.length;
452450
if (ra_len > 0 && document.recorded_actions[ra_len-1][1] === selector)
453451
document.recorded_actions.pop();
454452
}
455-
// Use 'if' again, not 'else if'.
456453
if (tag_name === 'input' && e_type === 'checkbox' && element.checked)
457454
document.recorded_actions.push(['c_box', selector, 'yes', d_now]);
458455
else if (tag_name === 'input' && e_type === 'checkbox' && !element.checked)
@@ -471,7 +468,7 @@
471468
if (ra_len > 0 && document.recorded_actions[ra_len-1][0] === 'mo_dn')
472469
document.recorded_actions.pop();
473470
if (tag_name === 'select') {
474-
// Do Nothing. (Handle in 'change' action.)
471+
// Do Nothing. ('change' action.)
475472
}
476473
else
477474
document.recorded_actions.push(['mo_dn', selector, '', d_now]);
@@ -500,6 +497,8 @@
500497
if (rec_mode === '2' || (rec_mode === '3' && sel_has_contains)) {
501498
origin = window.location.origin;
502499
document.recorded_actions.push(['as_el', selector, origin, d_now]);
500+
json_rec_act = JSON.stringify(document.recorded_actions);
501+
sessionStorage.setItem('recorded_actions', json_rec_act);
503502
return;
504503
}
505504
else if (rec_mode === '3') {
@@ -522,6 +521,8 @@
522521
}
523522
tex_sel = [text, selector];
524523
document.recorded_actions.push([action, tex_sel, origin, d_now]);
524+
json_rec_act = JSON.stringify(document.recorded_actions);
525+
sessionStorage.setItem('recorded_actions', json_rec_act);
525526
return;
526527
}
527528
}

0 commit comments

Comments
 (0)