• Kior Kally
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi Salesforce Developers,

I am developing an automation script for Salesforce Lightning UI using Selenium Python bindings to check for whether employee names exist. My script is able to login and search, but fails to log out. I am having difficulty finding the profile trigger and finding the log out button. My script fails with TimeoutException when trying to press the profile trigger to expand it. I think the main problem is I am not passing Selenium the correct profile trigger web element. So far in my script:

I launch Safari browser.
I am able to login to Salesforce using my credentials.
I wait up to 5 seconds for verification prompt box to be clickable. If true, I ask user to enter their verification code, pause Selenium automation for 5 seconds to allow user time to eneter code, insert code into verification box, then click verify button.
I wait up to 20 seconds for 'Search Salesforce' input web element to be clickable. Once clickable, I click search box, clear search box, insert 'Employee Full Name'.
I pause Selenium automation for 2 seconds to allow Salesforce page to load dropdown with 'Employee Full Name'.
I click on search box.
I wait up to 20 seconds for span tag with 'Employee Full Name' title attribute to be clickable.
I send keystroke RETURN (like pressing keyboard RETURN button) to search for employee.
I wait up to 10 seconds for profile trigger button to be clickable. Then Selenium runs into a TimeoutException meaning web element is not visible and clickable. At this point, I am not sure if I need to pass Selenium by XPATH the "span", "div", "button", "li" tag.

Here is the section of HTML relevant to the profile trigger.
<li class="slds-global-actions__item slds-dropdown-trigger slds-dropdown-trigger--click" data-aura-rendered-by="348:0;p"><!--render facet: 353:0;p--><!--render facet: 356:0;p--><span class="userProfileCardTriggerRoot oneUserProfileCardTrigger" data-aura-rendered-by="358:0;p" data-aura-class="oneUserProfileCardTrigger"><button class="bare branding-userProfile-button slds-button slds-global-actions__avatar slds-global-actions__item-action uiButton forceHeaderButton" aria-live="off" type="button" data-aura-rendered-by="153:222;a" data-aura-class="uiButton forceHeaderButton"><!--render facet: 154:222;a--><!--render facet: 156:222;a--><div class="tooltipTrigger tooltip-trigger uiTooltip" aria-describedby="tt-for-143:222;a" tabindex="-1" data-aura-rendered-by="148:222;a" data-aura-class="uiTooltip" data-proxy-id="aura-pos-lib-1" id="148:222;a"><span class="photoContainer forceSocialPhoto" data-aura-rendered-by="285:0" data-aura-class="forceSocialPhoto"><div class="profileTrigger branding-user-profile bgimg slds-avatar slds-avatar_profile-image-small circular forceEntityIcon" style="background-color: #65CAE4" data-aura-rendered-by="3:451;a" data-aura-class="forceEntityIcon"><span data-aura-rendered-by="6:451;a" class="uiImage" data-aura-class="uiImage"><img data-aura-rendered-by="4:451;a" class="icon noicon" alt="User" title="User"></span></div></span><span class="tooltip-invisible" role="tooltip" id="tt-for-143:222;a" data-aura-rendered-by="150:222;a">View profile</span></div></button></span></li>

Any tips on finding HTML web elements for Selenium in Salesforce Lightning UI and performing actions on those elements such as click, RETURN, send_keys text, etc would be greatly appreciated.