This is a migrated thread and some comments may be shown as answers.

read specific value from XML file

1 Answer 141 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jurij
Top achievements
Rank 2
Jurij asked on 23 Sep 2015, 08:30 AM

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

1 Answer, 1 is accepted

Sort by
0
Jurij
Top achievements
Rank 2
answered on 23 Sep 2015, 09:11 AM

Never mind, found it:

string testCase = Data["ssoLogin "];

 BR, Jurij

Tags
General Discussions
Asked by
Jurij
Top achievements
Rank 2
Answers by
Jurij
Top achievements
Rank 2
Share this question
or