Hi,
I had a support case recently with a customer who is using TruClient IE 11.52. They face an issue that is reproduced on certain machines and was resolved in 12.0x. For some reason TruClient IE does not perform click on Confirm/Alert boxes causing the script to hang during replay.
I wanted to share an easy workaround - prevent the confirm/alert box from showing. I have seen this issue more than once and in all cases the workaround below didn't affect the functionality of the application under test
Script before the workaround:
- ..... script logic before relevant part
- Step A that triggers pop up box(es).
- Click OK on confirm box
- Click OK on alert box
- .... script logic after relevant part
Workaround
- Add "Evaluate JavaScript" step before the step that triggers the pop-ups with the following code in it
// Save original alert and confirm functions in order to restore them later
var browserAlert - window.alert;
var browserConfirm = window.confirm;
// Override browser alert and confrm behavior not to issue a pop-up
window.alert = function() { returntrue; }
window.confirm = function() { returntrue; }
2. Add "Evaluate JavaScript:" step after the step that triggers the pop-ups with the following code in it
// Restore normal behavior of confirm and alert boxes
window.alert = browserAlert;
window.confirm = browserConfirm;
Script after the workaround
- ..... script logic before relevant part
- Evaluate JavaScript to prevent pop up boxes from showing
- Step A that triggers pop up box(es).
- Evaluate JavaScript to restore pop up boxes
- .... script logic after relevant part
Notice that there is no need in the Click OK steps anymore since the browser does not show them
Hope it helps
Shlomi