1
1
using Aquality . Selenium . Core . Elements . Interfaces ;
2
2
using Aquality . Selenium . Core . Localization ;
3
- using Aquality . Selenium . Core . Logging ;
4
3
using Aquality . Selenium . Core . Waitings ;
5
4
using OpenQA . Selenium ;
6
5
using System ;
@@ -15,19 +14,13 @@ namespace Aquality.Selenium.Core.Elements
15
14
/// </summary>
16
15
public class ElementFinder : IElementFinder
17
16
{
18
- public ElementFinder ( Logger logger , ILocalizedLogger localizedLogger , ILocalizationManager localizationManager , ConditionalWait conditionalWait )
17
+ public ElementFinder ( ILocalizedLogger logger , ConditionalWait conditionalWait )
19
18
{
20
19
Logger = logger ;
21
- LocalizedLogger = localizedLogger ;
22
- LocalizationManager = localizationManager ;
23
20
ConditionalWait = conditionalWait ;
24
21
}
25
22
26
- private Logger Logger { get ; }
27
-
28
- private ILocalizedLogger LocalizedLogger { get ; }
29
-
30
- private ILocalizationManager LocalizationManager { get ; }
23
+ private ILocalizedLogger Logger { get ; }
31
24
32
25
private ConditionalWait ConditionalWait { get ; }
33
26
@@ -90,7 +83,7 @@ public ReadOnlyCollection<IWebElement> FindElements(By locator, DesiredState des
90
83
91
84
private void HandleTimeoutException ( WebDriverTimeoutException ex , DesiredState desiredState , By locator , List < IWebElement > foundElements )
92
85
{
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" ;
94
87
if ( desiredState . IsCatchingTimeoutException )
95
88
{
96
89
if ( ! foundElements . Any ( ) )
@@ -99,11 +92,11 @@ private void HandleTimeoutException(WebDriverTimeoutException ex, DesiredState d
99
92
{
100
93
throw new NoSuchElementException ( message ) ;
101
94
}
102
- Logger . Debug ( message ) ;
95
+ Logger . Debug ( "loc.no.elements.found.in.state" , null , locator . ToString ( ) , desiredState . StateName ) ;
103
96
}
104
97
else
105
98
{
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 ) ;
107
100
}
108
101
}
109
102
else
0 commit comments