Thank you.
23 Answers, 1 is accepted
I checked out the post you cited and doing some coding is fine (though he picked C# and I would have been able to follow syntax better with Visual BASIC..but that's just me <g>). I was something of a self-taught coder many (many!) years back and I enjoy it, so sharpening those skills again is indeed of interest to me.
As for the particular screen I'm on, its for scheduling a class session. One of the fields is to assign an Instructor for the class. Depending on the selected class, there may be anywhere from two to 100 different Instructors populating the field. So I'd like to have one selected at random from the Instructor field.
He is me in that case - thanks for the feedback, I'll try to remember to include both C# and VB examples in future posts.
You should be able to use a random function to choose your data, no problem. In the grid example from the blog post, you could use a random number to select a row rather than looping through them. For a combobox, you could use a random number to select by index. The easy way to get started is by recording a test that chooses a specific choice. Then right-click on the test step and choose "Customize step in code." For a Telerik RADcontrols for ASP.NET combobox for example (from your other questions, I believe you're working with a web app rather than Silverlight), you'd get something like this
Pages.ASPNETComboBoxDemo.ContentPlaceHolder1RadComboBox2Div.SelectItemByIndex(3);
you'd then just want to change the index (3) to your random value.
If you're not using Telerik controls, just straight-up HTML <select><option=...>, then you'll likely get a call to SelectByValue(). You can change that to SelectByIndex, again using your randomly-generated number.
Random random =
new
Random();
Pages.ALongDropdownList0.Select.SelectByIndex(random.Next(1, 3));
Then you'll need to determine how to best verify the results of a randomly-generated selection, of course - if you don't know what the inputs will be then how will the test be able to know what to expect; that may be the more difficult part but relies on what exactly your app does and what you're looking to test.
-Steven
Thanks for the reply. My application is web app and we are using telerik Controls fro Web app and for WPF Application. So Now in my app index value is keeps on changing as we add more and more values in Combobox. So what should I write to find that particular entity even if Value keeps on changing in the combobox. Also, If I want to make Combobox Data driven and Pass the value from Excel sheet, In Coded step How can I do?
Let me know. Thank you.
Pages.DemosOfTelerikSASPNET.ContentPlaceHolder1RadComboBoxRegionDiv.SelectItemByValue(
"Denver"
);
You can use data-binding to connect an Excel spreadsheet to your project, then attach data columns to your coded or recorded steps.
That might look something like this
Pages.DemosOfTelerikSASPNET.ContentPlaceHolder1RadComboBoxRegionDiv.SelectItemByValue(Data[
"Col1"
].ToString());
-Steven
I am sorry for asking so many questions. And I don't know whether these questions I should Write it here or put it another Post but since you are answering I want to ask all questions I have :)). I have a couple of questions:
1) Combo filter : In telerik when I set/enter any text in filter box, My page doesn't load while I am typing during the execution. Because of this my test fails.
2) Click Away Functionality: One of the scenario in my web app, We enter a value in a textbox and I need to enter anywhere else in the screen to load that value in the text box. For this I have no idea how I perform automation for this.
3) Multi column sorting(WPF Application) : For multi column sorting on RADGrid View , I have to do enter Shift and hit enter button. this is also challenging. I can try writing code for this. But don't know how to write:((.
P.S : we are using Telerik Controls.
Thank you..
Please allow me to interject and assist with these more technical issues.
1) Could you clarify what exactly you mean by combo filter, I believe you are referring to a combobox which you can enter text and a list may be updated as you type, but it is important for me to fully understand before I can help. Knowing that your application uses Telerik controls, if it might be possible for you to find a similar example in our WPF Controls Examples demo, please let me know which example applies and I can come back to you with a test against it.
2) To click away from a control you can record a "blind" mouse click (desktop action).
3) Could you elaborate on what you mean by multi column sorting? Searching through a WPF RadGridView for some specific entry would require some code, we have this code sample for the scenario.
Regards,
Mario
Telerik
1) Could you clarify what exactly you mean by combo filter, I believe you are referring to a combobox which you can enter text and a list may be updated as you type.
-- Yes You are correct. It would be great if you can help me how to write code for this one.
2) To click away from a control you can record a "blind" mouse click (desktop action).
-- Thanks I will try this one as well.
3) Could you elaborate on what you mean by multi column sorting? Searching through a WPF RadGridView for some specific entry would require some code, we have this code sample for the scenario.
-- For our WPF application I have bunch of questions, is there a way we can start Private conversation?
Thank You.
Darshana
1) Unfortunately behavior of such controls can vary with every WPF application but I should not expect that you would need to write code for such a scenario, unless it is to work around some existing issue. As an example I attached a short video for dealing with the AutoCompleteBox from the Telerik WPF Controls Examples demo I mentioned in my last reply, however I am basically shooting in the dark since I have no reference for what this control in your application looks like or how it acts.
2) Let me know how it goes.
3) I would not be the resource for this type of consultation, you can certainly submit support tickets/form posts for such questions but if you wish to have a direct phone call or screen share it would have to be through either a sales representative or our paid Training sessions.
Regards,
Mario
Telerik
Thank you for reaching us out.
Please double check if the Text Content is used in the find expression of the elements in question. If so you could modify these to match only the beginning of the string. I hope this will be helpful to you.
Otherwise if you would need further assistance I would like to kindly ask you to elaborate more on the test script specifics you have. Thanks!
Regards,
Elena Tsvetkova
Progress Telerik
Hi Elena,
Forgive the potential confusion, I'm still new to Telerik. Our RadComboBoxes are only defined using the id in the Element definition. Using the text in a combo box option seems a strange way to define the combo box. But I'm coming from the world of Selenium. If I'm following you correctly, you are suggesting using the InnerText contains 'somevalue'. The problem is that I'm seeing an innertext that shows the entire list of the names in the combobox. So if I do this, anchor the box to some value partial value that it contains, you think the RadComboBox will be able to match on a partial value? I've tried it, but it doesn't seem to work from what I can tell. I've attached a screenshot showing the inner text of the RadComboBox. I set the element to be defined by:
id contains cboOffices
InnerText contains CTM (I did not have it look for the value in question that we are trying to select because we need to do this in a datadriven way).
Should I have tried to use the datadriven value in the definition?
Thank you for the additional details.
Test Studio uses find logic to create expressions for locating the elements on page built on unique attributes of the elements. In many cases the text content is actually a reliable way to find an element. Also you could data drive the find expression itself.
As far as I understand you did not manage to select the required item from the combobox but I am currently unable to identify what might not be correct. While debugging you could use the annotations (point 5 in this article) while executing a test - this will highlight the target element for each step and will certainly ease you to understand what is going wrong.
Could you please create a sample test against that demo page which demonstrates your difficulties and attach it zipped to that thread for further inspection? Thanks!
Regards,
Elena Tsvetkova
Progress Telerik
I think I've figured out the disconnect here.
I do understand how to do the DataDriven find, what I do not understand is how this translates to the RadComboBox's selection logic choosing a partial value. If I'm not mistaken the find finds the entire RadComboBox which I can definitely make happen with a partial value that is data driven, but once it has done the find it still needs to do a selection from the combo box. It's doing that select using the data driven value that is failing.
I tried to attach the solution I created with the test but it isn't attachable because it is too big. I am just sending you the data file and the webtest and hoping that will be enough.
Thank you for the test provided.
I managed to review it and better understand the requirements you have for entering partial text. First I would like to mention that Test Studio provides at your disposal translators for the Telerik controls. These are available in IE only and you have probably recorded the test against that browser and thus the step RadComboBox Select.
Though to be able to enter part of text and filter the menu as per that text you would need to type the text in the input field without using the translator. Highlight the text field and locate the input in the DOM tree. Add a step to enter text to it and bind it to the data source. Please note that 'SimulateRealTyping' will be probably required to trigger the filtering. Please find a sample test attached to demonstrate the above description.
I hope this will be helpful to you!
Regards,
Elena Tsvetkova
Progress Telerik
Elena,
Our dom is pretty ugly, but I did find the elements you indicated and tried the suggestion you had. Unfortunately typing didn't work, there isn't an input in both, but I managed to have it find the list element using partial text anyway.
Thank you!
Now I just need to figure out how to do table cells in a loop (I made a new post because our dom is really funky with the table structure).
Thanks for keeping me updated on the progress.
I am glad to know you managed to find a proper solution for your scenario. I would also like to provide you our framework apis as you might need to use coded solutions to automate the application under test. It would probably be in use for you.
The other thread you have submitted was also addressed.
Thank you once again for your continuous cooperation!
Regards,
Elena Tsvetkova
Progress Telerik