Skip to content

Commit

Permalink
fix: StackOverflowException when calling FindElementByImage() (#438)
Browse files Browse the repository at this point in the history
resolves #437
  • Loading branch information
laolubenson authored Sep 19, 2020
1 parent 989b855 commit b03fe23
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ packages
.idea
.vs/
env.json
.vscode/
.vscode/
*.user
4 changes: 2 additions & 2 deletions src/Appium.Net/Appium/AppiumDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ public IReadOnlyCollection<W> FindElementsByAccessibilityId(string selector) =>

#region IFindsByImage Members

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

public IReadOnlyCollection<W> FindElementsByImage(string base64Template) =>
ConvertToExtendedWebElementCollection<W>(FindElements(MobileBy.Image(base64Template)));
ConvertToExtendedWebElementCollection<W>(FindElements(MobileSelector.Image, base64Template));

#endregion

Expand Down
8 changes: 4 additions & 4 deletions src/Appium.Net/Appium/Interfaces/IFindsByimage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public interface IFindsByImage<out W> : IFindsByFluentSelector<W> where W : IWeb
/// <summary>
/// Performs the lookup for a single element by matching its image template
/// to the current full screen shot. This type of locator requires OpenCV libraries
/// and bindings for NodeJS to be installed on the server machine. ookup options
/// fine-tuning might be done via <see cref="IHasSettings.SetSetting"/>. (Supported since Appium 1.8.2)
/// and bindings for NodeJS to be installed on the server machine.
/// Lookup options fine-tuning might be done via <see cref="IHasSettings.SetSetting"/>. (Supported since Appium 1.8.2)
/// </summary>
/// <param name="base64Template">base64-encoded template image string.
/// Supported image formats are the same as for OpenCV library.
Expand All @@ -36,8 +36,8 @@ public interface IFindsByImage<out W> : IFindsByFluentSelector<W> where W : IWeb
/// <summary>
/// Performs the lookup for a list of elements by matching its image template
/// to the current full screen shot. This type of locator requires OpenCV libraries
/// and bindings for NodeJS to be installed on the server machine. ookup options
/// fine-tuning might be done via <see cref="IHasSettings.SetSetting"/>. (Supported since Appium 1.8.2)
/// and bindings for NodeJS to be installed on the server machine.
/// Lookup options fine-tuning might be done via <see cref="IHasSettings.SetSetting"/>. (Supported since Appium 1.8.2)
/// </summary>
/// <param name="base64Template">base64-encoded template image string.
/// Supported image formats are the same as for OpenCV library.
Expand Down

0 comments on commit b03fe23

Please sign in to comment.