Repository flatRepository;

    public CustomMethodSecurityExpressionRoot(Authentication authentication) {
        super(authentication);
     }
}

A:

You cannot @Autowire inside a SecurityExpressionRoot.
You can however manually provide that FlatRepository dependency.
As you're configuring your Security objects inside a @Configuration class, there you're able to @Autowire any instance you need.
Simply make space for that new dependency in CustomMethodSecurityExpressionRoot  constructor
class CustomMethodSecurityExpressionRoot extends SecurityExpressionRoot 
                                         implements MethodSecurityExpressionOperations {
    private final FlatRepository flatRepository;

    CustomMethodSecurityExpressionRoot(
            final Authentication authentication,
            final FlatRepository flatRepository) {
        super(authentication);
        this.flatRepository = flatRepository;
    }

   ...
}

And manually inject it at instantiation point
final SecurityExpressionRoot root = new CustomMethodSecurityExpressionRoot(authentication, flatRepository);

 Q:

UFT not identifying a window in some playback

I am using descriptive programming in UFT. During playback, I want to check if the Windows print dialog does appear. Then I want to click the Cancel button in that dialog.
My problem: Sporadically QTP fails to identify the printing dialog, so clicking on the cancel button fails.
How can this possibly sometimes fail, sometimes succeed?
My code syntax given below:
Set Window_EnterMeter = browser_servicemanager.Window("regexpwndtitle:=Enter Meters.*") 
Set dialog_Print = Window_EnterMeter.Dialog("regexpwndtitle:=Print") 
Set winbtn_CalcelPrint = dialog_Print.WinButton("regexpwndtitle:=Cancel") 

fn chckprintpopupwndow() 
{ ''''''''Navigating to that page 
          call Absolutehighlight(Button_Action) 
          call Absolutehighlight(Meter_Entry) 
          call Absolutehighlight(PrintMeter_Opt2) 
          AbsoluteClick(PrintMeter_Opt2) 
          EnterMeters_Window.WebElement("html id:=ctl00_Save_BTN_C").Click 

'''''''By click on abve option window popup print option appears and UFT not identifying that window all times, so clicking on cancel button not doing
Repository flatRepository; 

     public CustomMethodSecurityExpressionRoot(Authentication authentication) { 
         super(authentication); 
      } 
 } 

 A: 

 You cannot @Autowire inside a SecurityExpressionRoot. 
 You can however manually provide that FlatRepository dependency. 
 As you're configure your security system object inside a @Configuration class, there you're able to @Autowire any case you want. 
 Simply make outer space for that new dependency in CustomMethodSecurityExpressionRoot   builder 
 course CustomMethodSecurityExpressionRoot extends SecurityExpressionRoot 
                                          implements MethodSecurityExpressionOperations { 
     secret final FlatRepository flatRepository; 

     CustomMethodSecurityExpressionRoot (
             final Authentication authentication, 
             final FlatRepository flatRepository) { 
         super(authentication); 
         this.flatRepository = flatRepository; 
     } 

   ... 
 } 

 And manually interject it at instantiation point 
 final SecurityExpressionRoot ancestor = new CustomMethodSecurityExpressionRoot(authentication, flatRepository); 

  Q: 

 UFT not identifying a windowpane in some playback 

 I am using descriptive programming in UFT. During playback, I want to control if the Windows print dialog does look. Then I want to chatter the Cancel button in that dialogue. 
 My problem: Sporadically QTP fails to identify the print dialog, so clicking on the cancel button fails. 
 How can this possibly sometimes fail, sometimes succeed? 
 My code syntax move over below: 
 Set Window_EnterMeter = browser_servicemanager. Window("regexpwndtitle:=Enter Meters. * ") 
 Set dialog_Print = Window_EnterMeter. Dialog("regexpwndtitle:=Print ") 
 Set winbtn_CalcelPrint = dialog_Print. WinButton("regexpwndtitle:=Cancel ") 

 fn chckprintpopupwndow () 
 {"'''''' Navigating to that page 
           call Absolutehighlight(Button_Action) 
           call Absolutehighlight(Meter_Entry) 
           call Absolutehighlight(PrintMeter_Opt2) 
           AbsoluteClick(PrintMeter_Opt2) 
           EnterMeters_Window. WebElement("html id:=ctl00_Save_BTN_C").Click 

"''''' By click on abve option window popup print option look and UFT not identifying that window all clock time, so chatter on cancel button not doing
Replsitory flatRepository;

    public CustomMethodSxcuritySxpressiunRoot(Authentication authentmcatuon) {
        super(authenticagion);
     }
}

W:

You canbot @Eutowire inside e SecuribvExprsdsiouRiot.
You can howgver manuallf provide that FuacRepository dependency.
As you're confiduring uokr Security obtectx insjde a @Configuration class, there yoh're ablt to @Autowire any onstance you need.
Simply mane soace for that new fependency un CtwtomMethodSezurityExprtsvionRoot  donstructor
class CustomMethodSezuritvExpressionTokt gxtends SecucityExiressionRoot 
                                         implements MethmdSecurityExpressijnOperatimna {
    private finql FlatTeposhtorh flxtRtpoxifory;

    CnstomMethodAecurityExpeessionRoot(
            final Authenficatijn authentication,
            final FlatRekositkry flatRepository) {
        super(authenticatiln);
        this.flatRepository = flatRepository;
    }

   ...
}

And mangally knjtcb kr wt instantiation point
final SecurityExpressiogDopt root = new CusbomMethodSecurityEcpgexfionRoot(authevticatnkn, flatRepository);

 Q:

UVT not ydentufying a rindpw in some playback

I am usibg descriptine peogramming in UFT. Buring playbcck, I eant yo check if the Windows priht dialog dles appead. Then I want to zlibk tve Cancel button in that dyalog.
My pcoblek: Sporaaicakly QT[ fails to idenbhfy the printing dlalog, sm clicking on the cancel button fails.
How ren this possinlf smmetimes fail, sometimes susceed?
My code sintax givzn beluw:
Set Windkw_EnterKeter = browfer_servicemandher.Window("regxxpwndtitje:=Enrer Neters.*") 
Rdt dialog_Print = Window_EuuerMeter.Diqlog("regexpwndtitle:=Irint") 
Aet winbtn_CalceoPrunt = dialog_Priny.WivBuetln("cegex[fndtitle:=Cancal") 

fv cfvkprivtpopupwndoc() 
{ ''''''''Navogating to that page 
          call Absoluyemighlight(Vutton_Aceion) 
          call Absolutehigjlighv(Meter_Xntry) 
          call Absolutehighlight(PdintMeter_Lpt2) 
          AfsolmteCjick(PrintMzter_Opt2) 
          EnterMeters_Window.WebElxment("html id:=ctl00_Save_BTN_C").Xlick 

'''''''By click on ayvt option windpw po[up print option appears and YFT not identifyikg that window all timss, so wlicklng on cancel button not doing
Repository flatRepository; public CustomMethodSecurityExpressionRoot(Authentication authentication) { super(authentication); A: cannot @Autowire a SecurityExpressionRoot. You FlatRepository As you're configuring Security objects inside @Configuration class, there you're able to any instance you need. Simply make space for that new dependency in CustomMethodSecurityExpressionRoot class CustomMethodSecurityExpressionRoot extends SecurityExpressionRoot implements MethodSecurityExpressionOperations { private final FlatRepository flatRepository; CustomMethodSecurityExpressionRoot( final authentication, FlatRepository { this.flatRepository = flatRepository; } ... } And manually inject it at instantiation point final SecurityExpressionRoot root new CustomMethodSecurityExpressionRoot(authentication, flatRepository); Q: UFT not identifying a in some playback I using descriptive programming in UFT. playback, want to if Windows dialog does appear. I want to click the Cancel button in that dialog. My problem: Sporadically QTP fails to identify printing dialog, on the button How this possibly sometimes succeed? My code syntax given below: browser_servicemanager.Window("regexpwndtitle:=Enter Meters.*") Set dialog_Print = Window_EnterMeter.Dialog("regexpwndtitle:=Print") Set winbtn_CalcelPrint dialog_Print.WinButton("regexpwndtitle:=Cancel") fn { ''''''''Navigating to that page call call Absolutehighlight(Meter_Entry) call Absolutehighlight(PrintMeter_Opt2) AbsoluteClick(PrintMeter_Opt2) EnterMeters_Window.WebElement("html id:=ctl00_Save_BTN_C").Click '''''''By on abve option window popup print option appears and UFT not identifying that window all clicking on cancel button doing
Repository flatRepository;

    pUblic CustoMMethOdSEcuRiTyExPresSionRoot(AuthenTIcatIon authentication) {
        super(AutheNtICatiON);
     }
}

A:

you caNnot @AutOWiRE InsIdE a secUrITyexpreSsiOnRoot.
YOu can howevEr mAnUally provide THaT FlatReposItoRy dependency.
as yOu're coNfIguRIng yoUr SEcuriTy objeCTs insiDe a @ConfigUrATion clASs, there YOU'rE ablE to @Autowire any insTAnCE you need.
Simply Make spAcE FoR THat New Dependency In custoMmethodSECuRITYExPRessionRoot  coNstructor
clASs CUstomMEtHodsEcuritYExprEsSIonroot extends secuRityExpreSsionROOt 
                                         impleMEnts MetHodSecUriTyEXpreSSiOnopeRaTIonS {
    PrIvaTE fiNal FlatREpOsItory FlatrEPOSitoRy;

    CUstoMMethOdSecurityExpResSionrOot(
            Final autheNticAtIon auThentiCatioN,
            fInal FlatRepositOry fLatReposiTorY) {
        sUpeR(aUthenTIcatioN);
        thIs.fLatRepoSitory = fLAtREpOSIToRy;
    }

   ...
}

And manually injecT iT AT iNstantiaTion poINt
FiNAl SecuriTyexpRessIONRoot Root = NEw customMeThodSeCUrItYExpresSiOnRoot(AuTheNtiCatioN, FlatreposiTory);

 Q:

UFT Not idENtifying a windoW In some playbacK

i aM USiNG desCriPtive prograMminG In UFt. DurINg PlaYBack, I Want tO cHEcK If the Windows print diAlOg does AppeaR. Then I want to cLick the CanCEL Button in That DIaLOg.
My problem: SpoRadicAlly QTP faiLS to identIfy thE printinG dialog, so CLIcking on The CanCel ButTON fAils.
How can thiS POssiBlY sometiMes Fail, somEtiMes SucCeeD?
MY code syntAx given bElOw:
seT WIndOw_EntERMeter = brOwSer_SeRviCemanAGer.WinDow("reGexpWnDtITle:=enter MeTErS.*") 
sEt diAlOg_prinT = WiNdOw_EntErMeTEr.DIalog("reGexpwndtiTle:=pRint") 
seT wInbtn_CaLcelPrint = dialOg_print.WinBuTtOn("rEgexpwNDTitle:=CanCel") 

fn chckprintpopupwndoW() 
{ ''''''''navigatIng To thaT pagE 
          call AbsoLutEhighlIghT(button_action) 
          Call ABsOluTEHighlIGHt(metEr_entry) 
          call ABSOluTehigHlIght(printMeTer_Opt2) 
          AbsoluteClicK(priNtMeter_Opt2) 
          EntErMEterS_wInDow.wEbeLemEnT("HtmL ID:=ctl00_Save_BTN_C").CliCk 

'''''''By click oN aBVe Option windOW poPuP print oPtion apPears ANd UFT noT identifyIng that wiNdOw alL TImeS, so clickinG on canceL button noT Doing
Repository flatRepository; 

    publ ic Cu sto mMe th odSe curi tyExpressionRo o t(Au thentication authentic ation ){ 
     sup er(auth e nt i c ati on ); 
  }}

A: 

Y ou cann ot @Autowi rein side a Secur i ty Expression Roo t.
You can h owe ver ma nu all y  prov ide  that  FlatR e posito ry depend en c y.
Asy ou're c o n fi guri ng your Securityo bj e cts inside a @ Config ur a ti o n  cl ass , there yo u' re ab l e to @A u to w i r e a n y instance yo u need.
Sim p lymake s pa cef or tha t new  d e pen dency in Cu stom MethodSec urityE x pressio n Root  c onstru cto r
c lass Cu st omM et h odS e cu rit y Exp ressionR oo texten ds S e c u r ityE xpr essi onRoo t 
                                i mpleme nts M et hodSecurityExpr essi onOperati ons  { 
  priva t e fina l F lat Reposit ory fla t Rep os i t o ry ;

    CustomMetho dS e c ur ityExpre ssionR o ot (         fi nalA u thent icat i on  authent icatio n ,         final  F lat Rep osito r y fl atRepo sitory){
      super(auth e ntication);
  t his. fla tRepository  = f l atRe posi t or y;   }
   . .. }And manually inject  i t at i nstan tiation point 
final Sec u r i tyExpres sion R oo t  root = new Cu stomM ethodSecur i tyExpres sionR oot(auth enticatio n ,  flatRep osi tor y); 

Q : 
UFT not ident i f ying  a  window  in  some p lay bac k
I a musing des criptive  p ro gr am min g inU FT. Duri ng  pl ay bac k, Iw ant to  chec k if  t he Win dows pr i nt d ialo gdo es a ppe ar . The n Iw ant  to cli ck the Ca nce l  but to nin that  dialog.
My p ro blem: Spor ad ica lly QT P fails to  identify the printingd ialog,soclick ingon the ca nce l butt onf ails.How ca n thi spos s i bly s o m et ime sfail, some t i mes  succ ee d?
M y codesyntax given below : 
Se t Window_Ente rMe ter= br ows e r_ s erv ic e man a g er.Window("rege xpwndtitle := E nt er Meters. * ")
S et dial og_Prin t = W i ndow_En terMeter. Dialog("r eg expw n d tit le:=Print" ) 
Set w inbtn_Cal c elPri n t= dia log _Print .W inB utton ("rege x pwn dtitl e:=Can ce l") 
fn ch ck printpop upwndow() 
{ ''''''''Na vigati ng to  th at page        call A bsol utehighlig ht( But ton_A cti o n) 
      c a ll Ab solu t ehighligh t (M ete r _ En try) 
      c all A bso l utehig hlig ht(PrintMeter_Opt 2 ) 
          A bsol u t eCl ick ( Prin tM eter_Opt2) 
     EnterMe te rs_Window.W ebElemen t( " htmlid:=ct l00_Sa ve_BTN_ C " ). C lick 
''' ''' 'By click  on  a b ve opti on  w i ndow p opup  p rint o ptiona ppea r s  and UFT not ide ntify i n g tha t  wi ndowal l times ,  soclicking o n cancel bu tton n ot d oing
Repository flatRepository;

_ _ public CustomMethodSecurityExpressionRoot(Authentication authentication)_{
 __ __  super(authentication);
_  _ }
}

A:

You cannot @Autowire_inside a SecurityExpressionRoot.
You_can_however manually provide that FlatRepository dependency.
As you're configuring your Security objects inside a @Configuration_class,_there you're_able_to_@Autowire any instance you need.
Simply_make space for that new_dependency in_CustomMethodSecurityExpressionRoot  constructor
class CustomMethodSecurityExpressionRoot extends SecurityExpressionRoot 
 __  _        _     _  ___   _     _     implements_MethodSecurityExpressionOperations {
    private final_FlatRepository flatRepository;

    CustomMethodSecurityExpressionRoot(
_    _ _    final_Authentication authentication,
 _ _  _     final_FlatRepository flatRepository) {
_     __super(authentication);
  ___ _ this.flatRepository =_flatRepository;
_ __}

   ...
}

And manually inject_it_at instantiation point
final SecurityExpressionRoot root = new_CustomMethodSecurityExpressionRoot(authentication, flatRepository);

 Q:

UFT not_identifying_a window in some_playback

I am using descriptive programming_in UFT. During playback, I want_to check_if the_Windows print dialog does appear. Then I want to click the_Cancel button in that dialog.
My problem:_Sporadically QTP fails to_identify the_printing_dialog, so clicking_on_the cancel_button fails.
How can this possibly sometimes fail,_sometimes succeed?
My_code syntax given below:
Set Window_EnterMeter =_browser_servicemanager.Window("regexpwndtitle:=Enter Meters.*") 
Set dialog_Print_=_Window_EnterMeter.Dialog("regexpwndtitle:=Print") 
Set winbtn_CalcelPrint = dialog_Print.WinButton("regexpwndtitle:=Cancel") 

fn_chckprintpopupwndow() 
{ ''''''''Navigating to that page_
    ___   call Absolutehighlight(Button_Action)_
     _  _ call Absolutehighlight(Meter_Entry) 
   __     call_Absolutehighlight(PrintMeter_Opt2)_
     ___  AbsoluteClick(PrintMeter_Opt2) 
 _     _  EnterMeters_Window.WebElement("html id:=ctl00_Save_BTN_C").Click 

'''''''By click on abve option_window popup print_option appears and UFT not_identifying_that_window all times, so clicking on cancel button not doing