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

How to locate the element

32 Answers 193 Views
General discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alex
Top achievements
Rank 1
Alex asked on 05 May 2015, 07:40 AM
Hi, i have a problem with comboboxes. At first, I record a new web-test. In settings I select tagIndex as element location logic. And it works, then, when I click on combobox button (I want to select a person from list), telerik writes step "ImageClick". Then, when combobox opens, I find the item by tag "inner text". When I have only one such combobox, it's ok, but when I have two such comboboxes with the same items (persons), telerik opens both of them. But they have differ tagIndexes (img:25 and img:26). Help me to solve my problem.

32 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 05 May 2015, 10:27 PM
Hi Alex,

"telerik opens both of them"

That makes no sense (no I'm not in any way implying you're a liar, only that your description defies how I know Test Studio works). Test Studio will only target and act on one UI element. It's not possible for one step to do something like click on two elements either concurrently or one right after the other.

I need to see this happening first hand to diagnose what's going on. Is it possible for us to access your web application directly (I assume it's a web application)? I just need a publicly accessible URL I can connect to, plus instructions how to get to the problem page and reproduce this problem.

Regards,
Cody
Telerik 
0
Alex
Top achievements
Rank 1
answered on 06 May 2015, 06:32 AM

ok, our site works in our local web. Later, I'll publish it on accessible server. And now, let's sure that all I do is coorect:

1. In project settings -> In Identification logic I have only two rows (TagIndex and TextContent). That's all what I changed.I did it because our web application has dinamic id's of elements.

2. Than I began to record new test.

3. When I record a step with ckicking on combobox, my step is "Click ExtGen563Image" (we use ExtJS). Then I go to the "Find element window" and see filter : TagIndex is exactly img:25 (for example). In this combobox I have a list of persons.

4. When we have only one such combobox it's ok, but when we have two such comboboxes on the same form(window) it opens both of them but not at firs step ("Click ExtGen563Image") but at second step. It's like at first step telerik doesn't knows about second combobox, but at second step he knows about first one and opens it too.

Maybe I do something wrong or I must change some settings. And later I'll publish our aaplication.

Thanx for help.

0
Cody
Telerik team
answered on 07 May 2015, 01:36 AM
Hi Alex,

If the find is set to "TagIndex is exactly img:25" then Test Studio will find the 26th <img> element and click on it. It can't click on the 26th and another one, like the 29th one. Test Studio just doesn't work that way.

Do you have an ETA to publishing your web application for me to look at? I could also setup an online meeting where you can demonstrate this happening on your computer. Though keep in mind I'm in Austin, TX which is Central time zone.


Regards,
Cody
Telerik 
0
Alex
Top achievements
Rank 1
answered on 07 May 2015, 08:49 AM
We record a video but the size is 10 MB. I can send it on your mail.
0
Alex
Top achievements
Rank 1
answered on 08 May 2015, 11:48 AM
Please, I need your help. my mail: bakumenko_sasha@mail.ru
0
Alex
Top achievements
Rank 1
answered on 08 May 2015, 11:48 AM
Please? I need your help!!!! my mail: bakumenko_sasha@mail.ru
0
Alex
Top achievements
Rank 1
answered on 08 May 2015, 11:49 AM
Please? I need your help!!!! my mail: bakumenko _ sasha @ mail . ru
0
Alex
Top achievements
Rank 1
answered on 08 May 2015, 11:49 AM
Please? I need your help!!!!
0
Cody
Telerik team
answered on 11 May 2015, 07:01 PM
Hello Alex,

I apologize for the delay getting back to you. I am temporarily overloaded and still catching up. I shared a private DropBox folder for you to upload large files to.

Regards,
Cody
Telerik 
0
Alex
Top achievements
Rank 1
answered on 12 May 2015, 06:14 AM

Hi Cody,

 

Thanx for an idea with dropBox, that's our video: https://www.dropbox.com/s/wq38ow0tlr5m1tq/Untitled1.fbr?dl=0 .

 

Alex

0
Cody
Telerik team
answered on 12 May 2015, 11:07 PM
Hello Alex,

That is the strangest behavior I have ever seen! It looks like Step 17 opens the correct drop down while step 19 opens the dropdown for 17 plus the next dropdown it was supposed to open. Is that correct> I have no idea what could cause this. I need a way to reproduce this on my machine so i can study the behavior in order to figure out what is going on.

I am curious what happens if you set SimulateRealClick for step 19, our problem step?

Regards,
Cody
Telerik 
0
Alex
Top achievements
Rank 1
answered on 14 May 2015, 06:26 AM
Hello Cody,

by means of "realClick" partly helped because the second combobox separately began to open, but now we have a problem with a chosen item in this combobox. We do it through Edit_Element-> Find_Settings = ext:qtip contaions "text". Because through TagIndex item doesn't get out. these comboboxes have different values "text", but telerik choose both of them in the first combobox. Do you have an idea, how to choose an item in combobox correctly.

Regards,
Alex
0
Alex
Top achievements
Rank 1
answered on 14 May 2015, 06:28 AM
Hello Cody,

by means of "realClick" partly helped because the second combobox separately began to open, but now we have a problem with a chosen item in this combobox. We do it through Edit_Element-> Find_Settings = ext:qtip contaions "text". Because through TagIndex item doesn't get out. these comboboxes have different values "text", but telerik choose both of them in the first combobox. Do you have an idea, how to choose an item in combobox correctly.

Regards,
Alex
0
Cody
Telerik team
answered on 15 May 2015, 04:16 PM
Hi Alex,

Since every application is custom and unique, I cannot definitevely tell you how to fix this without seeing all of your test as well as getting a first hand look at your application. I need to see the DOM for your application before I can suggest a good Find Expression.

I am also concerned why all of your steps are recorded as Click on Div or Click on Image. Normally a Telerik RadComboBox is recorded as shown in the attached screen shot.

Regards,
Cody
Telerik 
0
Alex
Top achievements
Rank 1
answered on 18 May 2015, 07:49 AM

Hi

This is DOM for our form. We use ExtJS in our site, maybe that's why our steps are recorded as Click on Div or Click on Image. Rename this file to .txt

Regards,

Alex

0
Cody
Telerik team
answered on 19 May 2015, 09:38 PM
Hi Alex,

Thank you for the DOM snapshot. Unfortunately none of the drop down options are present in the DOM which prevents me from offering a better way of finding and selecting an options for your specific application.

Knowing that you use ExtJS I found this demo page I could study. The first thing I discovered is that you're right, due to the way they construct their comboboxes they are recorded in Test Studio as a Click on Div when you click on the drop down arrow. Using this demo page I found a method that may work better for you. I describe it in this short video:

http://screencast.com/t/W3L9BukN


Regards,
Cody
Telerik 
0
Alex
Top achievements
Rank 1
answered on 21 May 2015, 12:15 PM

Hi Cody,

 

thank you for this video. And I am waiting for your next video (I am sure that you can solve my problem)

 Regards,

Alex

0
Alex
Top achievements
Rank 1
answered on 22 May 2015, 07:58 AM

Hi Cody,

Also, I have a problem with choosing an item from table in ExtJS. An attribute unselectable is set "on". When we try to find element, it's ok. Telerik doesn't send a message, that couldn't find the element. But we can't choose an item or click on it by using "SimulateRealClick". I attach files, to see the DOM of element change DOM-file to txt.

Regards,

Alex

0
Cody
Telerik team
answered on 22 May 2015, 04:56 PM
Hi Alex,

And I am waiting for your next video (I am sure that you can solve my problem)

Sorry I am confused by this statement. What next video were you expecting? I don't recall promisting any follow up video. Or did you just mean anything I may send in the future?

Also I must apologize. I didn't realize the audio did not get recorded with my last video. I'll have to re-record it.

Unfortunately the small DOM snippet you sent does not help. I think at this point it would be better to setup an online meeting where I can see your application first hand and work with you on getting the test script working the way you need it to. Let me know what timezone you're in and your availability and I'll setup the meeting. I'm located in Austin, Texas, which is Central time zone.

Regards,
Cody
Telerik 
0
Alex
Top achievements
Rank 1
answered on 23 May 2015, 02:48 PM

Hi Cody,

your last video demonstrates how to lacate an item in single ExtJS combobox. But in the end of your page you have two comboboxes with the same items. In this case in our tests, when we try to locate element by InnerText in these comboboxes, Telerik opens the second combobox, but chooses and changes this items in first combobox, and in the second combobox the chosen item is empty. 

And as for my last post, we have a td tag with div tags list, and we want to choose an element wth a help of TagIndex element. Telerik founds this element, but he could'n select it(simulate real click doesn't help - in this case Telerik cooses an item, which located in the centre of the screen). That's why I send you DOM of this element in order to find the attribute,that blocks this action.

Regards,

Alex

0
Cody
Telerik team
answered on 26 May 2015, 03:00 PM
Hi Alex,

The big problem with trying to automate ExtJs comboboxes is that the combobox itself and the list of options to select are in two completely separate and virtually unrelated <div> elements. Have a look at the two attached screen shots for an example what I'm referring to. Notice how the list of options are put into a <div> element which is dynamically added to the end of the DOM. The options, and the <div> container they are put into, don't even exist in the DOM until the combobox is opened to show the options.

For this reason I asked to setup an online meeting where I can study your application and work on solving this problem with you.


Regards,
Cody
Telerik 
0
Alex
Top achievements
Rank 1
answered on 29 May 2015, 07:56 AM

Hi Cody,

I understand my mistake, now we use "Add a new group of filters" option to locate the element. Start element is our combo-list. We find it with a help of "TagIndex" tag. In "Find Element" window we find our item (with a help of Validate button). We select an item with a help of filter : TagIndex -> is exactly -> div:1 . In "Find Element" window it's ok, but when we start our test, combobox is opening but it doesn't select an item. And when I "Edit element" in "Live version" telerik finds it. "Simulate real click" doesn't help.

please, HELP!!! 

Regards, Alex

0
Cody
Telerik team
answered on 31 May 2015, 01:01 AM
Hello Alex,

I would love to help. The only way I can do that is to see your application first hand and experiment with different approaches to this problem until we come up with a solution. There are two ways I can see your application first hand:
  1. You send me a publicly accessible URL I can put into a browser to connect to your app. I'll need instructions how to navigate your application to get to the problem drop down.
  2. We setup an online meeting where you can show me the application running on your computer along with the problem drop down.

Either way I'll experiment with your drop down until I find the right combination that works. I don't know what will work until I see it and experiment with it.

Which route do you want to take?


Regards,
Cody
Telerik 
0
Alex
Top achievements
Rank 1
answered on 03 Jun 2015, 06:18 AM

Hello Cody,

Unfortunately, I couldn't publish my app on accessible URL, my chief forbided to do this. I can only discribe my problem. Maybe it helps. Or I can record a video with demonstrating my situation. Also, when you answered me, it was a.m. 05.00 hours. That's why I'm not sure that we can setup an online meeting(((

And now, I can describe my last sittuation with two comboboxes. In first  combobox Telerik chooses an item very well. In second combobox Telerik opens the list, but doesn't select an item. But when we locate (only locate) the mouse on this list, Telerik finds an item at once. And I don't uderstand how does it work.

When I try to repeate this problem in a new project with one form and two comboboxes only, everything is working. Maybe the size of DOM affects on Telerik? Because the version of extjs was the same.

Regards,

Alex

0
Cody
Telerik team
answered on 03 Jun 2015, 06:53 PM
Hello Alex,

Are you on Moscow time? If true, my 9am (US Central Time) is your 6pm. I can do that.

I doubt the size of the DOM would make that much of a difference, though I admit technically almost anything is possible.

Yes a video showing what happens will help a little though I REALLY need to be able to reproduce the problem and experiment with the application before I can come up with a solution. Another approach would be for you to capture a Fiddler trace of your application running normally in a browser without Test Studio even running. We have about a 75% success rate using a Fiddler trace to simulate your web application and reproducing problems for us to fix. Do you want to try this route?

If you do please follow these steps:
  1. Start FiddlerCap
  2. Click Clear Cache
  3. Click Clear Cookies
  4. Check Decrypt HTTPS traffic
  5. Check Store binaries
  6. Start capture
  7. Launch your browser
  8. Navigate to your website
  9. Navigate to the problem page
  10. Open both drop downs
  11. Stop capture
  12. Save capture
  13. Put the .saz file into a .zip file and attach that to this support ticket
  14. Include navigation instructions for your application (click here, enter X there, etc.)

I can use that to simulate your web server and try to reproduce the problem.


Regards,
Cody
Telerik 
0
Alex
Top achievements
Rank 1
answered on 04 Jun 2015, 09:02 AM

Hello Cody,

I captured a Fidler trace of our application. Also I put the extJS, which we use. If there is few information in this fidler-file,I will describe my actions more detailed. I separate extJS for tow zip archives. App.jpg is App.saz.

Regards,

Alex

0
Cody
Telerik team
answered on 04 Jun 2015, 10:10 PM
Hello Alex,

I am unable to open extjs1.jpg and extjs2.jpg. What type of files are these? They don't appear to be image files, or Fiddler traces or .zip files. I can successfully open app.jpg as a Fiddler trace file.

Please do NOT rename the file extensions of files. Instead please create a new .zip file and add things like the Fiddler trace to the .zip file then attach the .zip file. When you rename the extension it causes problems transferring the files (they are interpreted as the wrong file type) and too confusing on my end how to open the file.

The Fiddler trace appears to be working but now I need directions how to navigate to the problem area. I get logged on and get to the home page - see attached screen shot. Now what do I click on?

Regards,
Cody
Telerik 
0
Alex
Top achievements
Rank 1
answered on 17 Jun 2015, 01:14 PM

Hello Cody,

I can't attach .zip files because Allowed extensions: .jpg, .jpeg, .gif, .png.

ExtJS1-2 that was extJS library. 

Click on "Учет л/с" - second button in this menu.
And, I have one more question: is it correct to locate element with a help of tagIndex (id is dinamic)? Because we faced with such situation:

1.yesterday we recorded a test, everything was ok

2.today we run it once more, and telerik can't find a button (in all elements we use TagIndex)

3.the reason was, that one record was added to the main grid with all records(Persons) and therefore all our TagIndexes of elements increased (TagIndexes ++). Than we began to change our findlogic to EnnerText is exactly 'Text', but some controlls doesn't have any InnerText (for example comboboxes). What we must do to rosolve this problem?

Regards, Alex

0
Cody
Telerik team
answered on 19 Jun 2015, 09:26 PM
Hello Alex,

I can't attach .zip files because Allowed extensions: .jpg, .jpeg, .gif, .png.

Ah, I see you're right. I was unaware of this restriction. My apologies.

Personally I try to avoid using TagIndex when the index value is above 9. The higher the index value the more brittle using TagIndex becomes for the very reason you already ran into "that one record was added to the main grid".

When faced with an element that doesn't have static unique properties I can use to locate it I will use what we call a "chained find expression" instead. The concept is to locate some sort of container/wrapping element first, such as a <div>, then under that element find the one I want, possibly using TagIndex or some other unique property. Maybe I can use the class attribute or hret of src.


Regards,
Cody
Telerik 
0
Alex
Top achievements
Rank 1
answered on 30 Jul 2015, 10:02 AM
Hi, Cody

I have 2 problems:

1. Telerik doesn't want to choose an item in combobox (ExtJS 4). But when we locate cursor on the combobox list items, its OK.
Maybe something wrong with focus? This is a link to the video https://www.dropbox.com/s/0bjtbcyfka42i3m/%D0%97%D0%B0%D0%BF%D0%B8%D1%81%D1%8C_2015_07_29_12_07_40_88.mp4?dl=0

2. We locate our elements(comboboxes) with a help of attribute - img. But when we add a new element to our main page, all indexes incrementing, and our test fails.

Regards,

Alex
0
Cody
Telerik team
answered on 04 Aug 2015, 12:46 AM
Hello,

Sorry I did not get the chance to research your questions today. It's high in my queue for tomorrow.


Regards,
Cody
Telerik 
0
Cody
Telerik team
answered on 05 Aug 2015, 09:06 PM
Hello Alex,

Sorry for the delay. I watched your video but it doesn't give me enough information to troubleshoot the problem. I can only tell that you're getting an element not found error but I'm unable to see why.

I am concerned how the find expression is using a TagIndex of div:600. It means to find div at index 601. What happens if a new div is added or removed? You'll get an element not found error. To determine if this is the problem please let the test fail then go to Step Failure Details, find and click Export then attach the generated .zip file. It contains valuable information we need to diagnose this type of failure.

Why are you using img for your index? I'm sure there's a better way but I need to see the DOM for your application and the element you're trying to target to come up with a better approach.


Regards,
Cody
Telerik 
Tags
General discussion
Asked by
Alex
Top achievements
Rank 1
Answers by
Cody
Telerik team
Alex
Top achievements
Rank 1
Share this question
or