My web application opens a new tab when a button is clicked. I want to be able to close the new tab once I'm done with it and continue working with the original tab. How can I achieve this?
The application runs of Chrome.
Cybersecurity
DevOps Cloud
IT Operations Cloud
If an answer to your question is correct, click on "Verify Answer" under the "More" button. The answer will now appear with a checkmark. Please be sure to always mark answers that resolve your issue as verified. Your fellow Community members will appreciate it!  Learn more
My web application opens a new tab when a button is clicked. I want to be able to close the new tab once I'm done with it and continue working with the original tab. How can I achieve this?
The application runs of Chrome.
' Switch to the new tab (second tab opened)
Browser("CreationTime:=1").Page("title:=Your Page Title").Sync
' Perform your actions on the new tab For example, click a button
Browser("CreationTime:=1").Page("title:=Your Page Title").WebButton("name:=Submit").Click
' Close the new tab
Browser("CreationTime:=1").Close
' Switch back to the original tab
Browser("CreationTime:=0").Page("title:=Original Page Title").Sync
' Continue with your actions on the original tab
Note:Replace "Your Page Title"
and "Original Page Title"
with the actual titles of your pages.