Is there a way to duplicate a tab using Watir

16 views
Skip to first unread message

NaviHan

unread,
Apr 9, 2019, 11:39:32 PM4/9/19
to Watir General
Is there a way to duplicate a tab using Watir?

(in chrome, right click on tab>Duplicate tab)

I know we can use the javascript to open a new tab?
Even if its new tab is there a Watir way to do that?
@browser.execute_script("window.open('http://www.google.com', '_blank')")



rajagopalan madasami

unread,
Apr 9, 2019, 11:41:37 PM4/9/19
to watir-...@googlegroups.com
This is the only way I guess. WATIR doesn't have any way to open the new tab. Do you face any problem?

--
--
Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
In short: search before you ask, be nice.
 
watir-...@googlegroups.com
http://groups.google.com/group/watir-general
watir-genera...@googlegroups.com
---
You received this message because you are subscribed to the Google Groups "Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email to watir-genera...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

NaviHan

unread,
Apr 10, 2019, 12:35:39 PM4/10/19
to Watir General
I want to duplicate the browser in a new tab. Not open a blank new tab.

And are we sure that javascript is the only way to open a new tab?

rajagopalan madasami

unread,
Apr 10, 2019, 12:43:39 PM4/10/19
to watir-...@googlegroups.com
Yes, driver is not giving any way to this Job. Neither chrome nor geckodriver. You may ask them to add it in github!

Here 

For Chrome here 



Titus Fortner

unread,
Apr 10, 2019, 12:53:32 PM4/10/19
to Watir General
The issue is that it isn't in the w3c: https://w3c.github.io/webdriver/
Probably because not all browsers implement that functionality, so it didn't make sense to put it in the spec.
You can request the feature in the spec, but it won't happen any time soon.



On Wednesday, April 10, 2019 at 11:43:39 AM UTC-5, rajagopalan madasami wrote:
Yes, driver is not giving any way to this Job. Neither chrome nor geckodriver. You may ask them to add it in github!

Here 

For Chrome here 



On Wed, 10 Apr, 2019, 10:05 PM NaviHan, <hishin...@gmail.com> wrote:
I want to duplicate the browser in a new tab. Not open a blank new tab.

And are we sure that javascript is the only way to open a new tab?

On Wednesday, 10 April 2019 13:39:32 UTC+10, NaviHan wrote:
Is there a way to duplicate a tab using Watir?

(in chrome, right click on tab>Duplicate tab)

I know we can use the javascript to open a new tab?
Even if its new tab is there a Watir way to do that?
@browser.execute_script("window.open('http://www.google.com', '_blank')")



--
--
Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
In short: search before you ask, be nice.
 
watir-...@googlegroups.com
http://groups.google.com/group/watir-general

---
You received this message because you are subscribed to the Google Groups "Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email to watir-...@googlegroups.com.

rajagopalan madasami

unread,
Apr 10, 2019, 1:06:52 PM4/10/19
to watir-...@googlegroups.com
I felt it somehow because it is the common need to everyone so this kind of request must have been raised. Perhaps WATIR may give some functionality to achieve this result wrapping up this JavaScript code like watir does for click using click!


---
You received this message because you are subscribed to the Google Groups "Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email to watir-genera...@googlegroups.com.

Titus Fortner

unread,
Apr 10, 2019, 2:36:32 PM4/10/19
to watir-general
Does the JavaScript work in all browsers? I'm reluctant to add browser specific features if not. If so, make a PR and we can evaluate it. It is low on my list of priorities for code at the moment.

rajagopalan madasami

unread,
Apr 10, 2019, 8:08:00 PM4/10/19
to watir-...@googlegroups.com
Nowadays all people are using chrome or firefox, JavaScript would perfectly be executed in these two browsers. Okay its not a problem if you don't want to add it. I have created specific function my framework to accomplish this task so it's not a problem for me.

On Thu, 11 Apr, 2019, 12:06 AM Titus Fortner, <titusf...@gmail.com> wrote:
Does the JavaScript work in all browsers? I'm reluctant to add browser specific features if not. If so, make a PR and we can evaluate it. It is low on my list of priorities for code at the moment.

--
Reply all
Reply to author
Forward
0 new messages