When i click on copy link it means url is copied , then open new tab and paste the copied url in new tab using selenium webdriver. Below code is working in windows not in mac. when i used this code in mac system, some java software icon is coming in taskbar. Attached screenshot for your reference.Java software icon in right corner and application screenshotError in console
My Code:
String element=Util.OR_VF_MY_ACCOUNT_PAGE.getProperty("myAccountPageCopyUrlLinkInWishList");
$(element).click();
winHandleBefore= getDriver().getWindowHandle();
Set<String> handles = getDriver().getWindowHandles();
//getDriver().findElement(By.cssSelector("body")).sendKeys(Keys.CONTROL +"t");
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_T);
robot.keyRelease(KeyEvent.VK_T);
robot.keyRelease(KeyEvent.VK_CONTROL);
for(String windowHandle : handles)
{
if(!windowHandle.equals(winHandleBefore))
{
getDriver().switchTo().window(windowHandle);
}
}
Util.pause(4);
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_V);
robot.keyRelease(KeyEvent.VK_V);
robot.keyRelease(KeyEvent.VK_CONTROL);
Util.pause(4);
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
Util.pause(4);