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

To extract data from a field and to search that data in a radlistbox

12 Answers 118 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tanu
Top achievements
Rank 1
Tanu asked on 25 Jan 2013, 11:35 AM
Hi All,

There is a field "ABC" which is an input field. When we save the value entered in this field it gets saved in listbox which is a telerik control.
Now I want to search the entered value in the listbox and select that value. How can I do that using WebUI test studio?

12 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 25 Jan 2013, 04:20 PM
Hello Tanu,

You can create an Extract step against the value seen in the "ABC" input field. Then you can use the extracted variable in a Data Driven Find Expression to find the listbox item with the same value.

Regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Tanu
Top achievements
Rank 1
answered on 27 Jan 2013, 08:48 AM
blank
0
Tanu
Top achievements
Rank 1
answered on 28 Jan 2013, 05:46 AM
 
0
Tanu
Top achievements
Rank 1
answered on 28 Jan 2013, 02:14 PM
Hi Plamen,

Earlier i was getting compilation error which has gone now.

For the code given below, script is failing.

 

Dim

 

 

listItem as HtmlListItem = Pages.EndpointPULSE.FrameContentiframe.UnorderedList.Find.ByContent(Of HtmlListItem)(Data ("Col1").ToString())

 

'Assert.IsNotNull(listItem)

listItem.Click()

 

 

Overall Result: Fail
------------------------------------------------------------
'1/28/2013 9:38:23 PM' - Using .Net Runtime version: '4.0.30319.296' for tests execution.
'1/28/2013 9:38:23 PM' - Starting execution....
'1/28/2013 9:38:34 PM' - Detected custom code in test. Locating test assembly: PULSE.dll.
'1/28/2013 9:38:34 PM' - Assembly Found: C:\Users\Tanu\Documents\Test Studio Projects\PULSE\bin\PULSE.dll
'1/28/2013 9:38:34 PM' - Loading code class: 'Pulse4_2_'.
------------------------------------------------------------
------------------------------------------------------------
'1/28/2013 9:38:34 PM' - Detected DataDriven Test. Starting data iterations.
------------------------------------------------------------
'1/28/2013 9:38:34 PM' - [Iteration #1: (Col1=nsect)]
------------------------------------------------------------
Overall Result: Fail
------------------------------------------------------------
'1/28/2013 9:38:34 PM' - Enabling Html Popup Tracker. Test expecting Popups.
'1/28/2013 9:38:34 PM' - Using 'InternetExplorer' version '8.0' as default browser.
'1/28/2013 9:38:34 PM' - LOG: Unexpected dialog encountered. Taking no action.
'1/28/2013 9:39:43 PM' - 'Pass' : 1. Execute test 'Pulse(2)'

>>> Test-as-Step 'Pulse(2).tstest' log starts:

Overall Result: Pass
------------------------------------------------------------
'1/28/2013 9:38:34 PM' - Enabling Html Popup Tracker. Test expecting Popups.
'1/28/2013 9:38:34 PM' - Using 'InternetExplorer' version '8.0' as default browser.
'1/28/2013 9:38:35 PM' - LOG: Unexpected dialog encountered. Taking no action.
'1/28/2013 9:39:20 PM' - 'Pass' : 1. Execute test 'Pulse(1).tstest'

>>> Test-as-Step 'Pulse(1).tstest' log starts:

Overall Result: Pass
------------------------------------------------------------
'1/28/2013 9:38:35 PM' - Enabling Html Popup Tracker. Test expecting Popups.
'1/28/2013 9:38:35 PM' - Using 'InternetExplorer' version '8.0' as default browser.
'1/28/2013 9:38:45 PM' - 'Pass' : 1. Navigate to : 'http://Home.aspx'
'1/28/2013 9:38:45 PM' - 'Pass' : 2. Enter text 'loginname' in 'Login1UserNameText'
'1/28/2013 9:38:45 PM' - 'Pass' : 3. Enter text 'pwd' in 'Login1PasswordPassword'
'1/28/2013 9:39:00 PM' - 'Pass' : 4. Click 'LogInSpan'
'1/28/2013 9:39:01 PM' - 'Pass' : 5. Enter text 'messaging_test_study' in 'MainContentTxtFilterText'
'1/28/2013 9:39:01 PM' - 'Pass' : 6. Click 'MainContentBtnSearchImage'
'1/28/2013 9:39:19 PM' - 'Pass' : 7. Wait for 'InnerText' 'Exact' 'Messaging_Test_Study' on 'TableCell4'
'1/28/2013 9:39:19 PM' - 'Pass' : 8. Wait for attribute 'style' has 'Same' value of 'WIDTH: 19%' on 'TableCell4'
'1/28/2013 9:39:20 PM' - 'Pass' : 9. Click 'ConfigureSpan'
------------------------------------------------------------
'1/28/2013 9:39:20 PM' - Overall Result: Pass
'1/28/2013 9:39:20 PM' - Duration: [0 min: 44 sec: 668 msec]
------------------------------------------------------------

<<< Test-as-Step 'Pulse(1).tstest' log ends.

'1/28/2013 9:39:38 PM' - 'Pass' : 2. Wait for element 'Div0' 'is' visible.
'1/28/2013 9:39:38 PM' - 'Pass' : 3. Wait for 'InnerText' 'Exact' 'Add New Role' on 'Div0'
'1/28/2013 9:39:38 PM' - 'Pass' : 4. Enter text 'Investigator' in 'MainContentTxtFilterText'
'1/28/2013 9:39:38 PM' - 'Pass' : 5. Click 'MainContentBtnSearchImage'
'1/28/2013 9:39:42 PM' - 'Pass' : 6. Wait for 'InnerText' 'Exact' 'Investigator' on 'TableCell0'
'1/28/2013 9:39:42 PM' - 'Pass' : 7. Wait for attribute 'class' has 'Same' value of 'col-first' on 'TableCell0'
'1/28/2013 9:39:43 PM' - 'Pass' : 8. Click 'EditRoleSpan'
------------------------------------------------------------
'1/28/2013 9:39:43 PM' - Overall Result: Pass
'1/28/2013 9:39:43 PM' - Duration: [1 min: 8 sec: 292 msec]
------------------------------------------------------------

<<< Test-as-Step 'Pulse(2).tstest' log ends.

'1/28/2013 9:39:50 PM' - 'Pass' : 2. Wait for element 'ListItem' 'is' visible.
'1/28/2013 9:39:50 PM' - 'Pass' : 3. Wait for 'InnerText' 'Exact' 'Menu Items' on 'ListItem'
'1/28/2013 9:39:51 PM' - 'Pass' : 4. Tab('ctl00_MainContent_radTabVertical'): 'Menu Items' click action.
'1/28/2013 9:39:52 PM' - 'Pass' : 5. Wait for 'InnerText' 'Exact' 'Add Sections' on 'DvAddSectionNDiv'
'1/28/2013 9:39:52 PM' - 'Pass' : 6. Click 'MainContentHyAddSectionLink'
'1/28/2013 9:40:09 PM' - 'Pass' : 7. Wait for element 'RemainingDiv' 'is' visible.
'1/28/2013 9:40:10 PM' - 'Pass' : 8. Click 'MainContentHyNewSectionLink'
'1/28/2013 9:40:24 PM' - 'Pass' : 9. Wait for input 'MainContentTxtSectionNameText' value 'Exact' ''.
'1/28/2013 9:40:26 PM' - 'Pass' : 10. Enter text 'nsection11' in 'MainContentTxtSectionNameText' - DataDriven: [$(Col1)]
'1/28/2013 9:40:27 PM' - 'Pass' : 11. Extract input 'MainContentTxtSectionNameText' value into DataBindVariable $(SectionName).
'1/28/2013 9:40:29 PM' - 'Pass' : 12. Enter text 'fsection11' in 'MainContentTxtSectionFeatureNameText'
'1/28/2013 9:40:30 PM' - 'Pass' : 13. Wait for input 'MainContentTxtSectionFeatureNameText' value 'NotContain' '''.
'1/28/2013 9:40:34 PM' - 'Pass' : 14. RadButton('ctl00_MainContent_dxSaveNewSec'): RadButton click
'1/28/2013 9:40:40 PM' - 'Pass' : 15. Wait for ExistsNot 'MainContentTxtSectionNameText'
'1/28/2013 9:40:43 PM' - 'Pass' : 16. Wait for element 'MainContentDivSectionPanelDiv' 'is' visible.
'1/28/2013 9:40:44 PM' - 'Fail' : 17. [Pulse42_CodedStep] : New Coded Step
------------------------------------------------------------
Failure Information:
~~~~~~~~~~~~~~~
Exception thrown executing coded step: '[Pulse42_CodedStep] : New Coded Step'.
InnerException:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Pulse4_2_.Pulse42_CodedStep() in C:\Users\Tanu\Documents\Test Studio Projects\PULSE\Pulse4(2).tstest.vb:line 74
------------------------------------------------------------
'1/28/2013 9:40:44 PM' - Detected a failure. Step is marked 'ContinueOnFailure=False' aborting test execution.
------------------------------------------------------------
'1/28/2013 9:40:44 PM' - Overall Result: Fail
'1/28/2013 9:40:44 PM' - Duration: [2 min: 10 sec: 683 msec]
------------------------------------------------------------
------------------------------------------------------------
'1/28/2013 9:40:44 PM' - Overall Result: Fail
'1/28/2013 9:40:44 PM' - Duration: [2 min: 10 sec: 695 msec]
------------------------------------------------------------
'1/28/2013 9:40:46 PM' - Test completed!

 

0
Plamen
Telerik team
answered on 29 Jan 2013, 04:07 PM
Hi Tanu,

Please try the following code instead:
Dim items As IList(Of RadListBoxItem) = Pages.EndpointPULSE.FrameContentiframe.UnorderedList.Find.AllByTagName(Of RadListBoxItem)("li")
Dim listItem As RadListBoxItem = items.Where(Function(item) item.Text = Data("Col1").ToString()).FirstOrDefault()
Assert.IsNotNull(listItem)
listItem.ScrollToVisible()
listItem.Click()

I tested it against this Telerik demo site and as you can see in this video, it works as expected.

Kind regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Tanu
Top achievements
Rank 1
answered on 31 Jan 2013, 11:44 AM
Hello Plamen,

This is still not working for me. Is there any way by which you can work on my application and tell me the issue. Or if you can arrange a Team viewer kind of session so that i'll be able to give you control of my application.

Thanks.
0
Plamen
Telerik team
answered on 31 Jan 2013, 12:05 PM
Hi Tanu,

If direct access to your application is not possible, please take a Fiddler trace using FiddlerCap and send it to me in a zip file. Basically with that trace I'll try to "simulate" your app in order to reproduce the problem and provide you with a proper solution.

Regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Tanu
Top achievements
Rank 1
answered on 31 Jan 2013, 04:00 PM
Hello Plamen,

I would appreciate if you suggest some another alternative as it is not possible to provide you with fiddlercap. My client doesn't allow me to do that.

Thanks.
0
Plamen
Telerik team
answered on 01 Feb 2013, 10:05 AM
Hi Tanu,

Since direct access and Fiddler trace are not an options, the only option we've got left is to schedule a GoToMeeting. Please let me know your timezone and your availability and I'll setup the meeting.

All the best,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Tanu
Top achievements
Rank 1
answered on 04 Feb 2013, 07:50 AM
Thats great. I confirmed from my client and they are fine with GoToMeeting. They just want to raise the ticket for them same as the product is a propreitary and informaton is confidential. So can I raise a ticket and you can schedule the meeting any time good with you(preferably IST).
Thanks.
0
Plamen
Telerik team
answered on 04 Feb 2013, 08:36 AM
Hi Tanu,

Sure, you can do that. Just create a new support ticket (which is confidential) and reference ticket 652587(our internal reference for this thread) and it will be directed to me. You can create a support ticket from you Telerik.com account here(Submit support ticket). Then I'll send you the meeting details.

Regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Tanu
Top achievements
Rank 1
answered on 04 Feb 2013, 09:14 AM
Hi Plamen,

Ticket id is: 655556

Regards,
Tanu
Tags
General Discussions
Asked by
Tanu
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Tanu
Top achievements
Rank 1
Share this question
or