Telerik Forums
Test Studio Forum
3 answers
379 views
The suggested approach to creating global variable is rather cumbersome and also forces every reference to a global variable to require customize in code.

The approach below uses the SetExtractedValue and GetExtractedValue instead

All references to the variables can be through DataDriven bindings.

  1. Create an XML file

<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);
    }
}




Cody
Telerik team
 answered on 07 Nov 2012
3 answers
135 views
Hello,
I am attempting to open one of the sample projects in VS2010 Express but I am getting the following error:

"C:\Program Files (x86)\Telerik\Test Studio\Samples\Testing Framework\QuickStarts_VSTS_VB\QuickStarts_VSTS_VB.vbproj : error  : The project file 'C:\Program Files (x86)\Telerik\Test Studio\Samples\Testing Framework\QuickStarts_VSTS_VB\QuickStarts_VSTS_VB.vbproj' cannot be opened.

The project type is not supported by this installation."

Any ideas? Thanks for your time.
Plamen
Telerik team
 answered on 07 Nov 2012
3 answers
194 views
Hello,

I have created my first test today! In my app I save a draft Requisition. After saving it I'm presented it's new ID in two pays.

In the url: https://sub.domain.org/Requisition/RequisitionView/2813

And also on the page I have this html element:
<span class="requisitionTitleText">Requisition # 2813:<span class="requisitionDetails"> tt 574 6</span></span>

In the both cases I need to do some "trimming" as it has extra text, for example:
string newReq = "Requisition # 2813:"
newReq = newReq.Replace("Requisition # ","");
newReq = newReq.Replace(":","");

So.. I need to have this ID, in either a text file or in memory, because I have 10+ other tests that will rely on this.

I'm assuming that I need to:
  1. save the id to a local datasource
    How do I do this?
  2. in later tests, reference it like in this article
    http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/data-driven-testing/local-data-driven-test.aspx


Thanks!
Byron
Telerik team
 answered on 06 Nov 2012
2 answers
118 views
All of a sudden my playback speed has dropped considerably. I have not made any changes to my scripts today but yet when I run them there are now seconds between each step when they used to run back to back without pause. Can anyone give me cause to this?
Ivaylo
Telerik team
 answered on 06 Nov 2012
5 answers
103 views
Hi,

I have recurring scheduled run in execution server. I could see waiting test runs (in yellow) in my local machine, but now they are disappeared. In case of updating them, i could just click on them and make my update. Now I cannot see those waiting one, therefore cannot update them. I tried reload from server but it did not reload all of them. 

Do you have any idea why i cannot see waiting runs and how i can update those if i cannot see them?

Thanks

Ercan
Ivaylo
Telerik team
 answered on 06 Nov 2012
3 answers
156 views
Using Telerik Test Studio standalone version 2012.1.7190.
I am running a Test list against all the major browsers. However, the tests are failing because of Chrome Version 22.0.1229.94 m

The actual problem is occurring when the test reaches a specific step, clicks on a link which creates a new tab instead of a pop-up window

This is an example of the link

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;


My work around
            if(ActiveBrowser.BrowserType == BrowserType.Chrome)
            {
                ActiveBrowser.Manager.LaunchNewBrowser(BrowserType.Chrome,false);
                Log.WriteLine("URL of link: " + Pages.PropertyServicesSearch1.LCInventoryLink.HRef);   
                ActiveBrowser.NavigateTo(Pages.PropertyServicesSearch1.LCInventoryLink.HRef);
                ActiveBrowser.WaitForUrl(Pages.PropertyServicesSearch1.LCInventoryLink.HRef,false,30000);  
            }

Unfortunately, the newly launched browser gets stuck at for 30 seconds (30000) at  Preparing browser for automation...

Is there a better way?
Ivaylo
Telerik team
 answered on 05 Nov 2012
9 answers
222 views

Hi,

The scenario I am trying to automate is:

  1. Click on menu. It opens up a pop-up menu having different options listed along with the checkbox for each option.
  2. Select the checkbox for an option.
  3. Selection of check box adds one more option to the same menu called as ‘Apply’. Click the ‘Apply’ option.

Now I am trying to record this scenario using Telerik Test studio. When I am executing the recorded steps, I could successfully select the checkbox from pop-up menu. But after that ‘Apply’ option is not getting added to the same pop-up menu.

Could someone please advise me on how can I deal with the above scenario?

Plamen
Telerik team
 answered on 05 Nov 2012
1 answer
156 views
I want to create coded steps to handle Silverlight elements.
I created following code
SilverlightApp app = ActiveBrowser.SilverlightApps()[0];
But my code can't connect to Silverlight application.
As I understand this is because I have Silverlight application wrapped into iframe.
<DIV style="DISPLAY: none" id=IFRAME_MainDetails_c class="ms-crm-FieldLabel-LeftAlign ms-crm-Field-Normal" sl="false"><LABEL for=IFRAME_MainDetails>MainDetails</LABEL></DIV>
<IFRAME style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-TOP: 0px; BORDER-RIGHT: 0px" id=IFRAME_MainDetails class=ms-crm-Custom tabIndex=1020 src="/TempTestHandover/%7B634871220200000000%7D/WebResources/sitecore_/KpiReports/QualificationRecordMainDetails.html" frameBorder=0 scrolling=no preload="0" url="../webresources/sitecore_ClearBackgroundPage.htm"></IFRAME>

Please provide example of code how could I define IFrame element and then define inner Silverlight application in it.
Cody
Telerik team
 answered on 02 Nov 2012
9 answers
295 views
I am using TelErik Load Test Tool and created a Load Test. It is a simple MVC form with 5 fields. The load test generated a lot of failures.
When i browse the url thru the browser , i get the following message:

Server Error in '/DemoTestAppName' Application.
Sequence contains no elements
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Is there something i need to look at the application level?

Thanks

Ivaylo
Telerik team
 answered on 31 Oct 2012
1 answer
259 views
Test Studio currently has direct support for C# and VB code enhancement.  Are there any plans to add Java support?

What I mean by this is, currently I can export my tests in C# or VB so I can work with them in Visual Studio.  I can also add code directly in both C# and VB.

Is Telerik looking at incorporating Java as an additional language option?

Thank you,
Mike
Cody
Telerik team
 answered on 31 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?