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

data binding

17 Answers 187 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Arbind
Top achievements
Rank 1
Arbind asked on 31 May 2014, 05:57 AM
my application -in the page some text is there say "hello" and in the same page there is a dropdown having diffrnt language.so if i ll select dutch then "Hello" will change to same lang.so in test i am verifying the word hello .i want data bind so i put a excel having two column language and word.in language US and dutch and in Word Hello and hello in dutch lang.  so test should go loke this 1. go to page by default value in drop down US lang 2.it will verify word hello 3.again return to page select dutch and verify the word(using data binding)....can u please send me a video how to do this test .

17 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 04 Jun 2014, 08:05 PM
Hello Arbind,

A video won't really help w/o having a sample website we can access that has the same type of language that your application uses so we can show you I've seen language selection as a row of buttons row of buttons as well as a drop down select for selecting language. How you data drive these is radically different.

The approach is basically the same though.
  1. Create a test that logs in selects a language, verifies "Hello" text and ends
  2. Data drive that test with a data source that has two columns.
  3. The first column will be used to select the target language. What is contained in this column depends on the mechanics of how a language is selected in your application.
  4. The second column is the text for "Hello" for that target language
  5. Use these two columns in the two steps, one for selecting the language, the other for verifying the text.

One thing you'll need to watch out for is to verify the Find Expression for the "Hello" element doesn't use Text in the find expression. If it does, when you change the language the test will fail with "element not found" simply because Test Studio is looking for the target element with the static text.



Regards,
Cody
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Dennis
Top achievements
Rank 1
answered on 10 Jun 2014, 03:50 PM
I'm just curious if there is a solution for this issue. I'm essentially trying to do the same thing, except I first log in to a site and then verify that specific text is displayed on the site based on the language selection. I think I need to do the text verification part in a loop to avoid logging in multiple times, but I'm not sure how to do that or if that's the right approach. Any suggestions will be appreciated!
0
Boyan Boev
Telerik team
answered on 13 Jun 2014, 01:50 PM
Hi Denis,

Thank you for contacting us.

To avoid multiple log ins just create a parent test which will contain two test as steps. The first one will be the log in and the second will the rest of the steps.

When you run this test the log in test as step will be executed only once and the other test as many times as are the rows in the data source.

Hope this helps.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Dennis
Top achievements
Rank 1
answered on 13 Jun 2014, 02:38 PM
Hi Boyan,

Your suggestion worked. Thank you!
0
Boyan Boev
Telerik team
answered on 16 Jun 2014, 09:59 AM
Hello Denis,

Glad to hear that.

If you need further help, please do not hesitate to contact us again.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Jeannette
Top achievements
Rank 1
answered on 16 Jul 2014, 11:54 AM
A query on the same line.
I am creating a test where I use a separate test to Login, then I have to verify values in 2 drop downs on my page. Each drop down has 6-7 values that I want to store in excel and data bind in the verification step.
I don't want to create a separate test for each dropdown. I just want to use loop in someway that allows me to read those 6-7 values from the excel sheet and verify them on the application.
0
Boyan Boev
Telerik team
answered on 17 Jul 2014, 07:48 AM
Hello Jeannette,

If you data bind the test as step (the test which verifies the dropdown) it will iterate as many times as the rows in the Excel sheet.

You can use also datadriven find expression.

In this case you don't need to create separate tests for every value.

Hope this helps.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Jeannette
Top achievements
Rank 1
answered on 18 Jul 2014, 11:32 AM
Thanks Boyan.

I do not want to use test as step for sure. For datadriven find expression also If I bind it with excel field it will take one value at a time, that is 1 row for each iteration and thus does not solve my problem. I want to read all the rows in a single iteration.
0
Boyan Boev
Telerik team
answered on 18 Jul 2014, 12:00 PM
Hello Jeannette,

The only way how you can read all rows during one iteration is with a Test as Step.

Put the verification step in a separate test, data bind it and insert it as test as step in the parent test.

In this case during a single iteration of the parent test the verification will execute as many times as are the rows in the Excel file.

Please see this demonstration video. It navigates only one (one iteration), however it executes the second step 5 times.

Let me know if this helps.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
dan
Top achievements
Rank 1
answered on 22 Jul 2016, 07:58 PM

I have a similar application, but I'm not able to bind to the UI dropdown list. The step allows selection by Index, Text or Value, but the Step Properties does not show a property for Bindings, as would be the case if the field were a simple text field.

Here's the HTML for the control..

<div class="ms-crm-Inline-Edit ms-crm-Inline-OptionSet noScroll ms-crm-Inline-HideByZeroHeight" style="display: none;">

<select id="new_preferredlanguage_i" class="ms-crm-SelectBox ms-crm-Inline-OptionSet-AutoOpen ms-crm-Inline-HideByZeroHeight-Ie7" attrname="new_preferredlanguage" defaultselected="100000000" attrpriv="7" title="" tabindex="-1" aria-labelledby="new_preferredlanguage_c new_preferredlanguage_w" size="3" style="height: 48px;" controlmode="normal">
<option title=""></option>
<option value="100000000" title="English">English</option>
<option value="100000001" title="French">French</option>
</select>

 

Your help would be appreciated.

 

Thanks,

dan

0
Boyan Boev
Telerik team
answered on 27 Jul 2016, 12:06 PM
Hi Dan,

I have found the root cause of this behavior. When you have size attribute of the drop down more than 1 it is considered as html list box and not as a drop down. 

Unfortunately Test Studio does not have data binding property for list boxes. I have logged a feature request about this which you can track here.

Until this is implemented to the product the workaround is to remove the size property from the drop down or set it to 1.

Hope this helps.

Regards,
Boyan Boev
Telerik by Progress
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Sherjo
Top achievements
Rank 1
answered on 28 Jul 2016, 08:23 AM

Hi,

I have a question similar to the question of Jeannette (Posted 16 Jul 2014)

I want to check the contents of a drop down list using a list from an external file (text file, etc)

my imagined work flow is:
1.I have a text file that contains the data (which will be data binded):
item 1
item 2
item 3
2. The code will compare it by getting all the rows of a column(as a group) from the text file then compare it to the data from the drop down list

I have tried this before but what happened was, data is retrieved one by one.

Right now I use arrays to store data but I am having a hard time maintaining it, because every time there will be updates in the data, I have to recompile the code even though the code was unchanged.

Is there a way to accomplish this in Test Studio?

thanks.

0
Boyan Boev
Telerik team
answered on 02 Aug 2016, 08:43 AM
Hi Sherjo,

Is it a regular HTML Select control? If so the only way to verify its options is via code. There is no other way.

If it is not please send me a screen shot of its DOM.

Thank you!

Regards,
Boyan Boev
Telerik by Progress
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
dan
Top achievements
Rank 1
answered on 24 Aug 2016, 12:45 PM
Thanks Boyan. How do I remove the size property from the drop down or set it to 1?
0
Boyan Boev
Telerik team
answered on 25 Aug 2016, 02:33 PM
Hi Dan,

This should be done by the developers of the site you are testing or by someone which has access to the source code of the site.

Hope that helps.

Regards,
Boyan Boev
Telerik by Progress
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
dan
Top achievements
Rank 1
answered on 25 Aug 2016, 04:34 PM

Thanks for your response, Boyan.

We don't own that part of the code, so changing the property size is not a possible workaround for us.

But, given your explanation of the root cause, I see this as a defect, rather than a missing feature. In the app I am creating scripts for, dropdowns are everywhere, and our approach is to avoid writing code as much as possible. Respectfully, I would encourage your team to give this issue a high priority and provide a fix/feature as quickly as possible.

Thanks again for your help.

dan

 

0
Nikolay Petrov
Telerik team
answered on 30 Aug 2016, 01:10 PM
Hi Dan,

Thank you again for your feedback. It is very important for us. Once it is logged on our feedback portal it will be reviewed by our management and other customers may vote for it.

Regards,
Nikolay Petrov
Telerik by Progress
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Arbind
Top achievements
Rank 1
Answers by
Cody
Telerik team
Dennis
Top achievements
Rank 1
Boyan Boev
Telerik team
Jeannette
Top achievements
Rank 1
dan
Top achievements
Rank 1
Sherjo
Top achievements
Rank 1
Nikolay Petrov
Telerik team
Share this question
or