Telerik Forums
Test Studio Forum
3 answers
141 views

Hi Telerik Team,

Scenario to automate:

User creates few objects in application under test. The names of these objects could be anything which user specifies.

On some different page of the application I am having a HTML list box of type SELECT. This list gets populated with the object names which  user have created previously. Here I want to select the multiple options from the list. I will be specifying the options to select as a comma separated list in the Excel column.

I have done it using a coded step. I would like to avoid the coded step. So I would like to know, if there is a way I can do it without coded step?

Code for the current coded step:

// Read the options from input Xls file and make a list from comma separted values
List<string> optionsToSelect = Data["ListOptions"].ToString().Split(new char[]{','},
    StringSplitOptions.RemoveEmptyEntries).ToList<string>();
var lstBoxTestOptionsSelection = Pages.Page1.FrameFrame00.lstBoxAvailableOptions;
// Select the given options from the listbox
foreach(string strOption in optionsToSelect)
{
    foreach(HtmlOption option in lstBoxTestOptionsSelection.Options)
    {
        if(strOption.Equals(option.Text))
        {
            // Get the index of the option from listbox
            Log.WriteLine(option.Text); 
            var indexToSelect = lstBoxTestOptionsSelection.Options.IndexOf(option);
            Log.WriteLine("Index: " + indexToSelect);
            // Select the option from listbox
            lstBoxTestOptionsSelection.SelectByIndex(indexToSelect);
            // There is another list to which I need to add the selected items so clicking on Add button.
            // Click on Add button to the other list box where we are kepping the selected items
            Pages.Page1.FrameFrame00.BtnAddRSDiv.Click();
            break;
        }
    }
    lstBoxTestOptionsSelection = Pages.Page1.FrameFrame00.lstAvailableRSSelect;
}

Cody
Telerik team
 answered on 26 Apr 2012
4 answers
198 views
Hi, I am fairly new to using Test Studio and am still in the trial version. I am trying to evaluate Test Studio on a web application that we are going to use and are looking for an automation tool to implement. 
         The test i am using is a data driven test and most of the fields in the application are drop-downs. So i need to read through one of my drop-down selection, and based on the value selected in the drop-down, i need to run through certain fields. I tried  to use the extract selection and get the value of the drop down into a databind variable and then assign that to a variable which i tried to use in the IF statement but i am getting a "Object reference not set to an instance of an object. at ArtOfTest.WebAii.Design.Execution.ExecutionUtils.WaitForAllElements(IAutomationHost host, AutomationDescriptor descriptor, Int32 timeout). at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)"
          Can you please provide me any input on how to clear this issue?

Thanks,
Nithu

Nithu
Top achievements
Rank 1
 answered on 26 Apr 2012
3 answers
124 views
Good morning,

I have installed the trial version of WebUI Test Studio. At first I was experiencing extremem slowness when recording from my secure web application, so we bumped up my RAM. That seemed to help the automation piece. When I am done recording I return to the Test Studio to save and execute my test. My current test fails because it does not recognize the text I am inserting into my User Name field. So, when I return to WebUI Test Studio to edit my test, at this point my system completely freezes.....I have to Ctrl-Alt-Delete to break free, and do a Restart everytime. This, of course, is very frustrating, and I have not been able to determine what is the cause of this.

Can you assist with the system hanging?

Also, another issue I'm having is my playback not recognizing the fact that I've entered text in my User Name field. At first, it wouldn't even recognize the fact that I was in that field, so I worked around that by tabbing past that field to the next field, then tabbing back to my User Name field. Doing this in my recording at least allowed the playback to acknowledge that I was in the User Name field. So once I have tabbed back to get to the first field on the page, I enter my user name, and continue recording. Once I stop recording and return to Test Studio and execute, it still does not record that I actually put test in that field........when I first tabbed out of the field the recorded test indicates it was in the right field name, but when I actually enter text into that field, the recording automatically changes the name of the placeholder for the text. Is this possible a compatability issue with Infragistics controls?

Any assistance would be greatly appreciated!

Kay
Anthony
Telerik team
 answered on 25 Apr 2012
3 answers
135 views
I use version QA test studio.
I want to verify inputted data with data in excel data source
I use data driven but it's fail at verify steps
Detail:
1- Create test [login]
2- Create test [add N sheet] : i bind data for step [enter text] and step [verify text content]
3- Create test consist of [loign], [add N sheet] as [Test as step]
==> Result: fail at step 2, expected value is different from actual value. Actual value is not the  same data souce

******
Message
Unable to locate element. Details: Attempting to find [Html] element using
Find logic
 (Html): [id 'Exact' sheets_sortable][tagIndex 'Exact' p:12]

Unable to locate element. Search failed!
*******

Please help me. Thanks


Plamen
Telerik team
 answered on 25 Apr 2012
4 answers
148 views
Hi,
I need to log on to windows as different users, but the Handle logon dialog step only enters the password for the current user.
In the Windows operating system logon box (Net logon) I've recorded clicking 'Use another account', then entering the new userid and password, and ticking the 'Remember my credentials' checkbox, but twhen played back the Handle logon dialog step still only enters the password, so I can't change user.

Is there a way round this?

Thanks

Clive
Ravi Prakash
Top achievements
Rank 1
 answered on 25 Apr 2012
3 answers
210 views
Hi

In my Silverlight application, I have a RadGridView, where two of the columns have a filter applied. They both show a yellow funnel icon next to their header names. I need a way of being able to verify whether a column has its filter applied or not. Visually, if a column has a filter applied, the funnel icon appears yellow, otherwise white. How would I verify this in a coded step? I don't really want to venture into the realms of image verification, as I've heard this can be quite brittle. There must be another, more robust way.

I have attached a screen shot of the DOM Explorer, showing the elements that make up a column filter on a RadGridView column. Originally, I assumed a column had a filter applied if the ToggleButton (AutomationId="PART_DropDownButton") was on e.g. IsChecked = true, but this is not the case. Can anyone suggest how I can verify if a column has a filter applied from the elements in the attachment?

Many thanks!
Keith
Top achievements
Rank 1
 answered on 25 Apr 2012
3 answers
102 views
Hello,

I viewed this post and it seems that the solution that will fit my needs will be to create my own C# code file and include within the project.  I am stuck on a couple minor (hopefully) issues.

- I am using a step to grab data from the data bind, however I am getting a compile error: "The name 'Data' does not exist in the current context."  Am I missing a USING statement?  I had this step working when using a Script Step, so I copied all of the using statements from that file, but the error still exists.
string Environment = (string)Data["Environment"];

- Same issue as above for 'ActiveBrowser'.

- In a Script Step, to access the methods and properties from my created code file, what is the proper call?  I have experimented with several options and just can't figure it out.  (i.e. would it be CodeFileName.ClassName.MethodName() or do i need a seperate USING statement?

EDIT 2:30pm CT -- I solved my third bullet by declaring all methods static in my code file.  I'm still stuck on the first two errors, of which now 'Log.WriteLine' has been added to the list! 
Alan
Top achievements
Rank 2
 answered on 24 Apr 2012
2 answers
110 views
Hello

In code, how do I refer to a radio button's label in order to check it against data?

There doesn't seem to be an obvious text property for the actual HtmlInputRadioButton, and if I add the label itself to the Elements the find logic refers to the content.  I can't use this as the content is dynamic.

Any suggestions?


Thanks
Cheryl
Cheryl
Top achievements
Rank 1
 answered on 24 Apr 2012
1 answer
128 views
Does the HTTP Proxy module in the WebAii libraries work with an HTTPS application?  I am trying to get the headers from a response to grab some information.

Dan
Anthony
Telerik team
 answered on 23 Apr 2012
11 answers
175 views
Hi,

I have an issue with Test Lists.  I am running Test Studio version 2011.2.1413.0

I have a script that iterates through 7 rows of data in a data file.  When I run the script directly from the Record tab everything works perfectly.  When I run the script from a Test List the script fails at the first iteration.  There is no error reported from the Test List.

The faiure happens at the first IF...ELSE statement in the script.  The IF statement test is:
IF (Verify 'InnerText' 'StartsWith' 'Showing 0' on 'TableUsersInfoDiv') THEN

On the first pass the IF clause should report TRUE, and it does do that when the script is run from the Record window.  Below is an extract from the (verbose) log generated by the Test List execution (and please note that all conditions prior to execution through the Reporting screen and the Test List are identical in every instance):

Trace] : Wait for 'InnerText' 'StartsWith' 'User List' on 'HtmlTag'
[Trace] : Click 'AllRadio'
[Trace] : Click:([Element: 'input:3' (id=all)])
[Trace] : Enter text 'test' in 'Text' - DataDriven: [$(UserName)]
[Trace] : SetText:([Element: 'input:1']) - Text:
[Trace] : ScrollToVisible:([Element: 'input:1']) - ElementTopAtWindowTop
[Trace] : MouseClick:LeftDown (1108,454)
[Trace] : MouseClick:LeftUp (1108,454)
[Trace] : MouseClick:LeftClick (1108,454)
[Trace] : IF (Verify 'InnerText' 'StartsWith' 'Showing 0' on 'TableUsersInfoDiv') THEN
[Trace] : Comment: User ID already exists so just logout
[Trace] : Execute test 'g_Logout'
[Trace] : Comment: Script: g_GenericLogout; Author: Nigel Edwards; date: 02/03/12
[Trace] : Execute test 'g_LogoutWaitForButton'
[Trace] : Comment: Script: g_WaitForLogoutButton; Author: Nigel Edwards; date: 02/03/12

The COMMENT line reported above is actually within the ELSE clause.  This shows that a swathe of code (over 30 lines) within the IF statement is not being executed when run from the Test List.  In fact the 'InnerText' does start with 'Showing 0'.  I've attached the full test script to this posting, but in brief, what should happen after the IF test is a further verification line immediately followed by a button-click.  Instead the Test List version skips to the ELSE clause, which is a Logout command.
As I say, the script functions 100% correctly when run directly from the Record window.

Thanks,
Nigel Edwards, Transition Computing.
Ivaylo
Telerik team
 answered on 21 Apr 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?