GeckoFx not displaying page correctly - c#

I'm using the GeckoFX winforms control in a .Net app to display a Predix Platform app. Not all of the components in the page are rendering, and the Javascript redirects aren't working. But everything loads fine in the latest version of Firefox.
Note that I'm using the binaries from https://www.nuget.org/packages/GeckoFX/ instead of initializing Xpcom using the Firefox dir. If I point Xpcom to my Firefox dir I get these errors:
Gecko.Xpcom.DirectoryServiceProvider.GetFile: not implemented:
permissionDBPDir A first chance exception of type
'System.Runtime.InteropServices.COMException' occurred in
Geckofx-Core.dll Error: 6/12/2017 10:10:09
AMMainUnhandled
Exception: Class not registered (Exception from HRESULT: 0x80040154
(REGDB_E_CLASSNOTREG)) Audit: 6/12/2017 10:10:09
AMMainStack
Trace: at Gecko.nsIServiceManager.GetServiceByContractID(String
aContractID, Guid& aIID) at
Gecko.Xpcom.GetService[TInterfaceType](String contractID) in
D:\temp\ddfb20c\Geckofx-Core\Xpcom.cs:line 745 at
Gecko.DefaultPromptFactory.Init() in
D:\temp\ddfb20c\Geckofx-Core\PromptService.cs:line 79 at
Gecko.PromptFactoryFactory.Init() in
D:\temp\ddfb20c\Geckofx-Core\PromptService.cs:line 60 at
Gecko.Xpcom.Initialize(String binDirectory) in
D:\temp\ddfb20c\Geckofx-Core\Xpcom.cs:line 381 at
XiboClient.MainForm.InitializeXibo() in
c:\Users\220023166\Documents\Visual Studio
2010\Projects\xibo-dotnetclient-1.8.1\MainForm.cs:line 165 at
XiboClient.MainForm..ctor() in c:\Users\220023166\Documents\Visual
Studio 2010\Projects\xibo-dotnetclient-1.8.1\MainForm.cs:line 156
at XiboClient.Program.RunClient() in
c:\Users\220023166\Documents\Visual Studio
2010\Projects\xibo-dotnetclient-1.8.1\Program.cs:line 136 at
XiboClient.Program.Main(String[] args) in
c:\Users\220023166\Documents\Visual Studio
2010\Projects\xibo-dotnetclient-1.8.1\Program.cs:line 118
Is there a security setting or something I might be missing in order to get this to work? Or is there a way I can view the webpage console through GeckoFX? I've inspected the page with Fiddler and it looks like all of the elements are loading correctly.

Related

UWP: System.Reflection.TargetInvocationException

This is the error: (it is not complete but this is what VS gives me)
XDG0062 System.Reflection.TargetInvocationException: Exception has
been thrown by the target of an invocation. --->
Windows.UI.Xaml.Markup.XamlParseException: The text associated with
this error code could not be found.
No matching constructor found on type 'SMPlayer.MediaControl'. [Line:
163 Position: 25] at
Windows.UI.Xaml.Application.LoadComponent(Object component, Uri
resourceLocator, ComponentResourceLocation componentResourceLocation)
at SMPlayer.MediaControl.InitializeComponent() at
SMPlayer.M SMPlayer MainPage.xaml 151
However, my MediaControl does have a constructor, which is defined here. (Sorry for posting the link instead of the code). And MediaControl.g.i.cs does not have Line 163.
Nonetheless, my project still compiles and runs correctly even with that error. And my MediaControl is displayed properly.
What is wrong?

App crashes at startup, KERNELBASE.dll, Exception Code e0434352

My C# / WinForms app crashes at startup.
I went through several posts here that cover that topic but I wasn't able to solve the problem yet.
That is the error I get:
Problemsignature:
Problemeventname: APPCRASH
Applicationname: MyApp.exe
Applicationversion: 1.0.0.0
Applicationtimestamp: 5b4c47c9
Faultedmodulename: KERNELBASE.dll
Faultedmoduleversion: 6.1.7601.24150
Faultedmoduletimestamp: 5b0cbc65
Exceptioncode: e0434352
Exceptionoffset: 000000000001a06d
Operatingsystemversion: 6.1.7601.2.1.0.272.7
Location-ID: 1031
Additionalinformation 1: 367e
Additionalinformation 2: 367e805d0e7c1ec3f63b05bb5ce5c416
Additionalinformation 3: 5a60
Additionalinformation 4: 5a6090e598b447a9043f485266c8e273
I searched for more detailed logs and found this:
Version=1
EventType=APPCRASH
EventTime=131762111243226835
ReportType=2
Consent=1
ReportIdentifier=6925141c-88e4-11e8-a994-000c2920c559
IntegratorReportIdentifier=6925141b-88e4-11e8-a994-000c2920c559
Response.type=4
Sig[0].Name=Applicationname
Sig[0].Value=MyApp.exe
Sig[1].Name=Applicationversion
Sig[1].Value=1.0.0.0
Sig[2].Name=Applicationtimestamp
Sig[2].Value=5b4c47c9
Sig[3].Name=Faultedmodulename
Sig[3].Value=KERNELBASE.dll
Sig[4].Name=Faultedmoduleversion
Sig[4].Value=6.1.7601.24150
Sig[5].Name=Faultedmoduletimestamp
Sig[5].Value=5b0cbc65
Sig[6].Name=Exceptioncode
Sig[6].Value=e0434352
Sig[7].Name=Exceptionoffset
Sig[7].Value=000000000001a06d
DynamicSig[1].Name=Operatingsystemversion
DynamicSig[1].Value=6.1.7601.2.1.0.272.7
DynamicSig[2].Name=Location-ID
DynamicSig[2].Value=1031
DynamicSig[22].Name=Additionalinformation 1
DynamicSig[22].Value=367e
DynamicSig[23].Name=Additionalinformation 2
DynamicSig[23].Value=367e805d0e7c1ec3f63b05bb5ce5c416
DynamicSig[24].Name=Additionalinformation 3
DynamicSig[24].Value=5a60
DynamicSig[25].Name=Additionalinformation 4
DynamicSig[25].Value=5a6090e598b447a9043f485266c8e273
UI[2]=C:\Program Files\MyApp\MyApp.exe
UI[3]=MyApp stopped working
UI[4]=Windows can look online for a solution to the problem.
UI[5]=Search online for a solution and close the program
UI[6]=Search for a solution online later and close the program
UI[7]=Close the program
LoadedModule[0]=C:\Program Files\MyApp\MyApp.exe
LoadedModule[1]=C:\Windows\SYSTEM32\ntdll.dll
LoadedModule[2]=C:\Windows\SYSTEM32\MSCOREE.DLL
LoadedModule[3]=C:\Windows\system32\KERNEL32.dll
LoadedModule[4]=C:\Windows\system32\KERNELBASE.dll
LoadedModule[5]=C:\Windows\system32\ADVAPI32.dll
LoadedModule[6]=C:\Windows\system32\msvcrt.dll
LoadedModule[7]=C:\Windows\SYSTEM32\sechost.dll
LoadedModule[8]=C:\Windows\system32\RPCRT4.dll
LoadedModule[9]=C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscoreei.dll
LoadedModule[10]=C:\Windows\system32\SHLWAPI.dll
LoadedModule[11]=C:\Windows\system32\GDI32.dll
LoadedModule[12]=C:\Windows\system32\USER32.dll
LoadedModule[13]=C:\Windows\system32\LPK.dll
LoadedModule[14]=C:\Windows\system32\USP10.dll
LoadedModule[15]=C:\Windows\system32\IMM32.DLL
LoadedModule[16]=C:\Windows\system32\MSCTF.dll
LoadedModule[17]=C:\PROGRA~2\Sophos\SOPHOS~1\SOPHOS~2.DLL
LoadedModule[18]=C:\Windows\system32\PSAPI.DLL
LoadedModule[19]=C:\Windows\system32\VERSION.dll
LoadedModule[20]=C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
LoadedModule[21]=C:\Windows\system32\MSVCR120_CLR0400.dll
LoadedModule[22]=C:\Windows\assembly\NativeImages_v4.0.30319_64\mscorlib\ccb48f84a5cca36e9b0205b6a65ee54a\mscorlib.ni.dll
LoadedModule[23]=C:\Windows\system32\ole32.dll
LoadedModule[24]=C:\Windows\system32\CRYPTBASE.dll
LoadedModule[25]=C:\Program Files (x86)\TeamViewer\tv_x64.dll
LoadedModule[26]=C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.18837_none_a4d981ff711297b6\COMCTL32.dll
LoadedModule[27]=C:\Windows\system32\SHELL32.dll
LoadedModule[28]=C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clrjit.dll
LoadedModule[29]=C:\Windows\system32\CRYPTSP.dll
LoadedModule[30]=C:\Windows\system32\rsaenh.dll
LoadedModule[31]=C:\Windows\system32\RpcRtRemote.dll
LoadedModule[32]=C:\Windows\assembly\NativeImages_v4.0.30319_64\System\4575f30d7b13f1377c287e162ba3147e\System.ni.dll
LoadedModule[33]=C:\Windows\assembly\NativeImages_v4.0.30319_64\System.Drawing\3b5c30aa581d90fd18f9593f9c842b6d\System.Drawing.ni.dll
LoadedModule[34]=C:\Windows\assembly\NativeImages_v4.0.30319_64\System.Windows.Forms\7a911b66e6652a094625f0ce974dc434\System.Windows.Forms.ni.dll
LoadedModule[35]=C:\Windows\Microsoft.NET\Framework64\v4.0.30319\diasymreader.dll
FriendlyEventName=No longer functional
ConsentKey=APPCRASH
AppName=MyApp
AppPath=C:\Program Files\MyApp\MyApp.exe
However, that doesn't really help me. I've checked the startup of the app in debug mode (different machine) where I am able to run it and logged the loaded assemblies. I went over each assembly and checked whether it was available on the other machine. Everything was there, although some assemblies are not available in the GAC but in the apps directory.
I have no idea where to look now, thanks for your help!
Edit: I get this message in the event viewer:
Anwendung: MyApp.exe
Frameworkversion: v4.0.30319
Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
Ausnahmeinformationen: System.IO.FileLoadException
bei MyApp.Program.Main()
Is there a way to get more information which assembly is missing?
I solved my issue by checking the versions of the referenced assembly. One third-party assembly had a minor update which I forgot to update in my clients folder.

C# Protractor angular never provided resumeBootstrap

This is my first stackoverflow question. I already searched for some answers on this site, but all the solutions I found didn't worked for me, or they were meant for Java or javascript.
The situation
As a junior automation tester I created a sort of Automation Test Framework in C# with the Selenium Webdriver and Protractor.Net.
The Framework consists of 2 parts.
The page objects
The tests
There is also a page object base class. In this class I defined methods that are used by every page object, such as a method for opening a specific program module.
In the tests, there is also a base class. In this class the Test attributes (C# UnitTest) are defined, such as TestInitialize, TestCleanup, AssemblyCleanup.
In the Test Base class I also defined the NgWebDriver, ChromeDriver:
driver = new NgWebDriver(new OpenQA.Selenium.Chrome.ChromeDriver());
driver.Manage().Window.Maximize();
In the Page Object Base class I defined a method to open a specific part of the
website:
public void OpenSPA(string spa)
{
driver.Navigate().GoToUrl(spa, true);
driver.Navigate().Refresh();
}
The pararmeter spa contains the url to navigate to.
The Testcase
The testcase is just simple:
open module x of the website
module x is just an url
The complete code of the testcase:
[TestMethod]
[TestCategory(cat), TestCategory(regression)]
public void Organisatie_CheckActief()
{
bool is_actief;
var organisatie = new CrmSPA(driver);
organisatie.VulVeld("Vrij zoeken", "XXXX");
is_actief = organisatie.IsRelatieActief();
//Assertion
Assert.IsTrue(is_actief == true, "Relatie is niet actief.");
The problem:
Since a couple of weeks ago I get the following error when running the testcase:
Test Name: Organisatie_CheckActief
Test FullName: FirstTest.Webdrivers.WijzigenOrganisatie_Basis.Organisatie_CheckActief
Test Source: C:\Users\XXXX\TestCases\\Organisatie\WijzigenOrganisatie_basis.cs : line 168
Test Outcome: Failed
Test Duration: 0:00:41,1353784
Result StackTrace:
bij OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
bij OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
bij OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteScriptCommand(String script, String commandName, Object[] args)
bij OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteAsyncScript(String script, Object[] args)
bij Protractor.NgWebDriver.set_Url(String value) in c:\Users\Bruno\Projets\GitHub\bbaia\protractor-net\src\Protractor\NgWebDriver.cs:regel 163
--- End of inner exception stack trace ---
bij Protractor.NgWebDriver.set_Url(String value) in c:\Users\Bruno\Projets\GitHub\bbaia\protractor-net\src\Protractor\NgWebDriver.cs:regel 193
bij Protractor.NgNavigation.GoToUrl(String url, Boolean ensureAngularApp) in c:\Users\Bruno\Projets\GitHub\bbaia\protractor-net\src\Protractor\NgNavigation.cs:regel 112
bij FirstTest.PageObjects.BaseSPA.OpenSPA(String spa) in C:\Users\\Documents\Visual Studio 2015\Projects\\\FirstTest\PageObjects\BaseSPA.cs:regel 55
bij FirstTest.PageObjects.CrmSPA.CrmSPA..ctor(NgWebDriver driver) in C:\Users\\Documents\Visual Studio 2015\Projects\\\FirstTest\PageObjects\CRM\CrmSPA\CrmSPA.cs:regel 37
bij FirstTest.Webdrivers.WijzigenOrganisatie_Basis.Organisatie_CheckActief() in C:\Users\\Documents\Visual Studio 2015\Projects\\\FirstTest\TestCases\RelatieSPA\Organisatie\WijzigenOrganisatie_basis.cs:regel 174
Result Message:
Test method FirstTest.Webdrivers.WijzigenOrganisatie_Basis.Organisatie_CheckActief threw exception:
System.InvalidOperationException: **Angular could not be found on the page** 'https://XXXXX/CRM/Relaties/ ---> OpenQA.Selenium.WebDriverTimeoutException: asynchronous script timeout: result was not received in 30 seconds
(Session info: chrome=66.0.3359.139)
(Driver info: chromedriver=2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Windows NT 6.1.7601 SP1 x86_64)
The Result on screen/browser
When running the test the following happens:
the chrome browser starts (OK)
the chrome browser opens maximized (ok)
the chrome browser gets the url (ok)
the browser is empty shows blank page (NOK)
somehow i found the following error:
angular never provided resumeBootstrap
I searched on google and stackoverflow and i tried some answers like the synchronize option:
driver.IgnoreSynchronization
the problem does not always shows up. sometimes the page is loaded and the test continues.
I already tried to reinstall protractor-net, a newer chromedriver and seleniumdriver. The problem still exist.
If anyone can help me with this.
This error message...
OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
...implies that the RemoteWebDriver incurred an error while executing a command.
Selenium being an open source framework, you can have a look at the source code here.
GoToUrl() is defined in RemoteNavigator.cs and accepts only one argument string url as follows :
/// Navigate to a url for your test
/// </summary>
/// <param name="url">String of where you want the browser to go to</param>
public void GoToUrl(string url)
{
this.driver.Url = url;
}
But in your code block while invoking GoToUrl() method along with the string spa you have also passed true. This possibly raises the error.
Solution
Within GoToUrl() method removing the argument true will solve your issue.

Selenium WebDriver with C#: select item from drop-down menu (doesn't work in IE)

It's needed to select the second item from the drop-down menu that is hidden by default. The problem it that it works fine in Fire Fox 41 browser but not in Internet Explorer 11. I'm using Selenium Web Driver with C#, nUnit in Visual Studio 2010. Tests are executed on remote VM with Selenium Server and IEDriver.
HTML looks like:
<ul id="CVC" class="buttonMenu" style="visibility: hidden; left: 183px;">
<li class="menuItem">First</li>
<li class="menuItem">Second</li>
<li class="menuItem">Third</li>
</ul>
I have C# code that works only in FireFox:
var menu = wd.FindElement(By.Id("CVC"));
var menuLi = menu.FindElements(By.TagName("li"));
menuLi[1].Click();
wd.FindElement(By.Id("TITLE")).SendKeys("blabla"); //continue to work with appeared pop-up
wd.FindElement(By.Id("CVC_OK")).Click();
When I run test in Internet Explorer an error appears:
Test Name: Bookmark
Test FullName: EEE.Tests.BT.BB
Test Source: d:\Selenium\Automation\EEEAutomation\EEEAutomation\Tests\BT.cs : line 19
Test Outcome: Failed
Test Duration: 0:00:39.319
Result Message: OpenQA.Selenium.ElementNotVisibleException : Cannot click on element (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 35 milliseconds
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'wkqacl0801', ip: '10.101.6.104', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_60'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{browserAttachTimeout=0, enablePersistentHover=true, ie.forceCreateProcessApi=false, pageLoadStrategy=normal, ie.usePerProcessProxy=false, ignoreZoomSetting=false, handlesAlerts=true, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:39901/, takesScreenshot=true, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=dismiss}]
Session ID: 6f09c88a-bd73-4cab-9312-0587c8345023
Result StackTrace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at EEE.Tests.SubTests.CreateBBSubTest.Execute(IWebDriver wd) in d:\Selenium\Automation\EEEAutomation\EEEAutomation\Tests\SubTests\CreateBBSubTest.cs:line 103
at EEE.Tests.BT.BB() in d:\Selenium\Automation\EEEAutomation\EEEAutomation\Tests\BT.cs:line 54
Does anyone know how to make it worked in Internet Explorer 11?
Not sure if IE should be considered as a real browser. In any case I reread your problem, it seems that you expect IE to work like a browser on click event. In that case you might want to help it along :
using (var wd = new InternetExplorerDriver(
new InternetExplorerOptions {EnableNativeEvents = false}))
{
//your code
}
I figured out the solution by using JavaScript. I'm not sure that this is the best solution but at least it works not only in FF, but also in IE browser:
((IJavaScriptExecutor)wd).ExecuteScript("$('#CVC li:eq(1)').click()");
wd.FindElement(By.Id("TITLE")).Clear();
wd.FindElement(By.Id("TITLE")).SendKeys("blabla");
wd.FindElement(By.Id("CVC_OK")).Click();
This worked for me:
_driver.FindElement(By.Id("IdOfControl")).SendKeys(value);

1 Error "ResolveManifestFiles" System.ArgumentException: Value does not fall within the expected range. WPF C# Desktop app

Im tray to compile a Visual Studio Solution and get this error.
Error 1 Error inesperado en la tarea "ResolveManifestFiles".
System.ArgumentException: Value does not fall within the expected range.
at Microsoft.Build.Tasks.Deployment.ManifestUtilities.NativeMethods.GetAssemblyIdentityFromFile(String filePath, Guid& riid)
at Microsoft.Build.Tasks.Deployment.ManifestUtilities.MetadataReader.ImportAttributes()
at Microsoft.Build.Tasks.Deployment.ManifestUtilities.MetadataReader.get_Attributes()
at Microsoft.Build.Tasks.Deployment.ManifestUtilities.MetadataReader.get_Name()
at Microsoft.Build.Tasks.Deployment.ManifestUtilities.AssemblyIdentity.FromManagedAssembly(String path)
at Microsoft.Build.Tasks.ResolveManifestFiles.IsFiltered(ITaskItem item)
at Microsoft.Build.Tasks.ResolveManifestFiles.GetOutputAssemblies(PublishInfo[] publishInfos, List`1& assemblyList)
at Microsoft.Build.Tasks.ResolveManifestFiles.GetOutputAssembliesAndSatellites(PublishInfo[] assemblyPublishInfos, PublishInfo[] satellitePublishInfos)
at Microsoft.Build.Tasks.ResolveManifestFiles.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__20.MoveNext() Ziruma
Im not sure what is the problem. Project compiling until i try to generate the final instalation package. Please, help me.

Categories

Resources