Skip to content

Commit

Permalink
code rabbit changes
Browse files Browse the repository at this point in the history
  • Loading branch information
IamRanjeetSingh committed Jul 8, 2024
1 parent a590dad commit 7e2c104
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ private protected async Task InjectLiveSpyScriptAsync(IBrowserTab tab)
private protected Task InjectScriptAsync(IBrowserTab tab, string script)
{
string injectionableScript = PrepareScriptForInjection(script);
//return tab.ExecuteJavascriptAsync(injectionableScript);
return tab.InjectJavascriptAsync(injectionableScript);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,7 @@ private async Task<IEnumerable<HTMLElementInfo>> LearnHtmlNodeChildElements(Html
}

IBrowserElement? browserElement = await _browserElementProvider.GetElementAsync(eLocateBy.ByXPath, childNode.XPath);
if (browserElement == null)
{
continue;
}

if (!await browserElement.IsVisibleAsync())
if (browserElement == null || !await browserElement.IsVisibleAsync())
{
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,11 +543,13 @@ public ElementInfo GetControlFromMousePosition()

IBrowserElement? browserElement = null;
try
{
browserElement = (await currentTab.GetElementsAsync("GingerLibLiveSpy.ElementFromPoint();")).FirstOrDefault();
}
catch (Exception)
{
//when we spy the element for the first time, it throws exception because X,Y point of mouse position is undefined for some reason
browserElement = (await currentTab.GetElementsAsync("GingerLibLiveSpy.ElementFromPoint();")).FirstOrDefault();
}
catch (Exception) { }
if (browserElement == null)
{
return null!;
Expand Down

0 comments on commit 7e2c104

Please sign in to comment.