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

HELP! Automated TEST with Watir issue.

2 Answers 56 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
shaohua
Top achievements
Rank 1
shaohua asked on 19 May 2017, 02:45 PM

Hi Guys,

Recently I was trying to do some automated tests for my website using "Watir" framework.

 

However I couldn't get the DropDownList and other Rad Elements work. Here is my HTML code:

<tel:RadDropDownList ID="ddlzone" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlzone_SelectedIndexChanged" ></tel:RadDropDownList>   

 

Then I got a bunch of "div"s with different "id" and "ul"s "li"s elements in the final page. ( by using chrome inspect function)

 

Then I am trying to change the selection of this DropDownList in my ruby code:

ie = Watir::Browser.new
ie.goto("http://localhost:xxxxx")
ie.select_list(:id => "ctl00_MainContent_ddlzone_DropDown").select_value("Japan")

There are some error messages saying that this element couldn't be found.

 

I went to google and found two links about testing telerik elements with watir:

http://www.telerik.com/blogs/testing-radcontrols-for-asp-net-ajax-with-watir-%E2%80%93-how-easy-it-is

http://www.telerik.com/blogs/automating-complex-javascript-rich-controls-with-watir

They are both written 10 years ago and some links in the page didn't work anymore. I tried the method in the above links but didn't get any luck.

 

My question is :

Is there any good examples of testing complex telerik controls with Watir framework?

or 

Maybe there is a better way to test it rather than watir?

 

Thanks a lot!

 

 

 

 

 

 

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 22 May 2017, 10:32 AM

Hi,

The first blog you linked shows the correct approach to test our controls - executing a script that uses $find() to get a reference to the client-side object of the control and then use its own client-side API. You can read more on the different ways to get such a reference here: http://docs.telerik.com/devtools/aspnet-ajax/general-information/get-client-side-reference.

Regards,

Marin Bratanov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
shaohua
Top achievements
Rank 1
answered on 30 May 2017, 04:05 PM

Thanks for the reply.

I think I understand what you are saying and I have already tried different methods to get the control using javascript.

However I couldn't make it work.

 

Btw: The first link is referencing other links and packages which are not available anymore.
I found the package referenced in the first link from other resources and tried it but didn't work.

 

It would be great if you can give an detailed example about how to do it. (from scratch)

I think it won't take too long.

Thanks very much.

Tags
General Discussions
Asked by
shaohua
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
shaohua
Top achievements
Rank 1
Share this question
or