Telerik Forums
Test Studio Forum
1 answer
63 views
I want to verify in a step, that the forgroundcolor in a silverlight application textblock is orange.
I cannot find the Property color or similar to this in the verify box.

How can I access the color of a textblock in Silverlight via Teststudio or via code?

Best regards,
Adriane
Anthony
Telerik team
 answered on 06 Jun 2012
2 answers
114 views
Hi,

I am having trouble understanding how Assert() works.  Essentially, the below VB subroutine attempts to find out if an HTML table is displaying a particular table cell after entering a search string into an interactive search field (the search occurs automatically without needing to press a [Go] button).  If the table cell is not present then the routine presses a screen button [Add].  If it is present then the routine clears the search field ready for a new search.

Public Sub sa_SetupLookups_SetLookupTextItems()
    Dim row As Integer
    Dim col As Integer
    Dim minCol As Integer = 3   'First column for lookupText values, column C
    Dim maxCol As Integer = 11  'Last column for lookupText values, column K
    Dim input As String = "C:\Users\edwardni\Documents\Test Studio Projects\Accelerate\Data\AccelerateData.xlsx"
    Dim app As New Microsoft.Office.Interop.Excel.Application()
    'Dim inputBook As Microsoft.Office.Interop.Excel.Workbook = app.Workbooks.Open(input, 0, False, 5, "", "", False, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "", True, False, 0, True, False, False) 'This is write
                                                                                         'Object UpdateLinks, Object ReadOnly, Object Format, Object Password, Object WriteResPassword, Object IgnoreReadOnlyRecommended, Object Origin, Object Delimiter, Object Editable, Object Notify, Object Converter, Object AddToMru, Object Local, Object CorruptLoad)
    Dim inputBook As Microsoft.Office.Interop.Excel.Workbook = app.Workbooks.Open(input, 0, True, 5, "", "", False, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "", True, False, 0, True, False, False)    'This is read-only
    Dim inputSheet As Microsoft.Office.Interop.Excel.Worksheet = DirectCast((inputBook.Worksheets.Item("Lookups")), Microsoft.Office.Interop.Excel.Worksheet)
    Dim theLookupCode As Object = GetExtractedValue("CodeText")
    Dim lookupCode As String = theLookupCode.ToString().Trim()
    Dim lookupText As String
    Dim NoMatchingTableCell As HtmlTableCell = Pages.LookupEdit.NoMatchingTableCell
 
    Select Case lookupCode
        Case "City"
            row = 2
        Case "CompanyType"
            row = 3
        Case "ContactType"
            row = 4
        Case "DataSourceType"
            row = 5
        Case "DataType"
            row = 6
        Case "IndustryType"
            row = 7
        Case "SalutationType"
            row = 8
        Case "Screen"
            row = 9
        Case "Size"
            row = 10
        Case "CategoryType"
            row = 11
        Case "PriorityType"
            row = 12
        Case "ProjectClientsType"
            row = 13
        Case "SeverityType"
            row = 14
        Case "StatusType"
            row = 15
        Case Else
            row = 999
    End Select
 
    If (row <> 999) Then
        For col = minCol to maxCol
            lookupText = TryCast(DirectCast(inputSheet.Cells(row, col), Microsoft.Office.Interop.Excel.Range).Text, String)
             
            Log.WriteLine("DEBUG LINE theLookupCode: " + theLookupCode.ToString())
            Log.WriteLine("DEBUG LINE lookupCode: " + lookupCode.ToString())
            Log.WriteLine("DEBUG LINE row: " + row.ToString())
            Log.WriteLine("DEBUG LINE col: " + col.ToString())
            Log.WriteLine("DEBUG LINE lookupText: " + lookupText.ToString())
             
            If (lookupText = ".") Then
                Exit For
            Else
                'Search table to see if lookupText already exists
                Pages.LookupEdit.Text.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop)
                ActiveBrowser.Window.SetFocus
                Pages.LookupEdit.Text.MouseClick
                Manager.Desktop.KeyBoard.TypeText("", 50, 100)  'Clear search field of any pre-existing text
                System.Threading.Thread.Sleep(1000) 'Give table time to repopulate
                Pages.LookupEdit.Text.MouseClick
                Manager.Desktop.KeyBoard.TypeText(lookupText, 50, 100)   'Enter value held in lookupText (e.g. London) in 'Text'
                System.Threading.Thread.Sleep(1000) 'Give table time to complete the search
                 
                NoMatchingTableCell.Wait.ForExists(10000)
 
                If (Assert.IsTrue(NoMatchingTableCell.IsVisible) = True) Then
                    'lookupText already exists, so empty the search field ready for the next
                    Pages.LookupEdit.Text.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop)
                    ActiveBrowser.Window.SetFocus
                    Pages.LookupEdit.Text.MouseClick
                    Manager.Desktop.KeyBoard.TypeText("", 50, 100)
                    System.Threading.Thread.Sleep(1000)
                Else
                    Pages.LookupEdit.AddSpan.Click(false)
                    Pages.AddNewLookupItem.HtmlTag.BaseElement.Wait.ForCondition(Function(a_0, a_1) ArtOfTest.Common.CompareUtils.StringCompare(a_0.InnerText, "Add New Lookup Item", ArtOfTest.Common.StringCompareType.StartsWith), false, Nothing, 10000)
                    Pages.AddNewLookupItem.CultureBasedTextTextText.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop)
                    ActiveBrowser.Window.SetFocus
                    Pages.AddNewLookupItem.CultureBasedTextTextText.MouseClick
                    Manager.Desktop.KeyBoard.TypeText(lookupText, 50, 100)   'Add the new lookupText
                    Pages.AddNewLookupItem.ItemIsActiveCheckBox.Check(true, true)   'Check 'ItemIsActiveCheckBox' to be 'True'
                    Pages.AddNewLookupItem.Submit.Click(false)  'Click 'Submit' (Save button)
                End If
            End If
        Next col
    End If
    'All required text entries for the supplied lookupCode have been made, so exit back to the main Lookups screen
    Pages.LookupEdit.BackToListSpan.Click(false)
     
    'Free up resources:
    row = Nothing
    col = Nothing
    minCol = Nothing
    maxCol = Nothing
    input = Nothing
    app = Nothing
    inputBook = Nothing
    inputSheet = Nothing
    lookupText = Nothing
    theLookupCode = Nothing
    lookupCode = Nothing
    NoMatchingTableCell = Nothing
 
    'Close Excel, preventing any Save prompt, & free up the process
    inputBook.Saved = True
    app.Quit()
    app = Nothing
End Sub

When I execute this it fails on the first loop through, on the line:
          If (Assert.IsTrue(NoMatchingTableCell.IsVisible) = True) Then

Clearly I have not understood how the Assert statement works.  Please would someone help by reviewing the above VB subroutine and advise where I have gone wrong, or suggest a better alternative.

Many thanks,
Nigel Edwards, Transition Computing. 
Nigel
Top achievements
Rank 2
 answered on 06 Jun 2012
3 answers
105 views

I've been testing the manual testing features of test studio. I noticed some things that didn't seem right to me when I create and ran a manual test.


Setting Up A Manual test
1. It appears that the instructions for the test can only be stored for the entire test. I want to put screen captures and notes on each step. How do I do this?
2. Why can't I have a storyboard for a manual test?

Executing a Manual Tests.
1. It appears you can not delete a screen capture on a step. You can only save over the top? How do I delete one?
2. The screen capture tool isn't very good.  I would rather use snagit to capture screenshots and paste the capture into the step test - I can't seem to do that - why?
3. How do I see the results of a manual test that includes the screen shots that were taken during the test run? I see no way to do this.
Byron
Telerik team
 answered on 05 Jun 2012
2 answers
162 views
Hello,

Our dev team recently updated the Scheduling page in our application to use a RadScheduleView instead of a Radscheduler.  This has broken most of our tests that were written to work with the radscheduler and we are working through the issues to fix them.  This post is to ask you about one of the issues.

One of our tests was creating an appointment by selecting a specific row in the Scheduler view and then invoking the Create Appointment command from the right-mouse menu associated with that row (the time slot values are used to populate the Time fields in the dialog that shows up).  

The selected row was computed based on the desired time (which was one of about 6 possible values that the test would pick from in each run).  Here is the code:

[CodedStep(@"RightClick on Item250Border", RequiresSilverlight = true)]
public void CreateAppointment_CodedStep()
{
    //declare variables and set to null
    int beforeAppCount = Convert.ToInt16(GetExtractedValue("BeforeAppointmentCount")); //before count
    int appTimeIndex = beforeAppCount % 5;
    // Appointment start times will cycle between 10:00 AM, 1:00 pm, 2:00pm, 3:15 PM and 4:00 PM
    switch (appTimeIndex)
    {
        case 0:
            // RightClick on Item154Border - 10:00 am
            Log.WriteLine("Creating appointment at 10:00 AM");
            Pages.QAAUTOSYNC1228183918.SilverlightApp.Item154Border.User.Click(ArtOfTest.WebAii.Core.MouseClickType.RightClick, 100, 45, ArtOfTest.Common.OffsetReference.TopLeftCorner, ArtOfTest.Common.ActionPointUnitType.Percentage, ((System.Windows.Forms.Keys)(0)));
            break;
        case 1:
            // RightClick on Item202Border - 1:00pm
            Log.WriteLine("Creating appointment at 1 PM");
            Pages.QAAUTOSYNC1228183918.SilverlightApp.Item202Border.User.Click(ArtOfTest.WebAii.Core.MouseClickType.RightClick, 99, 55, ArtOfTest.Common.OffsetReference.TopLeftCorner, ArtOfTest.Common.ActionPointUnitType.Percentage, ((System.Windows.Forms.Keys)(0)));
            break;
        case 2:
            // RightClick on Item218Border - 2:00pm
            Log.WriteLine("Creating appointment at 2 PM");
            Pages.QAAUTOSYNC1228183918.SilverlightApp.Item218Border.User.Click(ArtOfTest.WebAii.Core.MouseClickType.RightClick, 99, 30, ArtOfTest.Common.OffsetReference.TopLeftCorner, ArtOfTest.Common.ActionPointUnitType.Percentage, ((System.Windows.Forms.Keys)(0)));
            break;
        case 3:
            // RightClick on Item238Border - 3:15pm
            Log.WriteLine("Creating appointment at 3:15 PM");
            Pages.QAAUTOSYNC1228183918.SilverlightApp.Item238Border.User.Click(ArtOfTest.WebAii.Core.MouseClickType.RightClick, 99, 40, ArtOfTest.Common.OffsetReference.TopLeftCorner, ArtOfTest.Common.ActionPointUnitType.Percentage, ((System.Windows.Forms.Keys)(0)));
            break;
        case 4:
            // RightClick on Item250Border -  4:00pm
            Log.WriteLine("Creating appointment at 4 PM");
            Pages.QAAUTOSYNC1228183918.SilverlightApp.Item250Border.User.Click(ArtOfTest.WebAii.Core.MouseClickType.RightClick, 100, 40, ArtOfTest.Common.OffsetReference.TopLeftCorner, ArtOfTest.Common.ActionPointUnitType.Percentage, ((System.Windows.Forms.Keys)(0)));
            break;
        default:  // this code should never be executed as long as the number of appointment time options is 3
            // RightClick on Item154Border - 10:00 am
            Log.WriteLine("Creating appointment at 10 AM (default)");
            Pages.QAAUTOSYNC1228183918.SilverlightApp.Item154Border.User.Click(ArtOfTest.WebAii.Core.MouseClickType.RightClick, 100, 45, ArtOfTest.Common.OffsetReference.TopLeftCorner, ArtOfTest.Common.ActionPointUnitType.Percentage, ((System.Windows.Forms.Keys)(0)));
            break;
    }               
}

The above code worked with the Radscheduler because each row was associated with a different Border object (which was enclosed in a TimeSlotItem object).  However, I am finding that is not the case with the Radscheduler view.  When I record the right mouse click (prior to taking it to code), I seem to be getting the same id no matter which row I pick. 

When I look at the DOM, I don't see Border elements for any of the rows - instead I am seeing TimeRulerLine elements inside a TimeRulerLinesPanel element.  Each of the TimeRuler elements does have a Border element - but the recorder is apparently not finding them or not seeing them as different objects.

Question:  Given the above, is it possible to replicate the test functionality (as it worked with Radscheduler) to work with Radscheduleview?  If so, what do I need to do?

Attached are snapshots of the scheduler page with Radscheduleview (radschedulerview.jpg) and radscheduler (radscheduler.jpg) with the respective DOM shown alongside.

I appreciate your help in this regard.  A prompt response would be very much appreciated as the test in question is a smoke test and needs to be fixed as soon as possible.  Please let me know if you have further questions.

Thanks,
Shashi  
Cody
Telerik team
 answered on 04 Jun 2012
4 answers
189 views
Hi,

I want to do this steps:
Navigate on a silverlight webapplication site. Click Search Button.
I get one result.
On the resultview I can see a textblock. Now I want to save the data from this textblock in a variable.
Do some other background steps.
Go again on the webapplication, search, get one result.
Now I want to verify, that the text is not the same as before.

My question is, how can I save the value from the textblock in a variable and verify it later?

As I recorded the test, I can access the Textblock, but did not find a way to save the value from the text with the Telerik GUI elements.
So I think I need to access it via code and save it in this step, where I can see it, right?
But how can I access the textblock from the code to do so?

There is one button "Add to project elements" to put the element in the elementsTree. I tried this one, and then tried to access in the next code step via
string sjobid = Pages.VPMSMediaCenter.SilverlightApp0.sjobidTextblock.Text;


But as I play the test, I got the error message:

Exception thrown executing coded step: '[AF001_QA001_Umbenennung_CodedStep1] : Save SJobID in variable'.
InnerException:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at ArtOfTest.WebAii.Silverlight.SilverlightAppsList.get_Item(Int32 index)

I am new to Telerik Teststudio, maybe there is a explanation (didn't find it in forum/documentation) somewhere?
Or someone can help me here?

Best regards,
Adriane
Adriane
Top achievements
Rank 1
 answered on 04 Jun 2012
3 answers
49 views
Hi all
I need find hidden control and perform action click
I customized as attachment
But it's not running on firefox
Please refer attachment

Thanks
Plamen
Telerik team
 answered on 04 Jun 2012
1 answer
71 views
Hi

I'm looking at the Telerik test scheduler, I haven't got multiple machines available as of right now. So i can't test it my self, but i expect it to be a trivial question:.

When i select a test list and schedule the running and select multiple execution agents will it then:

A: Select the first available agent and complete the entire list against that agent
B: Distribute the tests across the agents for optimal execution speed?

So basically if i get 3 agents and want to utilize them all do i need 3 tests lists setup to run at the same time or do i need 1 big setup to run against all 3 agents?


I'm asking because I'm unsure if i will win anything by buying access to test studio(currently using the framework) over just creating my own test lists and some schedules windows tasks to execute the tests with MSTest.

Looking forward to your answer.
Stoich
Telerik team
 answered on 31 May 2012
3 answers
75 views
Hi all
After I recorded verify step on IE
I run it on firefox but it's not running because encode of string
I corrected :  Pages.InachisHardwareAndChannels0.StartNbspMarkLabelTag.AssertContent().TextContent(ArtOfTest.Common.StringCompareType.Contains, WebUtility.HtmlDecode("Start&nbsp;Mark"));
But it don't run.

Please refer attachment
Thanks so much
Stoich
Telerik team
 answered on 31 May 2012
1 answer
61 views

Hi Guys,

I'm writing the same issue for the third time.

 1. "File Download" window is not been detected by the "Test Studio". As per the user guide, i tried with "Handle DOwnload Dialogue" and changed the necessary things in "Properties Pane". But still it is not been detected by the Test STudio. In my previous thread i have attached the defect log too.

 2. This is a new issue which i faced yesterday. This is something to do with "AJAX". In my screen, there are two drop downs "Sales Company" & "Warehouse". After the "Sales Company" option is selected, the "Warehouse" drop down will be populated based on the option selected in the "Sales Company". I tried the steps mentioned in the video available in the "Telerik TV", by changing the role of "Verification" to "Wait" but still it is throwing error.

I will be thankful if you help me in resolving in these issues.

Byron
Telerik team
 answered on 31 May 2012
3 answers
165 views
Hi,

Is it possible to compare a data driven value with an extracted value without going into the code behind window?

For Instance, I have a data driven test that wants to check the value of a particular field and then write to the field depending on what value is already present.  The method would be to extract the current value into an extracted variable $(MyExtractedValue), then compare it with the value that is held in the data $(MyDataValue).  So far I have not found a way to do this without going into VB.

Thanks,
Nigel Edwards, Transition Computing.
Shashi
Top achievements
Rank 1
 answered on 31 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?