read specific value from XML file

2 posts, 0 answers
  1. Jurij
    Jurij avatar
    54 posts
    Member since:
    Sep 2013

    Posted 23 Sep 2015 Link to this post

    I have a XML file with all the values I need for data driven test. Now I can't figure out how can I read one specific value from XML file, which I would use in coded step. For example if I create extracted step and then GetExtractedValue in the code, I can save this value as a string and use it in the code. Now I want the same, but this time I want to use a specific value from XML file. I have data binded XML file to the test case, but how can I now read only the value I need?

    Snippet of the XML file is as follows:

     <events>
    ​...
    <event keyword="Test ​event" eventName="Test ​Event 2014" ssoUrl="https://<domain>/&#63;guid&#61;<something>&#38;number&#61;1&#38;username&#61;​<username>" ssoLogin="<domain>/?token=" />
    </events>

    From the XML file I would like to read ssoLogin value and use it in the code as a string.

    BR, Jurij

  2. Jurij
    Jurij avatar
    54 posts
    Member since:
    Sep 2013

    Posted 23 Sep 2015 in reply to Jurij Link to this post

    Never mind, found it:

    string testCase = Data["ssoLogin "];

     BR, Jurij

Back to Top