diff --git a/test/behave/features/grafana.feature b/test/behave/features/grafana.feature
index 2e66f2c14a8ff2d88872576d61d06b0cba465941..adc2282d1607d490e62d10122cbac98ea727f88c 100644
--- a/test/behave/features/grafana.feature
+++ b/test/behave/features/grafana.feature
@@ -5,13 +5,13 @@ Feature: Test grafana admin login
 
 Scenario: Open grafana
   When I open the grafana URL
-  Then I wait on element "//form/div[1]/input" for 25000ms to be visible
+  Then I wait on element "//input[@name='username']" for 25000ms to be visible
   And I expect that element "#inputPassword" is visible
 
 Scenario: Login to grafana
-  Given the element "//form/div[1]/input" is visible
-  When I enter the "grafana" "username" in the inputfield "//form/div[1]/input"
+  Given the element "//input[@name='username']" is visible
+  When I enter the "grafana" "username" in the inputfield "//input[@name='username']"
   And I enter the "grafana" "password" in the inputfield "#inputPassword"
-  And I click on the button "//form/div[3]/button"
+  And I click on the button "//div[@id='login-view']//button[@type='submit']"
   Then I wait on element "/html/body/grafana-app/sidemenu/a" for 25000ms to be visible
   And I expect that the title is "Home - Grafana"