17 Answers, 1 is accepted
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.
- Create a test that logs in selects a language, verifies "Hello" text and ends
- Data drive that test with a data source that has two columns.
- 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.
- The second column is the text for "Hello" for that target language
- 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
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
Your suggestion worked. Thank you!
Glad to hear that.
If you need further help, please do not hesitate to contact us again.
Regards,
Boyan Boev
Telerik
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.
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
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.
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
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
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
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.
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
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
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
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