How to configure a single sign-on connection
Step-by-step instructions
Step 1: In the lower left-hand section of Provar, click the Test Settings tab. Several sub-tabs will appear such as Connections, Mobile Apps, Browser Providers, etc. Open the Connections sub-tab and click the plus sign to create a new connection.
Step 2: Enter a Connection Name.
Step 3: Within the Basic Settings, there is a Connection Type drop down menu. The choices include:
- Database
- Messaging
- Microsoft
- Generic Web Service
- Salesforce
- UI Testing
- Single Sign-On (SSO)
Step 4: Based on what you selected, the drop down menu directly to the right will populate sub-categories. For example, if you select Salesforce as the Connection Type, you will be prompted to select Normal Salesforce Connection, Salesforce Communities Connection or Salesforce Portal Connection.
Step 5: Enter your Username and Password for the selected Connection Type. For example, if you selected Salesforce, you should enter your existing single-sign on Username and Password for Salesforce. Click OK.
Step 6: Open a new internet browser and navigate to the website homepage associated with the SSO connection you are creating. (For example, https://login.salesforce.com.)
Step 7: Import the SSOFile.java provided here and place it within the src > pageobjects folder. (Hint: The src folder is located within the Navigator tab of Provar.)
package pageobjects; import java.util.Map; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.ElementNotVisibleException; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import com.provar.core.model.base.api.IRuntimeConfiguration; import com.provar.core.testapi.ILoginPage; import com.provar.core.testapi.ILoginResult; import com.provar.core.testapi.SfLoginResult; import com.provar.core.testapi.annotations.Page; @Page(title = "SSO Login Page", connection = "SSO") public class SSOFile implements ILoginPage { @Override public ILoginResult doLogin(IRuntimeConfiguration runtimeConfiguration, WebDriver driver, Map<String, String> credentials) { // Get the user name and password. String userName = credentials.get(CREDENTIAL_USER); String password = credentials.get(CREDENTIAL_PASSWORD); // Submit the SSO form. driver.findElement(By.xpath("//input[@id='username']")).sendKeys(userName); driver.findElement(By.xpath("//input[@id='password']")).sendKeys(password); driver.findElement(By.xpath("//input[@id='Login']")).click(); try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } String currentUrl = driver.getCurrentUrl(); int lightningPos = currentUrl.indexOf(".lightning.force.com"); if (lightningPos > 0) { JavascriptExecutor jsExec = (JavascriptExecutor) driver; String classicUrl = currentUrl.substring(0, lightningPos) + ".my.salesforce.com/provardisco"; String script = "window.open('" + classicUrl + "', 'provardisco')"; jsExec.executeScript(script); try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } driver.switchTo().window("provardisco"); } // Return the result. return new SfLoginResult(true, null, driver); } }
Step 8: You may need to make a few edits to this file. Within the // Submit the SSO form section of the syntax, you will need to verify that the three xpath instructions are correct. To verify that the xpath instructions are correct for the connection you are creating (e.g. Salesforce), toggle back to login.salesforce.com. Place your cursor on the Username field and right-click to select Inspect.
When inspected, the Username field is associated with id=’username’, the Password field is associated with id=’password’ and the Login button is associated with id=’login’ which match the xpath instructions in the java file.
Step 9: Open the Connections tab within Provar once again and click the plus sign to create a new connection. Enter the Connection Name (e.g. SSO) and select Single Sign-on (SSO) and Generic SSO (Page Object-based).
Step 10: Enter the Base URL, such as https://login.salesforce.com. Within the Page Object field, enter pageobjects.SSOFile. Check Debug. Click OK. You should now see both of the connections that you created within the Connections tab. Click the first connection that you created, TestAdmin and click the edit button (which is to the right of the create a new connection tab.)
Step 11: Open the Advanced Settings. Within the Sign-On Connection drop down menu, select SSO. Click OK.
Hey, you’re done!
- General information
- Licensing Provar
- Provar trial guide and extensions
- Using Provar
- API testing
- Behavior-driven development
- Creating and importing projects
- Creating test cases
- Custom table mapping
- Functions
- Debugging tests
- Defining a namespace prefix on a connection
- Defining proxy settings
- Environment management
- Exporting test cases into a PDF
- Exporting test projects
- Override auto-retry for Test Step
- Managing test steps
- Namespace org testing
- Provar desktop
- Provar Test Builder
- Refresh and Recompile
- Reload Org Cache
- Reporting
- Running tests
- Searching Provar with find usages
- Secrets management and encryption
- Setup and teardown test cases
- Tags and Service Level Agreements (SLAs)
- Test cycles
- Test plans
- Testing browser options
- Tooltip testing
- Using the Test Palette
- Using custom APIs
- Callable tests
- Data-driven testing
- Page objects
- Block locator strategies
- Introduction to XPaths
- Creating an XPath
- JavaScript locator support
- Label locator strategies
- Maintaining page objects
- Mapping non-Salesforce fields
- Page object operations
- ProvarX™
- Refresh and reselect field locators in Test Builder
- Using Java method annotations for custom objects
- Applications testing
- DevOps
- Introduction to test scheduling
- Apache Ant
- Configuration for Sending Emails via the Provar Command Line Interface
- Continuous integration
- AutoRABIT Salesforce DevOps in Provar Test
- Azure DevOps
- Running a Provar CI Task in Azure DevOps Pipelines
- Configuring the Provar secrets password in Microsoft Azure Pipelines
- Parallel Execution in Microsoft Azure Pipelines Using Multiple build.xml Files
- Parallel Execution in Microsoft Azure Pipelines using Targets
- Parallel execution in Microsoft Azure Pipelines using Test Plans
- Bitbucket Pipelines
- CircleCI
- Copado
- Docker
- Flosum
- Gearset DevOps CI/CD
- GitHub Actions
- Integrating GitHub Actions CI to Run Provar CI Task
- Remote Trigger in GitHub Actions
- Parameterization using Environment Variables in GitHub Actions
- Parallel Execution in GitHub Actions using Multiple build.xml Files
- Parallel Execution in GitHub Actions using Targets
- Parallel Execution in GitHub Actions using Test Plan
- Parallel Execution in GitHub Actions using Job Matrix
- GitLab Continuous Integration
- Travis CI
- Jenkins
- Execution Environment Security Configuration
- Provar Jenkins Plugin
- Parallel Execution
- Running Provar on Linux
- Reporting
- Salesforce DX
- Git
- Team foundation server
- Version control
- Salesforce testing
- Adding a Salesforce connection
- Assert Page Error Messages on Add/Edit Product
- Dynamic Forms
- Internationalization support
- List and table testing
- Salesforce Release Updates
- Salesforce Lightning Testing
- Salesforce Lightning Web Component (LWC) locator support
- Salesforce console testing
- Visualforce Testing
- Performance Best Practices
- Testing best practices
- Troubleshooting
- Browsers
- Configurations and permissions
- Connections
- DevOps
- Error messages
- Administrator has blocked access to client
- JavascriptException: Javascript error
- macOS Big Sur Upgrade
- Resolving failed to create ChromeDriver error
- Resolving Jenkins license missing error
- Resolving metadata timeout errors
- Test execution fails – Firefox not installed
- Update to Opportunity field validation behaviour
- Licensing, installation and firewalls
- Memory
- Test Builder and test cases
- Release notes