I am using Selenium 2 and IE7.
There are a lot of iframes present in the application I am testing.
So I am using driver.switchTo().frame() method to switch between iframes.
I also use driver.switchTo().defaultContent() before switching to an iframe.
However in some cases, driver.switchTo().frame() causes the Application to crash.
Below is the error in eclipse:
Problem signature:
Problem Event Name: APPCRASH
Application Name: javaw.exe
Application Version: 6.0.70.6
Application Timestamp: 484e4780
Fault Module Name: IEDriver.dll
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 4fdf5b90
Exception Code: c0000005
Exception Offset: 0008a71e
OS Version: 6.0.6001.2.1.0.274.10
Locale ID: 1033
Additional Information 1: 1699
Additional Information 2: 3c7b32a427f0a23d017c01e406809b93
Additional Information 3: 437a
Additional Information 4: 0abbaf052c4358d69b1ef6b054f6ab09
I even tried getting the source of the iframe by, driver.findElement(By.id(iframeID)).getAttribute("src"), and i am able to get the source of iframe.
I have also tried to introduce wait between switching of iframes but still it gives the same error.
I do not know why it is causing the application to crash as it is working for some cases.
Does anyone have any similar experience or can think of any solution??
I am using this code to choose iframe by src and it works:
driver.switchTo().frame(driver.findElement(By.cssSelector("iframe[src=\"SRC_OF_FRAME\"]")));
Related
In Windows 7, a process started with CreateProcessAsUser by a windows service with a local system account crashes, but the same process started manually runs fine. The CreateProcessAsUser functionality is in a separate COM component [64 bit C++ dll], and the windows service [dot net 4.6.1] has platform target [Any CPU]. The process does not write anything to the event log either, suggesting that no code is executed, and it crashes immediately. This code works perfectly in windows 10.
I tried to attach to the process but it ends too soon to do anything. I do get a message "Module not found" , suggesting that it doesnt find a library. But I cant figure out which one. I gave it all the libraries it needs, which can be seen by the fact that the program runs ok when started manually from the same folder. I also tried to specify the startup folder in the function CreateProcessAsUser, but there was no difference, but I think it starts in the correct folder by default [where it is located]
I found the following link on SO
Why is this process crashing as soon as it is launched?
But it did not help either. ProcMon does not show where a module was not found [It says PATH NOT FOUND if I remove a known module]
The process exit status is -1066598274
and the stack trace is
0 ntoskrnl.exe RtlNtStatusToDosError + 0x1086 0xfffff8000712f206 C:\Windows\system32\ntoskrnl.exe
1 ntoskrnl.exe RtlCopySidAndAttributesArray + 0x1789 0xfffff8000714b0d9 C:\Windows\system32\ntoskrnl.exe
2 ntoskrnl.exe RtlNtStatusToDosError + 0x1538 0xfffff8000712f6b8 C:\Windows\system32\ntoskrnl.exe
3 ntoskrnl.exe KeSynchronizeExecution + 0x3a23 0xfffff80006e75e53 C:\Windows\system32\ntoskrnl.exe
The event viewer shows the following information
Faulting application name: BizBrainAgentPluginHost.exe, version: 1.0.0.0, time stamp: 0x5b88084d
Faulting module name: KERNELBASE.dll, version: 6.1.7601.18015, time stamp: 0x50b8479b
Exception code: 0xc06d007e
Fault offset: 0x0000000000009e5d
Faulting process id: 0x484
Faulting application start time: 0x01d440746491e037
Faulting application path: C:\Program Files\Avinashi Ventures Pvt Ltd\myTallyApp Agent\BizBrainAgentPluginHost.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report Id: a2f39c97-ac67-11e8-94f1-0023ae9747d0
Thanks
I'm trying to make an automated test for my webpage and I'm using Jasmine in tandem with selenium.
When testing on chrome (using chromedriver) I get, unpredictably, the error below. It happens frequently enough that when I run a test suite it hardly ever finishes.
Ive found evidence of this bug but cant find a solid answer: https://bugs.chromium.org/p/chromedriver/issues/detail?id=732 (granted this was for chromium and I'm using chrome)
WebDriverError: no such session
(Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Mac OS X 10.11.5 x86_64)
at WebDriverError (/Users/XXXXXXX/Documents/sweetmeeting/node_modules/selenium-webdriver/lib/error.js:27:10)
at Object.checkLegacyResponse (/Users/XXXXXXX/Documents/sweetmeeting/node_modules/selenium-webdriver/lib/error.js:639:15)
at parseHttpResponse (/Users/XXXXXXX/Documents/sweetmeeting/node_modules/selenium-webdriver/http/index.js:538:13)
at /Users/XXXXXXX/Documents/sweetmeeting/node_modules/selenium-webdriver/http/index.js:472:11
at ManagedPromise.invokeCallback_ (/Users/XXXXXXX/Documents/sweetmeeting/node_modules/selenium-webdriver/lib/promise.js:1379:14)
at TaskQueue.execute_ (/Users/XXXXXXX/Documents/sweetmeeting/node_modules/selenium-webdriver/lib/promise.js:2913:14)
at TaskQueue.executeNext_ (/Users/XXXXXXX/Documents/sweetmeeting/node_modules/selenium-webdriver/lib/promise.js:2896:21)
at /Users/XXXXXXX/Documents/sweetmeeting/node_modules/selenium-webdriver/lib/promise.js:2820:25
at /Users/XXXXXXX/Documents/sweetmeeting/node_modules/selenium-webdriver/lib/promise.js:639:7
at process._tickCallback (node.js:369:9)
From: Task: WebElement.isDisplayed()
at Driver.schedule (/Users/XXXXXXX/Documents/sweetmeeting/node_modules/selenium-webdriver/lib/webdriver.js:377:17)
at WebElement.schedule_ (/Users/XXXXXXX/Documents/sweetmeeting/node_modules/selenium-webdriver/lib/webdriver.js:1744:25)
at WebElement.isDisplayed (/Users/XXXXXXX/Documents/sweetmeeting/node_modules/selenium-webdriver/lib/webdriver.js:2110:17)
at driver.findElements.then.error (/Users/XXXXXXX/Documents/sweetmeeting/Test/front_end_testing/spec/dashboard_tester.js:251:34)
at ManagedPromise.invokeCallback_ (/Users/XXXXXXX/Documents/sweetmeeting/node_modules/selenium-webdriver/lib/promise.js:1379:14)
at TaskQueue.execute_ (/Users/XXXXXXX/Documents/sweetmeeting/node_modules/selenium-webdriver/lib/promise.js:2913:14)
at TaskQueue.executeNext_ (/Users/XXXXXXX/Documents/sweetmeeting/node_modules/selenium-webdriver/lib/promise.js:2896:21)
at /Users/XXXXXXX/Documents/sweetmeeting/node_modules/selenium-webdriver/lib/promise.js:2775:27
at /Users/XXXXXXX/Documents/sweetmeeting/node_modules/selenium-webdriver/lib/promise.js:639:7
at process._tickCallback (node.js:369:9)
We've also been struggling with this issue for a long time now and recently resolved it so thought I would post here incase it helps someone else.
Turns out for us it was memory related. We run our tests inside a docker container and the docker default dev/shm size is 64mb. Increasing this resolved the "no such session" issue for us.
We use docker compose so just added shm_size: 256M to the docker-compose.yml file.
I recently encountered this exception too. It first appeared to be undeterministic too, but after thorough investigation I realized that it happens deterministrically if you call ChromeDriver.Close() and then tries to FindElement.
In my case, ChromeDriver.Close() was called in an exception handler of a previous test, which happened due to a timing issue. This only affected the next test so it added to the feeling that this issue is flaky. But as I said, my investigation revealed that it is deterministic.
Having said that, this is my experience with that error. Could be that your case is different...
This error message...
WebDriverError: no such session
(Driver info: chromedriver=a.b.c (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Mac OS X 10.11.5 x86_64)
...implies that the ChromeDriver was unable to communicate with the existing Browsing Context i.e. Chrome Browser session.
We have discussed and analyzed this issue within the discussion Issue 732: No such session error - inconsistent problem which appears when running tests for a prolonged period. This error is usually observed after an extended period of executing the Test Suite as follows:
[0127/105308:ERROR:nacl_helper_linux.cc(289)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly
[489.849][INFO]: RESPONSE FindElements unknown error: session deleted because of page crash
from tab crashed
(Session info: chrome=p.q.r.s)
[489.849][DEBUG]: Log type 'driver' lost 0 entries on destruction
[489.849][DEBUG]: Log type 'browser' lost 9 entries on destruction
This error is defined in nacl_helper_linux.cc as follows:
// If the Zygote has started handling requests, we should be sandboxed via
// the setuid sandbox.
if (!IsSandboxed()) {
LOG(ERROR) << "NaCl helper process running without a sandbox!\n"
<< "Most likely you need to configure your SUID sandbox "
<< "correctly";
Precisely the FindElement(s) method have FAILED due to sandbox issue and Page Crash occured due to session deletion
Solution
This error can happen due to a lot of diverse reasons and the solution to address this error are as follows:
Initiate the Chrome session configuring ChromeDriver with the argument --disable-impl-side-painting
Additionally, you can also add the argument --enable-gpu-rasterization which allow heuristics to determine when a layer tile should be drawn with the Skia GPU backend. Only valid with GPU accelerated compositing + impl-side painting.
As an option, you can also add the argument --force-gpu-rasterization which always uses the Skia GPU backend for drawing layer tiles. Only valid with GPU accelerated compositing + impl-side painting. Overrides the kEnableGpuRasterization flag.
This error is also observed when the server does not recognize the unique session identifier. This happens if the session has been deleted or if the session ID is invalid in either of the following ways:
Explicit session deletion: A WebDriver session is explicitly deleted when explicitly invoking the quit() method as follows:
from selenium import webdriver
from selenium.common.exceptions import InvalidSessionIdException
driver = webdriver.Chrome(executable_path=r'C:\Utility\BrowserDrivers\chromedriver.exe')
print("Current session is {}".format(driver.session_id))
driver.quit()
try:
driver.get("https://www.google.com/")
except Exception as e:
print(e.message)
#Console Output:
Current session is a9272550-c4e5-450f-883d-553d337eed48
No active session with ID a9272550-c4e5-450f-883d-553d337eed48
Implicit session deletion: A WebDriver session is implicitly deleted when you close the last window or tab invoking close() method as follows:
driver = webdriver.Chrome(executable_path=r'C:\Utility\BrowserDrivers\chromedriver.exe')
print("Current session is {}".format(driver.session_id))
# closes current window/tab
driver.close()
try:
driver.get("https://www.google.com/")
except Exception as e:
print(e.message)
#Console Output:
Current session is a9272550-c4e5-450f-883d-553d337eed48
No active session with ID a9272550-c4e5-450f-883d-553d337eed48
You may also have to add the argument --no-sandbox
Chrome seem to crash often in Docker containers on certain pages due to too small /dev/shm. Similarly, you may have to fix the small /dev/shm size.
An example:
sudo mount -t tmpfs -o rw,nosuid,nodev,noexec,relatime,size=512M tmpfs /dev/shm
It also works if you use -v /dev/shm:/dev/shm option to share host /dev/shm
Another way to make it work would be to add the chrome_options as --disable-dev-shm-usage. This will force Chrome to use the /tmp directory instead. This may slow down the execution though since disk will be used instead of memory.
chrome_options.add_argument('--disable-dev-shm-usage')
Reference
You can find a couple of detailed discussions in:
selenium.common.exceptions.WebDriverException: Message: invalid session id using Selenium with ChromeDriver and Chrome through Python
unknown error: session deleted because of page crash from unknown error: cannot determine loading status from tab crashed with ChromeDriver Selenium
org.openqa.selenium.SessionNotCreatedException: session not created exception from tab crashed error when executing from Jenkins CI server
Sometimes we just expect any problem to be very complex and are looking for its cause far too deep, when a problem could be so obvious.
I was seeing this issue when I explicitly called browser.close() as an exception handler in my logout() method. It terminated the session and all of the following protractor tests were throwing this error.
Once I removed browser.close() and just threw an error instead, the problem was solved.
I'm trying to install Stardog, but it sends me this error:
Exception in thread "main" java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=com/complexible/stardog/cli/admin/CLI, offset=6
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:275)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:69)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:540)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:451)
at java.net.URLClassLoader.access$300(URLClassLoader.java:79)
at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1038)
at java.security.AccessController.doPrivileged(AccessController.java:284)
at java.net.URLClassLoader.findClass(URLClassLoader.java:429)
at java.lang.ClassLoader.loadClass(ClassLoader.java:660)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:358)
at java.lang.ClassLoader.loadClass(ClassLoader.java:626)
Could not find the main class: com.complexible.stardog.cli.admin.CLI. Program will exit.
Does anybody know how to solve it?
Errors of this kind typically mean the code you are attempting for run is for a different version of Java than you are trying to run.
Stardog requires Java 8:
Stardog runs on Java 8
So please ensure you are running it under Java 8, providing the output of java -version in your environment as part of your question would be helpful in determining if this is your problem.
I'm trying to crawl a website's data using Import.io desktop app, I'm running this software on a windows server 2008 r2 64bit,32 GB Ram & intel 4770 i7 CPU, But when it's crawling , Suddenly an error appears which asks me to restart the program, The error description contains :
Problem signature:
Problem Event Name: APPCRASH
Application Name: import.io.exe
Application Version: 0.0.0.0
Application Timestamp: 553e7d2c
Fault Module Name: mozalloc.dll
Fault Module Version: 24.0.0.5001
Fault Module Timestamp: 522fa8df
Exception Code: 80000003
Exception Offset: 0000119c
OS Version: 6.1.7601.2.1.0.274.10
Locale ID: 1033
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt
I've tried to download a new mozalloc.dll and replace the old one with the newer version. Which in this case , Import.io app uses xulrunner version 24, First I've replaced mozalloc.dll version 42 (newest version) with the default import.io's mozalloc.dll file at :
C:\Users\Administrator\AppData\Roaming\import.io\xulrunner-versions\24
But after that , the program interface wasn't showing up. When I opened import.io , it does open in the task manager but windows didn't show up the program's interface.
I've also downloaded the newest xulrunner version and replaced all the files in that folder , Same thing happened again.
I am using Unity for in WCF service to load component.
I am referring below mention article.
https://msdn.microsoft.com/en-us/library/vstudio/hh323725(v=vs.100).aspx
Service is working fine when i build service in visual studio with build option option any CPU.
As one third party component required 64 bit specific build. So i selected 64 bit build option.
I have downloaded Unity code and build for 64 bit but it is also not working.
I am getting below mention exception.
Could not load file or assembly 'Common.Unity' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.BadImageFormatException: Could not load file or assembly 'Common.Unity' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Common.Unity' could not be loaded.
As this is not issue of Unity.
It is issue of IISExprees of VS2012 which is support on 32 bit.
Can't get IIS Express 8 beta to run website as 64-bit process
https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/3254745-allow-for-iis-express-64-bit-to-run-from-visual-st