Automation can add huge ROI when your script is getting executed multiple times across different browsers and different platforms.While running Selenium script on Edge Browser you might come across a prompt like “Personalise your web experience”. Today we will discuss How To Disable Personalise your web experience Microsoft Edge Prompt In Selenium.
This prompt can create or cause some exception while running the automated test.How To Disable Personalise your web experience Microsoft Edge Prompt In Selenium
If you are completely new to Selenium then do check our post for Selenium. We have covered from basic till advance with video tutorials.
Solution – In order to disable such prompt , we can use guest profile while running the test which should not prompt this option
Step 1- Create object of EdgeOption class
Step 2- Add argument “–guest”
Step 3- Use above EdgeOption while invoking browser.
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.edge.EdgeOptions;
public class SeleniumEdge {
public static void main(String[] args)
{
EdgeOptions opt=new EdgeOptions();
opt.addArguments(“–guest”);
WebDriver driver=new EdgeDriver(opt);
driver.get(“http://www.google.com”);
}
}
Once you execute then you will get browser with guest profile without any prompt.
Feel free to drop an email for any issue or discussion. Email – mukeshotwani@learn-automation.com
Leave a Reply