Basic Selenium test project for Salesforce

35 views
Skip to first unread message

Birdman518

unread,
May 11, 2020, 11:06:12 PM5/11/20
to Selenium Users
I am just learning Selenium, but as I was a Salesforce developer before (over 3 years ago), I hope to be able to get up to speed quickly.

I have written a simple Selenium script in Python to scrape a page, and I am just now experimenting with logging in to Salesforce using
the Selenium IDE in Firefox.

My question is this.

When you log into Salesforce via https://login.salesforce.com, you then get dumped into your "instance" in the cloud, something like

My first learning exercise is to take my test SF app and be able to create and delete some of my custom objects, e.g. "Group".

As far as organizing my project, would I be able to have a simple "Login" test that uses the base login URL, and then have
the subsequent ones use the instance URL?    It would be tedious and probably time-consuming to have to log in and out
for each test.

Thanks,

Mitch

Ankit Mundra

unread,
May 12, 2020, 1:04:52 AM5/12/20
to Selenium Users
Hi Mitch

If I have not understood it correctly, then you want a way to ensure that you don't have the need to perform the login step before every test case start.

If you are using pytest, then I would suggest to use the @pytest.fixture. This should help you achieve this. In case, if you are using some other framework then would suggest to check for a similar approach for that fixture. Test Fixtures are the most commonly used approaches to solve these types of problems.

Regards
Ankit Mundra

Birdman518

unread,
May 12, 2020, 9:00:25 AM5/12/20
to Selenium Users
Ankit,

Thank you for taking the time to reply.   I am not using pytest currently.  I am simply trying to get started using
Selenium with Python to access Salesforce.

But it sounds like your answer *is* related to what I am trying to do...

Thanks,

Mitch
Reply all
Reply to author
Forward
0 new messages