T E S B O

Tesbo

Close particular browser window using index

1) Close single window using index

Syntax:

Step: Close <index> window

Notes: Index start with zero( 0 )

i.e

Test: Verify close particular browser window using index
#All #window
Step: Open Url 'http://toolsqa.com/automation-practice-switch-windows/'
Step: Scroll and Click on @NewWindow
Step: Click on @NewWindow
Step: Click on @NewWindow
Step: Click on @NewWindow
Step: Click on @NewWindow
Step: pause 2 sec
Step: Close <2> window
Step: pause 2 sec
End

2) Close multiple window using index

Syntax:

Step: Close <index0,index1,index2> window

i.e

Test: Verify close multiple browser window using index
#All #window
Step: Open Url 'http://toolsqa.com/automation-practice-switch-windows/'
Step: Scroll and Click on @NewWindow
Step: Click on @NewWindow
Step: Click on @NewWindow
Step: Click on @NewWindow
Step: Click on @NewWindow
Step: pause 2 sec
Step: Close <0,2> window
Step: pause 2 sec
End

3) Close particular range of browser window using index

Syntax:

Step: Close <index2 To index5> window

i.e

Test: Verify close particular range of browser window using index
#All #window
Step: Open Url 'http://toolsqa.com/automation-practice-switch-windows/'
Step: Scroll and Click on @NewWindow
Step: Click on @NewWindow
Step: Click on @NewWindow
Step: Click on @NewWindow
Step: Click on @NewWindow
Step: pause 2 sec
Step: Close <1 to 3> window
Step: pause 2 sec
End

You can find a similar example from Tesbo-Skeleton as well

Powered by BetterDocs

Leave a Comment