11using Aquality . Selenium . Core . Elements . Interfaces ;
22using Aquality . Selenium . Core . Localization ;
3- using Aquality . Selenium . Core . Logging ;
43using Aquality . Selenium . Core . Waitings ;
54using OpenQA . Selenium ;
65using System ;
@@ -15,19 +14,13 @@ namespace Aquality.Selenium.Core.Elements
1514 /// </summary>
1615 public class ElementFinder : IElementFinder
1716 {
18- public ElementFinder ( Logger logger , ILocalizedLogger localizedLogger , ILocalizationManager localizationManager , ConditionalWait conditionalWait )
17+ public ElementFinder ( ILocalizedLogger logger , ConditionalWait conditionalWait )
1918 {
2019 Logger = logger ;
21- LocalizedLogger = localizedLogger ;
22- LocalizationManager = localizationManager ;
2320 ConditionalWait = conditionalWait ;
2421 }
2522
26- private Logger Logger { get ; }
27-
28- private ILocalizedLogger LocalizedLogger { get ; }
29-
30- private ILocalizationManager LocalizationManager { get ; }
23+ private ILocalizedLogger Logger { get ; }
3124
3225 private ConditionalWait ConditionalWait { get ; }
3326
@@ -90,7 +83,7 @@ public ReadOnlyCollection<IWebElement> FindElements(By locator, DesiredState des
9083
9184 private void HandleTimeoutException ( WebDriverTimeoutException ex , DesiredState desiredState , By locator , List < IWebElement > foundElements )
9285 {
93- var message = LocalizationManager . GetLocalizedMessage ( "loc.no. elements.found.in.state" , locator . ToString ( ) , desiredState . StateName ) ;
86+ var message = $ "No elements with locator ' { locator . ToString ( ) } ' were found in { desiredState . StateName } state" ;
9487 if ( desiredState . IsCatchingTimeoutException )
9588 {
9689 if ( ! foundElements . Any ( ) )
@@ -99,11 +92,11 @@ private void HandleTimeoutException(WebDriverTimeoutException ex, DesiredState d
9992 {
10093 throw new NoSuchElementException ( message ) ;
10194 }
102- Logger . Debug ( message ) ;
95+ Logger . Debug ( "loc.no.elements.found.in.state" , null , locator . ToString ( ) , desiredState . StateName ) ;
10396 }
10497 else
10598 {
106- LocalizedLogger . Debug ( "loc.elements.were.found.but.not.in.state" , null , locator . ToString ( ) , desiredState . StateName ) ;
99+ Logger . Debug ( "loc.elements.were.found.but.not.in.state" , null , locator . ToString ( ) , desiredState . StateName ) ;
107100 }
108101 }
109102 else
0 commit comments