locked
Visual studio load Test Fails to source the xml Input Files used in Selenium RRS feed

  • Question

  • Hi 

    I have my Unit Test with Selenium. I source some xml (Test Input) files before executing the Test case 

    When i run Load Test with my Selenium Testcases, it throws FileNot foundException for those XML files. 

    I came to know that these xml files should be deployed in Cloud. I would like to know how to deploy in cloud 

    Thanks


    Monday, March 20, 2017 10:24 AM

Answers

  • Hi Jesintha,

    If my reply help you resolved your issue, please remember to mark it. Thank you very much.

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Jesintha Thursday, March 23, 2017 12:25 PM
    Thursday, March 23, 2017 9:02 AM

All replies

  • Hi Jesintha,

    Welcome to the MSDN forum!

    According to your description, you are running cloud-based load tests, and there a unit tests in it, am I right?

    >> When i run Load Test with my Selenium Testcases, it throws FileNot foundException for those XML files

    Please make sure that the unit test run locally is correct.

    If it throws: “XMLFile1.xml did not get deployed”, please try annotating your test with the DeploymentItemAttribute:

    https://msdn.microsoft.com/en-us/library/ms182475.aspx  

    Here's a code snippet from the documentation:

    [TestClass]  
    class TestClass1  
    {  
      [TestMethod]  
      [DeploymentItem("source", "targetFolder")]  
      public void Test1()  
      {  
        string testData = System.IO.File.ReadAllText(@"targetFolder\source");  
        ...  
      }
    }  

     

    Best Regards,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Oscar_Wu Tuesday, March 21, 2017 5:31 AM
    Tuesday, March 21, 2017 5:29 AM
  • Hello Oscar 

    Thanks for the Reply

    I Added Deployment Tag in my TestClass as  

        [TestClass]
        [DeploymentItem("C:\\TFS\\Product\\Source\\Dev\\Projects\\Tests\\Regression\\Eus.CTM.RegressionTests\\Core\\TestData")]
        [DeploymentItem("C:\\TFS\\Product\\Source\\Dev\\Projects\\Tests\\Regression\\Eus.CTM.RegressionTests\\Core\\PageDictionaries")]

    When i Run my load test in Cloud I get this Exception 

    Test Error TestError 1 000 Initialization method Eus.CTM.RegressionTests.Core.TestData.Ted_load.Init threw exception. System.IO.FileNotFoundException: System.IO.FileNotFoundException: d:\0\td\a6f89\TestRun\Out\TestData : No such file or directory.

    My files are not copied. I would like to Know the file structure in cloud 


    Wednesday, March 22, 2017 8:51 AM
  • Hi Jesintha,

    Please try to use testsettings file to specify the file, please refer to the following screenshot:


    >>System.IO.FileNotFoundException: System.IO.FileNotFoundException: d:\0\td\a6f89\TestRun\Out\TestData

    whether you have specified this folder as output file? Please let me know.

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, March 22, 2017 9:11 AM
  • Yes  , i have my Directories in the Deployment section on Test Settings File

    like 

    <solution Directory>\Tests\Regression\Eus.CTM.RegressionTests\Core\TestData

    <solution Directory>\Tests\Regression\Eus.CTM.RegressionTests\Core\PageDictionaries

    Wednesday, March 22, 2017 9:46 AM
  • Hi Jesintha,

    when you run the test please specify this testsettings file. And please use MSTest to run load test.

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, March 22, 2017 9:49 AM
  • Hello  Oscar 

    You mean Microsoft Test manager ? 

    I am running my MSTest(Unit Test) with Visual studio IDE 

    Thanks

    Jesi

    Wednesday, March 22, 2017 10:01 AM
  • Hi Jesintha,

    In my side, I could deploy any folders and files with testsettings file without any problems. So I suggest you could create a new unit test project and specify a testsettings file to see again in VS IDE.

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Oscar_Wu Thursday, March 23, 2017 6:48 AM
    • Proposed as answer by Oscar_Wu Thursday, March 23, 2017 9:03 AM
    Thursday, March 23, 2017 6:48 AM
  • Thanks Oscar. It works!

    Thursday, March 23, 2017 9:01 AM
  • Hi Jesintha,

    If my reply help you resolved your issue, please remember to mark it. Thank you very much.

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Jesintha Thursday, March 23, 2017 12:25 PM
    Thursday, March 23, 2017 9:02 AM