package Ġcom . atlassian . performance . tools . jira actions . api . page Ċ Ċ import Ġorg . apache . logging . log 4 j . Log Manager Ċ import Ġorg . openqa . selenium . By Ċ import Ġorg . openqa . selenium . TimeoutException Ċ import Ġorg . openqa . selenium . WebDriver Ċ import Ġorg . openqa . selenium . support . ui . Expected Conditions Ċ Ċ class ĠBackup Configuration ( ĊĠĠĠ Ġprivate Ġval Ġdriver : ĠWebDriver , ĊĠĠĠ Ġprivate Ġval Ġaccess : ĠAdmin Access Ċ ) Ġ{ ĊĠĠĠ Ġprivate Ġval Ġlogger Ġ= ĠLog Manager . getLogger ( this :: class . java ) ĊĠĠĠ Ġprivate Ġval Ġdelete Backup Locator Ġ= ĠBy . xpath ( ĊĠĠĠĠĠĠĠ Ġ" //* [@ id =' tbl _ services '] " Ġ+ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" //* [ contains ( text (), Ġ' com . atlassian . jira . service . services . export . Export Service ') ]" Ġ+ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ"/ ancestor :: tr " Ġ+ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" //* [ contains (@ class , Ġ' operations - list ') ]" Ġ+ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" //* [ contains ( text (), Ġ' Delete ') ]" ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġfun Ġdelete (): ĠBackup Configuration Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġpromp ted Ġ= Ġaccess . is Pro mp ted () ĊĠĠĠĠĠĠĠ Ġif Ġ( pro mp ted ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġaccess . gain () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġwhile Ġ( driver . is Element Present ( delete Backup Locator )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdelete Backup Service () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġlogger . info (" Backup Ġservices Ġhave Ġbeen Ġdeleted ") ĊĠĠĠĠĠĠĠ Ġif Ġ( pro mp ted ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġaccess . drop () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġreturn Ġthis ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġdelete Backup Service () Ġ{ ĊĠĠĠĠĠĠĠ Ġdriver . wait ( Expected Conditions . element ToBe Clickable ( delete Backup Locator )). click () ĊĠĠĠĠĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdriver . wait ( Expected Conditions . alert Is Present ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdriver . switch To (). alert (). accept () ĊĠĠĠĠĠĠĠ Ġ} Ġcatch Ġ( e : ĠTimeout Exception ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ// this Ġalert Ġsometimes Ġdoesn 't Ġshow ... ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġif Ġ( access . is Pro mp ted ()) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġaccess . gain () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ