browser-tab

How to open a link in new tab (chrome) using Selenium WebDriver?

与世无争的帅哥 提交于 2019-11-27 19:54:27
System.setProperty("webdriver.chrome.driver", "D:\\softwares\\chromedriver_win32\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); driver.manage().window().maximize(); driver.get("https://mail.google.com/"); String selectLinkOpeninNewTab = Keys.chord(Keys.CONTROL,Keys.RETURN); driver.findElement(By.linkText("www.facebook.com")).sendKeys(selectLinkOpeninNewTab); New tab is opening but URL link is not opening. I checked with below code and it works fine for me. I found answer from here . driver = new ChromeDriver();

How to know if browser tab is already open using Javascript?

只谈情不闲聊 提交于 2019-11-27 11:58:00
问题 How to know or check if the two browser tab is already open and if those tab are open, the user will receive an alert box or msg box saying that 'the url is already open', something like that, in pure/native JavaScript? This browser tab is contain an external website which is I don't have any privileges to manipulate or change it. Thanks Example URLs yahoo.com and google.com I want to alert the user if there's already open tab for yahoo.com and google.com And I want to use tabCreate to open

Session shared in between tabs

天涯浪子 提交于 2019-11-27 08:30:31
I have JAVA web application where I need to stop session being shared between browser tabs, meaning User opens a browser, Logs into his account and opens a particular page in a new tab in the same browser. As per the default setting the session is shared to the new tab and the user is automatically logged-in to the new tab. Can anyone tell how this can be stopped so I can at least restrict this in few sensitive pages if not the entire application. Usually cookies are used for session handling. Then all tabs and browser windows share the same session. But you can configure your servlet

How to open a link in new tab (chrome) using Selenium WebDriver?

六月ゝ 毕业季﹏ 提交于 2019-11-27 04:25:02
问题 System.setProperty("webdriver.chrome.driver", "D:\\softwares\\chromedriver_win32\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); driver.manage().window().maximize(); driver.get("https://mail.google.com/"); String selectLinkOpeninNewTab = Keys.chord(Keys.CONTROL,Keys.RETURN); driver.findElement(By.linkText("www.facebook.com")).sendKeys(selectLinkOpeninNewTab); New tab is opening but URL link is not opening. 回答1: I

Selenium 2: Open link in new tab and close tabs

我的未来我决定 提交于 2019-11-26 20:18:05
问题 I want to be able to open a link in a new tab in Selenium 2. Also i want to close the tab when i am finished interacting with the page. How is this possible if I have a WebElement of an <a> tag? I am using the Java API of Selenium 2 with the Firefox Driver, running on Firefox 4. 回答1: At the moment, the Selenium WebDriver API doesn't have any way of handling tabs. The project would really need a consistent, cross-browser set of methods for managing tabs before I would expect to see an

Session shared in between tabs

心已入冬 提交于 2019-11-26 14:09:26
问题 I have JAVA web application where I need to stop session being shared between browser tabs, meaning User opens a browser, Logs into his account and opens a particular page in a new tab in the same browser. As per the default setting the session is shared to the new tab and the user is automatically logged-in to the new tab. Can anyone tell how this can be stopped so I can at least restrict this in few sensitive pages if not the entire application. 回答1: Usually cookies are used for session

How can I get the URL of the current tab from a Google Chrome extension?

和自甴很熟 提交于 2019-11-26 11:36:52
I'm having fun with Google Chrome extension, and I just want to know how can I store the URL of the current tab in a variable? Update: The chrome.tabs.getSelected() method is now deprecated. The recommended way of getting the URL of the current tab is to use chrome.tabs.query() . An example usage: chrome.tabs.query({'active': true, 'lastFocusedWindow': true}, function (tabs) { var url = tabs[0].url; }); This requires that you request access to the chrome.tabs API in your extension manifest : "permissions": [ ... "tabs" ] It's important to note that the definition of your "current tab" may

How can I get the URL of the current tab from a Google Chrome extension?

南楼画角 提交于 2019-11-26 02:28:34
问题 I\'m having fun with Google Chrome extension, and I just want to know how can I store the URL of the current tab in a variable? 回答1: Update: The chrome.tabs.getSelected() method is now deprecated. The recommended way of getting the URL of the current tab is to use chrome.tabs.query() . An example usage: chrome.tabs.query({'active': true, 'lastFocusedWindow': true}, function (tabs) { var url = tabs[0].url; }); This requires that you request access to the chrome.tabs API in your extension

How to open link in new tab on html?

好久不见. 提交于 2019-11-26 01:31:44
问题 I\'m working on an HTML project, and I can\'t find out how to open a link in a new tab without javascript. I already know that <a href=\"http://www.WEBSITE_NAME.com\"></a> opens the link in same tab. Any ideas how to make it open in a new one? 回答1: Set the 'target' attribute of the link to _blank : <a href="#" target="_blank" rel="noopener noreferrer">Link</a> Edit: for other examples, see here: http://www.w3schools.com/tags/att_a_target.asp (Note: I previously suggested blank instead of

How to open a new tab using Selenium WebDriver?

梦想的初衷 提交于 2019-11-25 22:43:34
问题 How to open a new tab in the existing Firefox browser using Selenium WebDriver (a.k.a. Selenium 2)? 回答1: The code below will open the link in new Tab. String selectLinkOpeninNewTab = Keys.chord(Keys.CONTROL,Keys.RETURN); driver.findElement(By.linkText("urlLink")).sendKeys(selectLinkOpeninNewTab); The code below will open empty new Tab. String selectLinkOpeninNewTab = Keys.chord(Keys.CONTROL,"t"); driver.findElement(By.linkText("urlLink")).sendKeys(selectLinkOpeninNewTab); 回答2: Just for anyone