function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kottegronkottegron 

Cannot delete Salesforce Record using Selenium

I'm setting up a Salesforce regression test environment and using Selenium IDE for firefox.

When Logged in to my Salesforce Org using Firefox I first create an Account Record and than I delete the same record without and complications.

However when I start the Selenium IDE recording and performing the same test use case, then there is a problem when trying to delete the account record. The creation of the account record works but the deletion of the same record is not working. So the Button "Delete" in the UI in Firefox is not responding to me clicking.

The console output in Firefox is giving me this error: Error: Permission denied to access property "apply"

Why is Selenium IDE preventing me from performing this simple test scenario, and what could I do for this to work?

Also I've tried to perform the same test Scenario using PhantomJS instead of firefox and it's still just a problem deleting the Record. So it should be Selenium related error? Thanks in advance
Best Answer chosen by kottegron
kottegronkottegron

Selenium output when cklicking delete
Hi pcon, thanks for the fast reply! 
Yes I was using the details page and the delete button (Standard layout). By mistake I started a Selenium recording right after I had created a record so now im only trying to delete the record. The deletion went now went through. So I exported that "test case" and merged it with the code creating the record. And it worked. So I had to make one recording for the creation and one for the deletion of the record before it worked. 

I provided you with an image though with the failed test scenario. Don't know if you could learn something from it?

 

All Answers

pconpcon
It may be that selenium is recording the object Id that you created when you recorded.  Are you using the delete button on the details page or on something like the list page?  Is this using the standard layout or using a custom Visualforce page? Can you provide any of the generated Selenium script that does the record deletion?
kottegronkottegron

Selenium output when cklicking delete
Hi pcon, thanks for the fast reply! 
Yes I was using the details page and the delete button (Standard layout). By mistake I started a Selenium recording right after I had created a record so now im only trying to delete the record. The deletion went now went through. So I exported that "test case" and merged it with the code creating the record. And it worked. So I had to make one recording for the creation and one for the deletion of the record before it worked. 

I provided you with an image though with the failed test scenario. Don't know if you could learn something from it?

 

This was selected as the best answer
pconpcon
Glad it's working now for you.  If you don't mind please choose the "Best Answer" (even if it's your own) so the case can be removed from the unresolved queue.
Shannon HigginsShannon Higgins
Don't use the Selenium IDE. Use FireBug and Firepath and hand craft all object calls. This way you can be sure you have a sold locator via CSS, Xpath or Xpath Axes