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

Web UI creates duplicates in the element explorer

3 Answers 118 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Veera
Top achievements
Rank 1
Veera asked on 04 Jan 2011, 08:12 PM
When i try to record the same application from different test server the elements gets duplicated in the element Explorer.
This creates duplicates in the element explorer as shown in the attachment.
Also, There is no option to move the elements in the required path/page in the element explorer  in otherwords there is no Cut/copy paste option avbailable in the element explorer.

Thanks!!!
Veera

3 Answers, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 05 Jan 2011, 07:10 PM
Hi Veeraraghavan,
    since you're working on two different servers (and therefore 2 different URLs) this makes the two applications unique as far as WebUI Test Studio is concerned.

The elements in Elements Explorer are used by your test. Even though the elements appear duplicated and show under a different page name, the test usually works just fine anyway when run on different servers. This is because our framework doesn't actually use the Page definition (i.e. the URL) that a referenced element appears under when looking for an element. It only uses the find expression.

So let's say you recorded a Click step on server 1, then execute that test on server 2. The test usually will work because the Click step will grab the Find Expression for the element it is linked to and look for that element on whatever the server and page is being actively displayed.

If this duplication really bothers you (really the only problem is a cluttered looking Elements Explorer) you can manually modify the properties for the Page definition nodes. Update them to match, then close and reopen your test project. WebUI will perform an element merge when it loads the project and now they will appear under just one Page node.

Elements are removed automatically when a test step associated with them is deleted and it is no longer referenced by a different test step. You can also add elements manually (Option "Add to Project Elements" from the pop-up menu) and you're allowed the Delete these elements afterwords.

I hope this helps, please don't hesitate to contact us again if you have more questions!

Greetings,
Stoich
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
0
Veera
Top achievements
Rank 1
answered on 05 Jan 2011, 09:38 PM
Hi Stoich,
This really helped me in understanding the element explorer. But I still have some clarification.

Question 1?
I am not able to move the elements from one page to other page in the element explorer. Attached Screen shot. Here I want to move the elements from Page "Pg_hCueHomePage0" to  "Pg_hCueHomePage". Currently I am not able to move the elements.... Is there any option available?? Renaming is not working....

Question 2?  The duplicates is created while recording on the same elements in different servers. We have 2 QA Servers to test. We are doing our recording stuffs in 2 servers. If day 1 i am working on server 1, day 2 in server 2... this really creates lot of duplicates..... Is there any workaround for it?... Currently not able to delete the elements if the elements are used in the test step.

Question 3? Is there any option to update the properties from the application directly to the element explorer? This is required for us when the application changes the element properties during the course of time.

Question 4? Record a step, convert them to coded step, delete the recorded step.. This delete the element from the explorer causing the codedstep to fail.. Do we have workaround fort it?


Thanks.
Veera
0
Cody
Telerik team
answered on 10 Jan 2011, 08:10 PM
Hello Veeraraghavan,

Question 1) You're right you cannot move elements from one page node to another page node. This is by design and if you think about it, you really should not be allowed to do this either. Elements belong to the page they were recorded against and must always stay with that page.

However I have described how you can merge your duplicate page nodes (that you see in your screen shot) in this new KB article. The other thing you can do to merge duplicate pages together is to manually modify the BaseUrl property on the page nodes. Make them the same then click the Refresh button. Pages that are duplicates according to the CompareUrl property value will automatically be merged together along with the elements under it.

Question 2) First we highly recommend always recording your tests against the same test server. If you really must record tests against two different servers you should take advantage of our BaseURL feature. There are two parts to this feature:

  1. Setting the BaseURL for recording
  2. Setting the BaseURL to actually use during playback
The recording BaseURL modifies how NavigateTo steps and elements are recorded in Elements Explorer. The setting is controlled in the User Settings from the Project tab:
  1. On the Project click Show Settings
  2. Click the Recording Options tab
  3. In the BaseURL enter the URL of the host you will be recording your test against (e.g. http://qa.testserver_01)
  4. Click a different property just so that the above change is stored
  5. Click OK to save your change
Now record your test.

During playback you want to create a test list, place your newly recorded test in it, and modify the BaseURL property for that test list.
  1. On the Test Lists tab select the test list you want to change the setting for
  2. Click Edit Settings in the ribbon bar
  3. Scroll down to BaseURL
  4. Enter the URL of the host you want the test list to actually use (e.g. http://stage.testserver_02)
  5. Click OK to save the change
Now when you go to run that test list, it will use the modified BaseURL at runtime instead of the URL it was recorded with.

You can still take advantage of the BaseURL feature on already recorded test. Modify the URL of the NavigateTo steps e.g. from http://myserver.com/default.aspx to ~/default.aspx. Then set the BaseURL of the test list and I previously described.
There are two parts to this feature:

Setting the BaseURL for recording
Setting the BaseURL to actually use during playback
The recording BaseURL modifies how NavigateTo steps and elements are recorded in Elements Explorer. The setting is controlled in the User Settings from the Project tab:
On the Project click Show Settings
Click the Recording Options tab
In the BaseURL enter the URL of the host you will be recording your test against (e.g. http://qa.testserver_01)
Click a different property just so that the above change is stored
Click OK to save your change
Now record your test.

During playback you want to create a test list, place your newly recorded test in it, and modify the BaseURL property for that test list.
On the Test Lists tab select the test list you want to change the setting for
Click Edit Settings in the ribbon bar
Scroll down to BaseURL
Enter the URL of the host you want the test list to actually use (e.g. http://stage.testserver_02)
Click OK to save the change
Now when you go to run that test list, it will use the modified BaseURL at runtime instead of the URL it was recorded with.

You can still take advantage of the BaseURL feature on already recorded test.  Modify the URL of the NavigateTo steps e.g. from http://myserver.com/default.aspx to ~/default.aspx. Then set the BaseURL of the test list and I previously described.
Question 3) No this is not supported by the tool. At design time you can update the Find Expression for the elements in Elements Explorer. Just right click on an element that needs to be changed and select Edit Element. This will open the Find Expression Builder dialog allowing you to modify it as needed. It even includes a verification feature so you can verify your modifications will find the correct element.

Question 4) This appears to be fixed in our latest internal build, 2010.3.1307. Please give that version a try and let me know if this problem still occurs.

Best wishes,
Cody
the Telerik team
Interested in Agile Testing? Check out Telerik TV for a recording of Automated Testing in the Agile Environment
Tags
General Discussions
Asked by
Veera
Top achievements
Rank 1
Answers by
Stoich
Telerik team
Veera
Top achievements
Rank 1
Cody
Telerik team
Share this question
or