I am working on Salesforce automation. There is a scenario which uses the one time sign on:
- I will log in to Salesforce application;
- Open a new tab and click on login with Salesforce account;
- Upload the excel and switch back to Salesforce tab.
I am able to login in Salesforce application but unable to open a new tab I have already tried below solution:
Solution 1:
Actions act = new Actions(driver);
act.keyDown(Keys.CONTROL).sendKeys("t").keyUp(Keys.CONTROL).build().perform();
Solution 2:
Robot robot=new Robot();
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_T);
Solution 3:
String KeyString = Keys.CONTROL+"t";
driver.findElement(By.tagName("body")).sendKeys(KeyString);
Solution 4:
driver.findElement(By.cssSelector("body")).sendKeys(Keys.CONTROL+"t");
Has anyone faced issue? What could be the possible solution for this?