Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix/40547_RemoteWebDriver Agent config page not showing #3835

Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions Ginger/Ginger/Agents/AgentEditPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,7 @@ public AgentEditPage(Agent agent, bool isReadOnly = false, bool ignoreValidation
}
if (mAgent.AgentType == eAgentType.Driver)
{
if (mAgent.DriverType == eDriverType.Selenium)
{
xAgentConfigFrame.SetContent(new WebAgentConfigEditPage(mAgent));
}
else
{
xAgentConfigFrame.SetContent(new AgentDriverConfigPage(mAgent, _viewMode));
}


xAgentConfigFrame.SetContent(new AgentDriverConfigPage(mAgent, _viewMode));
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
<Grid x:Name="xPageGrid" Grid.IsSharedSizeScope="True" Background="{StaticResource $BackgroundColor_White}">


<TabControl >
<TabItem Header="Configurations" Style="{StaticResource $RoundedTab}">
<StackPanel Orientation="Vertical" Margin="5,5,0,0">
<StackPanel Orientation="Vertical" Margin="5,5,0,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
Expand Down Expand Up @@ -108,8 +106,22 @@
</Expander.Header>
<Expander.Content>
<StackPanel Margin="30,5,0,0">

<StackPanel x:Name="xChromePnl">
<StackPanel x:Name="xEdgeIE">
<StackPanel Orientation="Horizontal" Margin="{StaticResource ChildGap}">
<CheckBox x:Name="xIgnoreIEProtectedModeCB" Content="Ignore IE Protected Mode" Width="{StaticResource LabelWidth}" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource $CeckBoxStyle}"/>
<CheckBox x:Name="xUse64BitbrowserCB" Content="Use 64Bit browser" Margin="{StaticResource ChildGap}" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource $CeckBoxStyle}" Width="{StaticResource VEControlWidth}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="{StaticResource ChildGap}">
<CheckBox x:Name="xEnsureCleanSessionCB" Content="Ensure Clean Session" Margin="{StaticResource ChildGap}" Width="{StaticResource LabelWidth}" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource $CeckBoxStyle}"/>
<CheckBox x:Name="xOpenIEModeInEdgeCB" Content="Open IE Mode In Edge" Width="{StaticResource VEControlWidth}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="{StaticResource ChildGap}" Style="{StaticResource $CeckBoxStyle}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="{StaticResource ChildGap}">

<CheckBox x:Name="xEnableNativeEventsCB" Content="Enable Native Events" VerticalAlignment="Center" Margin="{StaticResource ChildGap}" HorizontalAlignment="Left" Style="{StaticResource $CeckBoxStyle}"/>

</StackPanel>
</StackPanel>
<StackPanel x:Name="xChromePnl">
<StackPanel Orientation="Horizontal" Margin="{StaticResource ChildGap}">
<Label Content="Emulation Device Name:" Style="{StaticResource $LabelStyle}" Width="{StaticResource LabelWidth}"/>
<Actions:UCValueExpression x:Name="xEmulationDeviceNameVE" Width="{StaticResource VEControlWidth}"/>
Expand All @@ -134,29 +146,7 @@
<Actions:UCValueExpression x:Name="xBrowserVersionVE" Width="{StaticResource VEControlWidth}"/>
</StackPanel>
</StackPanel>
<StackPanel x:Name="xEdgeIE">

<StackPanel Orientation="Horizontal" >

</StackPanel>
<StackPanel Orientation="Horizontal" Margin="{StaticResource ChildGap}">
<CheckBox x:Name="xIgnoreIEProtectedModeCB" Content="Ignore IE Protected Mode" Width="{StaticResource LabelWidth}" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource $CeckBoxStyle}"/>
<CheckBox x:Name="xUse64BitbrowserCB" Content="Use 64Bit browser" Margin="{StaticResource ChildGap}" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource $CeckBoxStyle}" Width="{StaticResource VEControlWidth}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="{StaticResource ChildGap}">
<CheckBox x:Name="xEnsureCleanSessionCB" Content="Ensure Clean Session" Margin="{StaticResource ChildGap}" Width="{StaticResource LabelWidth}" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource $CeckBoxStyle}"/>
<CheckBox x:Name="xOpenIEModeInEdgeCB" Content="Open IE Mode In Edge" Width="{StaticResource VEControlWidth}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="{StaticResource ChildGap}" Style="{StaticResource $CeckBoxStyle}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="{StaticResource ChildGap}">

<CheckBox x:Name="xEnableNativeEventsCB" Content="Enable Native Events" VerticalAlignment="Center" Margin="{StaticResource ChildGap}" HorizontalAlignment="Left" Style="{StaticResource $CeckBoxStyle}"/>

</StackPanel>
<StackPanel Orientation="Horizontal" Margin="{StaticResource ChildGap}">
<Label Content="Edge Excutable Path:" Style="{StaticResource $LabelStyle}" Width="{StaticResource LabelWidth}"/>
<Actions:UCValueExpression x:Name="xEdgeExcutablePathVE" Width="{StaticResource VEControlWidth}"/>
</StackPanel>
</StackPanel>


</StackPanel>
</Expander.Content>
Expand Down Expand Up @@ -231,8 +221,21 @@
</StackPanel.Resources>

<StackPanel >
<StackPanel Orientation="Horizontal" Margin="{StaticResource ChildGap}">
<CheckBox x:Name="xStartBMPCB" Content="Start BMP" VerticalAlignment="Center" Margin="{StaticResource ChildGap}" HorizontalAlignment="Left" Style="{StaticResource $CeckBoxStyle}" Width="{StaticResource LabelWidth}"/>

<StackPanel Orientation="Horizontal" Margin="{StaticResource ChildGap}">
<CheckBox x:Name="xAutoFrameShiftForPOMCB" Content="Auto-handle iFrame shift for POM element" Margin="{StaticResource ChildGap}" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource $CeckBoxStyle}"/>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="{StaticResource ChildGap}">
<CheckBox x:Name="xHideConsoleWindowCB" Content="Hide Console Window" VerticalAlignment="Center" Margin="{StaticResource ChildGap}" HorizontalAlignment="Left" Style="{StaticResource $CeckBoxStyle}" Width="{StaticResource LabelWidth}"/>



<CheckBox x:Name="xFrameWindowScreenShotCB" Content="Capture active frame/window on failure" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="{StaticResource ChildGap}" Style="{StaticResource $CeckBoxStyle}"/>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="{StaticResource ChildGap}">
<Label Content="Selenium User Arguments:" Style="{StaticResource $LabelStyle}" Width="{StaticResource LabelWidth}"/>
<Actions:UCValueExpression x:Name="xSeleniumUserArgumentsVE" Width="{StaticResource VEControlWidth}"/>
</StackPanel>
Expand Down Expand Up @@ -274,19 +277,7 @@



<StackPanel Orientation="Horizontal" Margin="{StaticResource ChildGap}">
<CheckBox x:Name="xStartBMPCB" Content="Start BMP" VerticalAlignment="Center" Margin="{StaticResource ChildGap}" HorizontalAlignment="Left" Style="{StaticResource $CeckBoxStyle}" Width="{StaticResource LabelWidth}"/>

<CheckBox x:Name="xAutoFrameShiftForPOMCB" Content="Handle IFrame Shift Automatically For Pom Element" Margin="{StaticResource ChildGap}" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource $CeckBoxStyle}"/>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="{StaticResource ChildGap}">
<CheckBox x:Name="xHideConsoleWindowCB" Content="Hide Console Window" VerticalAlignment="Center" Margin="{StaticResource ChildGap}" HorizontalAlignment="Left" Style="{StaticResource $CeckBoxStyle}" Width="{StaticResource LabelWidth}"/>



<CheckBox x:Name="xFrameWindowScreenShotCB" Content="Take Only Active Frame Or Window Screen Shot In Case Of Failure" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="{StaticResource ChildGap}" Style="{StaticResource $CeckBoxStyle}"/>
</StackPanel>




Expand All @@ -300,8 +291,6 @@



</StackPanel>
</TabItem>
</TabControl>
</StackPanel>
</Grid>
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,25 @@ public WebAgentConfigEditPage(Agent mAgent)
this.mAgent = mAgent;
InitializeComponent();

bindElement();
BindElement();

DriverConfigParam? browserTypeParam = mAgent.DriverConfiguration.FirstOrDefault(p => string.Equals(p.Parameter, nameof(GingerWebDriver.BrowserType)));
if (browserTypeParam != null)
{
browserTypeParam.PropertyChanged += BrowserTypeParam_PropertyChanged;
}
WebBrowserType browserType = Enum.Parse<WebBrowserType>(browserTypeParam?.Value);
edgeIEPnlVisibility(browserType);
chromePnlvisibilitly(browserType);
chromeFirefoxPnlVisibility(browserType);
allBrowserNotBravePnl(browserType);
proxyPnlVisbility();
EdgeIEPnlVisibility(browserType);
ChromePnlvisibilitly(browserType);
ChromeFirefoxPnlVisibility(browserType);
AllBrowserNotBravePnl(browserType);
ProxyPnlVisbility();
}

/// <summary>
/// Binds the elements of the page.
/// </summary>
void bindElement()
void BindElement()
{

#region ProxyConfigration
Expand Down Expand Up @@ -246,7 +246,7 @@ void bindElement()
BindingHandler.ObjFieldBinding(xStartBMPPortVE, TextBox.ToolTipProperty, startBMPPort, nameof(DriverConfigParam.Description));

//Unhandled promt Behavior
GingerCore.General.FillComboFromEnumType(xUnhandledPromptBehaviorComboBox, typeof(SeleniumDriver.eUnhandledPromptBehavior));
GingerCore.General.FillComboFromEnumObj(xUnhandledPromptBehaviorComboBox, new SeleniumDriver().UnhandledPromptBehavior1);
DriverConfigParam UnhandledPromptBehavior = mAgent.GetOrCreateParam(nameof(SeleniumDriver.UnhandledPromptBehavior));
BindingHandler.ObjFieldBinding(xUnhandledPromptBehaviorComboBox, ComboBox.SelectedValueProperty, UnhandledPromptBehavior, nameof(DriverConfigParam.Value));
BindingHandler.ObjFieldBinding(xUnhandledPromptBehaviorComboBox, ComboBox.ToolTipProperty, UnhandledPromptBehavior, nameof(DriverConfigParam.Description));
Expand Down Expand Up @@ -288,8 +288,7 @@ void bindElement()

if (!string.IsNullOrEmpty(proxyName.Value))
{
autoDetect.Value = "False";
BindingHandler.ObjFieldBinding(xAutoDetectProxyCB, CheckBox.IsCheckedProperty, autoDetect, nameof(DriverConfigParam.Value));
xAutoDetectProxyCB.IsChecked= false;
}
}

Expand All @@ -316,17 +315,17 @@ private void BrowserTypeParam_PropertyChanged(object? sender, PropertyChangedEve
}

WebBrowserType browserType = Enum.Parse<WebBrowserType>(driverConfigParam.Value);
edgeIEPnlVisibility(browserType);
chromePnlvisibilitly(browserType);
chromeFirefoxPnlVisibility(browserType);
allBrowserNotBravePnl(browserType);
EdgeIEPnlVisibility(browserType);
ChromePnlvisibilitly(browserType);
ChromeFirefoxPnlVisibility(browserType);
AllBrowserNotBravePnl(browserType);
}

/// <summary>
/// Sets the visibility of the Edge/IE panel based on the specified browser type.
/// </summary>
/// <param name="result">The browser type.</param>
void allBrowserNotBravePnl(WebBrowserType result)
void AllBrowserNotBravePnl(WebBrowserType result)
{


Expand All @@ -346,7 +345,7 @@ void allBrowserNotBravePnl(WebBrowserType result)
/// Sets the visibility of the Edge/IE panel based on the specified browser type.
/// </summary>
/// <param name="result">The browser type.</param>
void edgeIEPnlVisibility(WebBrowserType result)
void EdgeIEPnlVisibility(WebBrowserType result)
{


Expand All @@ -365,7 +364,7 @@ void edgeIEPnlVisibility(WebBrowserType result)
/// Sets the visibility of the Chrome panel based on the specified browser type.
/// </summary>
/// <param name="result">The browser type.</param>
void chromePnlvisibilitly(WebBrowserType result)
void ChromePnlvisibilitly(WebBrowserType result)
{
if (result == WebBrowserType.Chrome|| result==WebBrowserType.Brave)
{
Expand All @@ -382,7 +381,7 @@ void chromePnlvisibilitly(WebBrowserType result)
/// Sets the visibility of the Chrome/Firefox panel based on the specified browser type.
/// </summary>
/// <param name="result">The browser type.</param>
void chromeFirefoxPnlVisibility(WebBrowserType result)
void ChromeFirefoxPnlVisibility(WebBrowserType result)
{
if (result == WebBrowserType.Chrome || result == WebBrowserType.FireFox || result == WebBrowserType.Brave)
{
Expand All @@ -398,7 +397,7 @@ void chromeFirefoxPnlVisibility(WebBrowserType result)
/// </summary>
/// <param name="result">The browser type.</param>

void proxyPnlVisbility()
void ProxyPnlVisbility()
{
if (xAutoDetectProxyCB.IsChecked == false)
{
Expand All @@ -412,7 +411,7 @@ void proxyPnlVisbility()
}
private void xAutoDetectProxyCB_Click(object sender, RoutedEventArgs e)
{
proxyPnlVisbility();
ProxyPnlVisbility();
xProxyVE.ValueTextBox.Text = "";
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,36 @@ public enum ePageLoadStrategy
Normal,
Eager ,
None,
}

}
public enum eUnhandledPromptBehavior
{
Default,
Ignore,
Accept,
Dismiss,
AcceptAndNotify,
[EnumValueDescription("Default")]
Default,
[EnumValueDescription("Ignore")]
Ignore,
[EnumValueDescription("Accept")]
Accept,
[EnumValueDescription("Dismiss")]
Dismiss,
[EnumValueDescription("Accept And Notify")]
AcceptAndNotify,
[EnumValueDescription("Dismiss And Notify")]
DismissAndNotify
}
eUnhandledPromptBehavior mUnhandledPromptBehavior;

public eUnhandledPromptBehavior UnhandledPromptBehavior1
{
get { return mUnhandledPromptBehavior; }
set
{
if (mUnhandledPromptBehavior != value)
{
mUnhandledPromptBehavior = value;

}
}
}
public enum eBrowserLogLevel
{

Expand Down Expand Up @@ -167,6 +185,10 @@ public override string GetDriverConfigsEditPageName(Agent.eDriverType driverSubT
{
return "SeleniumRemoteWebDriverEditPage";
}
else if (browserType == WebBrowserType.Chrome|| browserType == WebBrowserType.Brave || browserType == WebBrowserType.Edge || browserType == WebBrowserType.InternetExplorer || browserType == WebBrowserType.FireFox )
{
return "WebAgentConfigEditPage";
}
else
{
return null;
Expand Down Expand Up @@ -268,7 +290,7 @@ public override string GetDriverConfigsEditPageName(Agent.eDriverType driverSubT

[UserConfigured]
[UserConfiguredDefault("")]
[UserConfiguredDescription("Only for Chrome, Firefox & Edge | Full path for the User Profile folder")]
[UserConfiguredDescription("Only for Chrome, Firefox, Edge and Brave | Full path for the User Profile folder")]
public string UserProfileFolderPath { get; set; }

[UserConfigured]
Expand Down
Loading