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

Failed in Deletion

3 Answers 93 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
sabarishbabu
Top achievements
Rank 1
sabarishbabu asked on 29 Nov 2010, 02:15 PM
Hi,

            I have recorded a test with the following steps in the Telerik Web UI tool but its failed in deletion step.

1.created a reservation for an user.
2.Saved the reservation
3.Delete the reservation.
4.Execute the test, it is successfully run without error on the created day.
  While executing the test on the next day, it is failed with the 'Unable to locate the element' error in log in Deletion step.
When delete button is clicked in Calendar timeslot, it generates the step with an no(automatically generated by recorder)..this getting is changed automatically on next day.

So i rerecord the deletion step again , then it works fine. Its hectic for me to do this daily.

Please give me a solution for this.

thanks,

3 Answers, 1 is accepted

Sort by
0
Keaegan
Telerik team
answered on 29 Nov 2010, 07:11 PM

Hi sabarishbabu,

Without seeing any further data on the test itself, it sounds like WebUI is saving something particular to the element/object (most likely the date is being included) for the find logic of the item to be deleted. If your site has information specific to one day on the page, and you create a reservation for that day, it will always look for the exact item you created if the find logic for the element/object is not lessened to be less strict.

You'll first want to locate the correct element within the element browser within QA edition. The easiest way to do this is to click the step in the test that uses the element. You should see the element browser update to have a yellow arrow pointing at the element that is "touched" by the step. Once located, right-click this element (the one with the yellow arrow to the left of it) and choose "Edit Element". This will bring up the find expression builder and allow you to modify the rule for locating this item without being so strict. If you need help modifying this, please provide us with a screenshot of the Find Expression Builder for the element in question.

Best wishes,
Keaegan
the Telerik team

Interested in Agile Testing?

Tune in Wednesday, December 1st for a very special Webinar focused on Agile Testing. Click here to register for free!
0
sabarishbabu
Top achievements
Rank 1
answered on 30 Nov 2010, 08:37 AM
Hi,

      Thanks for your reply. I tried out your solution for the failed step. I have edit the element and changed the logic in the 'Find Expression builder' . But i cant validate the change because the Validation option is disabled. Please check the screenshot attached.

I have used the below expression for the failed step and executed the test again, its again and shows the below error in log.
tagname=~div,id=~ctl00_ctl00_SecurePlaceHolder_SchedulerPlaceHolder_schAdminView_22_0

Herewith I have attached the log for reference.
'Fail' : 34. Appointment('ctl00_ctl00_SecurePlaceHolder_SchedulerPlaceHolder_schAdminView_22_0'): 'Reserved: Raj K' action -> 'Delete'
------------------------------------------------------------
Failure Information: 
~~~~~~~~~~~~~~~
Unable to locate element. Details: Attempting to find [Html] element using 
Find logic 
 (Html): [id 'Contains' ctl00_ctl00_SecurePlaceHolder_SchedulerPlaceHolder_schAdminView_22_0] AND [tagname 'Contains' div]

Unable to locate element. Search failed!
'Fail' : 34. Appointment('ctl00_ctl00_SecurePlaceHolder_SchedulerPlaceHolder_schAdminView_22_0'): 'Reserved: Raj K' action -> 'Delete'
------------------------------------------------------------
Failure Information:
~~~~~~~~~~~~~~~
Unable to locate element. Details: Attempting to find [Html] element using
Find logic
 (Html): [id 'Contains' ctl00_ctl00_SecurePlaceHolder_SchedulerPlaceHolder_schAdminView_22_0] AND [tagname 'Contains' div]
 
Unable to locate element. Search failed!


Please give me a solution to solve the problem.
0
Keaegan
Telerik team
answered on 02 Dec 2010, 04:43 AM

Hi sabarishbabu,

The Validation option will be grayed out unless the recorder browser is currently targeting that page (otherwise it has nothing to compare against). There are two ways to load the page easily in this circumstance:

  1. Right-click a step in your test that will get you to the page in question and choose "Run to here"
  2. Locate the effected element in the Element Browser and right-click it, then choose "Load Page"

Either should get you to the page in question that you need to compare (validate) the rule against. Once you are there, you can validate your find expression.

I also created an example for you that goes through Google Calendar to create/delete a file. If you have a google account, you can use the provided example to see the broader rules I am talking about (username goes in step 3, password goes in step 4). I used our DOM browser to find better highlights/element selections for what I wanted to get done.

Initially, the test was only able to work for the hour it was created in (Google uses an id that includes the hours for the calendar event) as I was targeting the bottom most target for the element in question. I located it in the DOM, and went up a couple of levels to find a different tag (DDtag in this case) that was universal throughout the different calendar entries (always present), and didn't change from entry to entry (always static). Look for an element/tag like this when making the rules for locating an item, and always make sure you have a rule to find the item that is as general as possible if you want it to be re-usable like this.

If you are able to provide a copy of your project (in .zip format) we can review your setup with you to help determine what the best find string will be for the element in question you are trying to manipulate, but this may also require access to your site you are testing against.

Sincerely yours,
Keaegan
the Telerik team

Interested in Agile Testing?

Tune in Wednesday, December 1st for a very special Webinar focused on Agile Testing. Click here to register for free!
Tags
General Discussions
Asked by
sabarishbabu
Top achievements
Rank 1
Answers by
Keaegan
Telerik team
sabarishbabu
Top achievements
Rank 1
Share this question
or