Skip to content

Search login btn first by id/name, then xpath

Dennis Appelt requested to merge da/fix-login-button into master

What does this MR do?

To perform an authenticated scan, we use selenium to fill in login forms and submit them. We were searching the form's submit button first via a default XPath expression. If no button was found, it would search then by the button's id and name. This causes problems when there are multiple buttons on the login page and the XPath finds the wrong button.

This MR changes the order how we search for the button. It searches the login button first by id and name. If no element is found or no value is provided by the user, it searches the button by a default XPath expression.

What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ee/issues/9830

Does this MR meet the acceptance criteria?

Edited by Philippe Lafoucrière

Merge request reports