How to handle browser level notification using Selenium Webdriver

前端 未结 6 2203
Happy的楠姐
Happy的楠姐 2020-12-17 22:03

I am Automating some test cases using Selenium Webdriver and core Java,in chrome browser for one test case on clicking button I am getting browser level notification \'Show

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-17 22:48

    Steps to handle this type of requirements:

    1. Open Firefox Profile manager (Go to Start Menu, Type firefox.exe -p to launch profile manager)
    2. Create a new Profile (Ex. name of Profile is customfirefox)
    3. Navigate to about:permissions
    4. Do the required configurations and Save the Profile

    Now use the newly created Profile to run your test by invoking the Firefox

    ProfilesIni ffProfiles = new ProfilesIni();
    FirefoxProfile profile = ffProfiles.getProfile("customfirefox");
    WebDriver driver = new FirefoxDriver(profile);
    

    This will always use the firefox with the custom configurations saved on the profile.

    Hope this works for you..!!!

    Good luck.

提交回复
热议问题