Fix CT failure of GUI cert test cases

Change-Id: I0916a6d53aa52bab991230cc90d7c2dda50df3be
Signed-off-by: manashsarma <manashsarma@in.ibm.com>
diff --git a/gui/gui_test/access_control/test_obmc_gui_certificate.robot b/gui/gui_test/access_control/test_obmc_gui_certificate.robot
index 68ce941..0d8eeaf 100644
--- a/gui/gui_test/access_control/test_obmc_gui_certificate.robot
+++ b/gui/gui_test/access_control/test_obmc_gui_certificate.robot
@@ -27,6 +27,7 @@
 ${xpath_input_contact_person}      //*[@data-test-id='modalGenerateCsr-input-contactPerson']
 ${xpath_input_email_address}       //*[@data-test-id='modalGenerateCsr-input-emailAddress']
 ${xpath_generate_csr_submit}       //*[@data-test-id='modalGenerateCsr-button-ok']
+${xpath_csr_cancel_button}         //button[contains(text(),"Cancel")]
 ${xpath_input_alternate_name}      //input[@id='alternate-name']
 ${xpath_select_algorithm_button}   //*[@data-test-id='modalGenerateCsr-select-keyPairAlgorithm']
 
@@ -57,22 +58,23 @@
 Verify Generate CSR Certificate Button
     [Documentation]  Verify existence of all the fields of CSR generation.
     [Tags]  Verify_Generate_CSR_Certificate_Button
+    [Teardown]  Click Element  ${xpath_csr_cancel_button}
 
-     Page Should Contain Element  ${xpath_generate_csr_button}
-     Click Element  ${xpath_generate_csr_button}
-     Wait Until Page Contains Element  ${xpath_generate_csr_heading}
-     Page Should Contain Element  ${xpath_select_certificate_type}
-     Page Should Contain Element  ${xpath_select_country}
-     Page Should Contain Element  ${xpath_input_state}
-     Page Should Contain Element  ${xpath_input_city}
-     Page Should Contain Element  ${xpath_input_company_name}
-     Page Should Contain Element  ${xpath_input_common_name}
-     Page Should Contain Element  ${xpath_input_challenge_password}
-     Page Should Contain Element  ${xpath_input_contact_person}
-     Page Should Contain Element  ${xpath_input_email_address}
-     Page Should Contain Element  ${xpath_input_alternate_name}
-     Page Should Contain Element  ${xpath_select_algorithm_button}
-     Page Should Contain Element  ${xpath_generate_csr_submit}
+    Page Should Contain Element  ${xpath_generate_csr_button}
+    Click Element  ${xpath_generate_csr_button}
+    Wait Until Page Contains Element  ${xpath_generate_csr_heading}
+    Page Should Contain Element  ${xpath_select_certificate_type}
+    Page Should Contain Element  ${xpath_select_country}
+    Page Should Contain Element  ${xpath_input_state}
+    Page Should Contain Element  ${xpath_input_city}
+    Page Should Contain Element  ${xpath_input_company_name}
+    Page Should Contain Element  ${xpath_input_common_name}
+    Page Should Contain Element  ${xpath_input_challenge_password}
+    Page Should Contain Element  ${xpath_input_contact_person}
+    Page Should Contain Element  ${xpath_input_email_address}
+    Page Should Contain Element  ${xpath_input_alternate_name}
+    Page Should Contain Element  ${xpath_select_algorithm_button}
+    Page Should Contain Element  ${xpath_generate_csr_submit}
 
 
 Verify Installed CA Certificate