0

I have a couple issues when I run the test with edge web browser. The first issue is that every time I run the test by run as > testng test , the automation will close all the existing open edge web browser and then it will open a brand new edge browser but it is blank (could not load the url) The second issue is that the automation would only load the url if I manually close all of the existing edge browser.

Is there a way to fix these issues? please help me thank you in advance.

Here is my code public class OpenThePageUsingEdge {

public String baseUrl = "https://catalog-qa.baylorgenetics.com/search";
String driverPath = "C:\\Eclipse\\MicrosoftWebDriver.exe";
public WebDriver driver ;
//initiate NameofInsured as the GenerateData class
//GenerateData NameOfAddrecipients;

@BeforeTest 
public void setup(ITestContext ctx) {
    TestRunner runner = (TestRunner) ctx;
    runner.setOutputDirectory("J:\\zzQA Selenium Automation Suite\\Test Results");
}


@Test
public void openThePageusingEdge () throws InterruptedException {
     System.out.println("launching Edge browser"); 
     System.setProperty("webdriver.edge.driver", driverPath); 
     driver = new EdgeDriver();
     driver.get(baseUrl); 
     driver.manage().window().maximize();

     driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
TylerH
  • 20,799
  • 66
  • 75
  • 101
  • 1
    Do u quite driver @AfterTest? – IPolnik Sep 18 '19 at 20:54
  • Can you please inform us which version of MS Edge you are using for making this test? If you are using any older version than please try to update your Edge to latest version. Also try to use the latest version of Edge driver. for testing purpose create a new program with only this code to check whether it is working or not. System.setProperty("webdriver.edge.driver", "driver/MicrosoftWebDriver.exe"); WebDriver driver = new EdgeDriver(); driver.get("www.site.com"); Let us know about your testing result. – Deepak-MSFT Sep 19 '19 at 05:53
  • share your afterclass, after test methods, give us more info /code ......good luck – Mike ASP Sep 19 '19 at 06:29
  • i am using Microsoft Edge 44.18362.267.0 , Microsoft EdgeHTML 18.18362 – SeleniumNewbie Sep 19 '19 at 12:45
  • If you see this link https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ you can notice that web drivers are only available till the Edge 17. you are using Edge 18. after Edge 18 it is consider as feature on demand and you just need to enable it on your machine. so it looks like you are using the older version of web driver for your Edge 18. I suggest you to use the latest and compatible web driver with your edge browser may help to fix this issue. – Deepak-MSFT Oct 01 '19 at 08:33

0 Answers0