<GlobalValues>
<GlobalValue>
<TelerikHomeFirstname>"Michael"</TelerikHomeFirstname>
<TelerikOwnerSurname>"Jackson"</TelerikOwnerSurname>
<TelerikHomeEmailAddress>"Neverland Ranch"</TelerikHomeEmailAddress>
<TelerikNickName>"King of POP"</TelerikNickName>
<TelerikURL>"http://google.com/"</TelerikURL>
<TelerikDBUsername>"telerik"</TelerikDBUsername>
<TelerikDBPassword>"TelerikPassword"</TelerikDBPassword>
<TelerikDBDatabase>"telerikdb"</TelerikDBDatabase>
<TelerikCheckCountUsername>"tlk"</TelerikCheckCountUsername>
<TelerikCheckCountPassword>"password"<TelerikCheckCountPassword>
</GlobalValue>
</GlobalValues>
Add a new Script Step. In the OnBeforeTestStarted method
add the following code
public override void OnBeforeTestStarted()
{
string globalVarsFile = @"c:\<path>\myglobalvarsfile.xml";
try
{
if(!File.Exists(globalVarsFile))
{
// an error has occurred
Log.WriteLine("Error: FILE" + globalVarsFile + "DOES NOT EXIST");
Assert.IsTrue(false);
}
else
{
Log.WriteLine("File found" +globalVarsFile);
}
XDocument globalVarsXML = XDocument.Load(globalVarsFile);
var queryResult =
from gl in globalVarsXML.Element("GlobalValues").Element("GlobalValue").Elements()
select gl;
foreach(XElement x in queryResult)
{
SetExtractedValue(x.Name.ToString(), x.Value.ToString());
}
}
catch(FileNotFoundException fnfe)
{
Log.WriteLine("IO Error occurred: " + fnfe.Message);
}
catch(IOException ioex)
{
Log.WriteLine("IO Error occurred: " + ioex.Message);
}
}
<
span
class
=
"requisitionTitleText"
>Requisition # 2813:<
span
class
=
"requisitionDetails"
> tt 574 6</
span
></
span
>
string
newReq =
"Requisition # 2813:"
newReq = newReq.Replace(
"Requisition # "
,
""
);
newReq = newReq.Replace(
":"
,
""
);
HtmlAnchor:<a href="http://www.google.co.uk" target="_blank">
The code cannot be changed and because "_blank" is not guaranteed to be a new tab or window. It's implemented differently per-browser. I have implemented the workaround below;