Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml chrome浏览器中未加载数据,但Firefox浏览器中正在加载数据_Xml_Selenium_Testng - Fatal编程技术网

Xml chrome浏览器中未加载数据,但Firefox浏览器中正在加载数据

Xml chrome浏览器中未加载数据,但Firefox浏览器中正在加载数据,xml,selenium,testng,Xml,Selenium,Testng,我试图同时在不同的浏览器中运行测试用例,但在执行此操作时,chrome浏览器正在打开,但数据未在同一firefox浏览器打开时加载,数据也在加载 试图打开gmail.com页面 在testng.xml下面: }显示您的代码您是如何创建drivers@karthikashoka同时运行测试用例是什么意思。你是在尝试并行运行吗。如果是这样,我在testng.xml文件中没有看到类似的内容。 <test name="ChromeTest"> <parameter n

我试图同时在不同的浏览器中运行测试用例,但在执行此操作时,chrome浏览器正在打开,但数据未在同一firefox浏览器打开时加载,数据也在加载

试图打开gmail.com页面

在testng.xml下面:


}

显示您的代码您是如何创建drivers@karthikashoka同时运行测试用例是什么意思。你是在尝试并行运行吗。如果是这样,我在testng.xml文件中没有看到类似的内容。
 <test name="ChromeTest"> 
     <parameter name="browser" value="Chrome" />
     <classes>
     <class name="website.Hello" /> 
     </classes>
 </test>

 <test name="FirefoxTest">
     <parameter name="browser" value="firefox" /> 
     <classes>
     <class name="website.Hello" />
     </classes>
 </test>
public class BaseTest {  

    WebDriver driver;

    @BeforeTest

    @Parameters("browser")

    public void setup(String browser) throws Exception{

        //Check if parameter passed from TestNG is 'firefox'

        if(browser.equalsIgnoreCase("firefox")){

        //create firefox instance

            driver = new FirefoxDriver();

        }

        //Check if parameter passed as 'chrome'

        else if(browser.equalsIgnoreCase("chrome")){

            //set path to chromedriver.exe You may need to download it from http://code.google.com/p/selenium/wiki/ChromeDriver

            System.setProperty("webdriver.chrome.driver","D:\\DesktopFrameWork\\WatchableDesktop\\resources\\chromedriver_Windows.exe");

            //create chrome instance

            driver = new ChromeDriver();

           // driver = new ChromeDriver(options);
            driver.manage().window().maximize();
            driver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);
            driver.manage().deleteAllCookies();

        }

        else{

            //If no browser passed throw exception

            throw new Exception("Browser is not correct");

        }

        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

    }