Skip to content

Commit b03fe23

Browse files
authored
fix: StackOverflowException when calling FindElementByImage() (#438)
resolves #437
1 parent 989b855 commit b03fe23

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ packages
1515
.idea
1616
.vs/
1717
env.json
18-
.vscode/
18+
.vscode/
19+
*.user

src/Appium.Net/Appium/AppiumDriver.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,10 @@ public IReadOnlyCollection<W> FindElementsByAccessibilityId(string selector) =>
194194

195195
#region IFindsByImage Members
196196

197-
public W FindElementByImage(string base64Template) => FindElement(MobileBy.Image(base64Template));
197+
public W FindElementByImage(string base64Template) => FindElement(MobileSelector.Image, base64Template);
198198

199199
public IReadOnlyCollection<W> FindElementsByImage(string base64Template) =>
200-
ConvertToExtendedWebElementCollection<W>(FindElements(MobileBy.Image(base64Template)));
200+
ConvertToExtendedWebElementCollection<W>(FindElements(MobileSelector.Image, base64Template));
201201

202202
#endregion
203203

src/Appium.Net/Appium/Interfaces/IFindsByimage.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public interface IFindsByImage<out W> : IFindsByFluentSelector<W> where W : IWeb
2222
/// <summary>
2323
/// Performs the lookup for a single element by matching its image template
2424
/// to the current full screen shot. This type of locator requires OpenCV libraries
25-
/// and bindings for NodeJS to be installed on the server machine. ookup options
26-
/// fine-tuning might be done via <see cref="IHasSettings.SetSetting"/>. (Supported since Appium 1.8.2)
25+
/// and bindings for NodeJS to be installed on the server machine.
26+
/// Lookup options fine-tuning might be done via <see cref="IHasSettings.SetSetting"/>. (Supported since Appium 1.8.2)
2727
/// </summary>
2828
/// <param name="base64Template">base64-encoded template image string.
2929
/// Supported image formats are the same as for OpenCV library.
@@ -36,8 +36,8 @@ public interface IFindsByImage<out W> : IFindsByFluentSelector<W> where W : IWeb
3636
/// <summary>
3737
/// Performs the lookup for a list of elements by matching its image template
3838
/// to the current full screen shot. This type of locator requires OpenCV libraries
39-
/// and bindings for NodeJS to be installed on the server machine. ookup options
40-
/// fine-tuning might be done via <see cref="IHasSettings.SetSetting"/>. (Supported since Appium 1.8.2)
39+
/// and bindings for NodeJS to be installed on the server machine.
40+
/// Lookup options fine-tuning might be done via <see cref="IHasSettings.SetSetting"/>. (Supported since Appium 1.8.2)
4141
/// </summary>
4242
/// <param name="base64Template">base64-encoded template image string.
4343
/// Supported image formats are the same as for OpenCV library.

0 commit comments

Comments
 (0)