I am trying to accept an alert using python-selenium in Chrome v62 to v66.
I have checked the compatibilies of the driver and selenium, there seems to be no issues in them. The exception occurs in local as well as in browserstack.
Code:
WebDriverWait(driver, 5).until(EC.alert_is_present)
Alert(driver).accpet()
currentURL= driver.current_url
Error:
raise exception_class(message, screen, stacktrace)
UnexpectedAlertPresentException: Alert Text: None
Message: unexpected alert open: {Alert text : }
(Session info: chrome=66.0.3359.170)
(Driver info: chromedriver=2.37.544337 (8c0344a12e552148c185f7d5117db1f28d6c9e85),platform=Mac OS X 10.12.6 x86_64)
I have tried waiting for the alert and then switch and accept it also. The alert is present but EC.alert_is_present returns false.
The same code works as expected in Chrome v61 and below.
in my app, there has a page need to show in landscape,others show in portrait,i use ScreenOrientation plugin
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE);
has no effect when i run on phone and throw some exception
"Error: Uncaught (in promise): NotSupportedError: screen.orientation.lock() is not available on this device.
how can i do? thank you very much for helping me.
Try this.
this.platform.ready().then(() => {
this.screenOrientation.unlock();
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE);
});
I am trying to write a hybrid app for Android using VS 2013 update 3 and the multi-device hybrid app extension (Cordova v3.5.0). Everything is working well except the Media Capture plugin. I am calling navigator.device.capture.captureImage(MediaCaptureSuccess, MediaCaptureError, { limit: 3 }) which opens up the camera app. I can take a picture but when I click Ok on the device, my error callback is executed with CaptureError.CAPTURE_INTERNAL_ERR with no other information. I have tried switching to org.apache.cordova.media-capture#0.3.4 (currently using 0.3.1) but when I try to compile, I get a plugman error when it tries to retrieve it. I have searched the debug output for clues and the only thing that I found was the following line "Unknown permission android.permission.RECORD_VIDEO in package..." but that seems to be a valid user permission. When I look at capture.java generated by the build, I can see that this error is returned if there is an IOException occurs.
Does anyone have any suggestions on how to fix this or what to check next?
Try this plugin
Config:
<vs:feature>org.apache.cordova.camera#0.3.0</vs:feature>
JS:
navigator.camera.getPicture(onSuccess, onFail, {
quality: 30,
destinationType: Camera.DestinationType.FILE_URI,
saveToPhotoAlbum: true
});
I try to migrate an existing Ember.js project to use Ember App Kit and I'm seeing some strange error which I think should not happen here...
If I start the app, everything is initialized, my util classes are up and running and Ajax requests are sent and received - everything seems well. But then I keep getting the same error over and over again:
Uncaught TypeError: Cannot read property 'name' of undefined
If I follow down the StackTrace I came to see that the error occurs in the updatePaths() function of the Router (I commented on the lines where the code starts to fail:
function updatePaths(router) {
var appController = router.container.lookup('controller:application');
if (!appController) {
// appController might not exist when top-level loading/error
// substates have been entered since ApplicationRoute hasn't
// actually been entered at that point.
return;
}
var infos = router.router.currentHandlerInfos, // <-- empty Array ([])
path = Ember.Router._routePath(infos); // <-- empty String ("")
if (!('currentPath' in appController)) {
defineProperty(appController, 'currentPath');
}
set(appController, 'currentPath', path);
if (!('currentRouteName' in appController)) {
defineProperty(appController, 'currentRouteName');
}
set(appController, 'currentRouteName', infos[infos.length - 1].name); // throws Uncaught TypeError: Cannot read property 'name' of undefined
}
Here is the StackTrace:
Uncaught TypeError: Cannot read property 'name' of undefined ember.js:35015
updatePaths ember.js:35015
Ember.Router.Ember.Object.extend.intermediateTransitionTo ember.js:34522
(anonymous function) ember.js:34919
forEachRouteAbove ember.js:34869
defaultActionHandlers.loading ember.js:34915
triggerEvent ember.js:34983
trigger ember.js:34116
Transition.trigger ember.js:33952
Ember.Router.Ember.Object.extend._fireLoadingEvent ember.js:34750
DeferredActionQueues.flush ember.js:5893
Backburner.end ember.js:5984
Backburner.run ember.js:6023
Ember.run ember.js:6426
runInitialize ember.js:39637
jQuery.Callbacks.fire jquery.js:3063
jQuery.Callbacks.self.fireWith jquery.js:3175
jQuery.extend.ready jquery.js:3381
completed jquery.js:3397
Also, it seems that the appController is not my instance of the ApplicationController but a generated controller from ember itself and I can't see why (my ApplicationController is defined in app/controllers/application.js...
Does anybody know anything about this behaviour or could show me the right direction to track down this error somehow?
So, I digged deeper into this error and also found an issue over at the GitHub project which is describing what I thought was exactly my problem too.
It turns out that somehow Ember App Kit (or even Ember itself) is swallowing messages/errors thrown by Ember.assert and the like so that I followed the suggestion of Stefan Penner and switched to pause on caught exceptions within my browsers dev tools and I saw that it's not one, but several errors!
Unfortunately all these errors fail silently until the last error cannot be caught anymore which is why every error showed the same Stack Trace...
So, the solution seems to be to be sure to pause on caught exceptions and trace down the error message in Ember.assert()... has anybody else seen the same problem and has some other suggestions or could approve my conclusion?
Screenshot of "pause on caught exceptions" in Chrome Dev Tools:
I recently switched from using the BlackBerry Facebook SDK jar to using the project's source code (checked out from the tag that the jar was built from).
Ever since this switch, I've experienced BrowserField problems:
On a device, the loading graphics persists until I back out.
On a simulator I see:
Error requesting content for
https://www.facebook.com/dialog/oauth?scope=user_about_me,user_activities,user_birthday,user_education_history,user_events,user_groups,user_hometown,user_interests,user_likes,user_location,user_notes,user_online_presence,user_photo_video_tags,user_photos,user_relationships,user_relationship_details,user_religion_politics,user_status,user_videos,user_website,user_work_history,email,read_friendlists,read_insights,read_mailbox,read_requests,read_stream,xmpp_login,ads_management,user_checkins,friends_about_me,friends_activities,friends_birthday,friends_education_history,friends_events,friends_groups,friends_hometown,friends_interests,friends_likes,friends_location,friends_notes,friends_online_presence,friends_photo_video_tags,friends_photos,friends_relationships,friends_relationship_details,friends_religion_politics,friends_status,friends_videos,friends_website,friends_work_history,manage_friendlists,friends_checkins,publish_stream,create_event,rsvp_event,offline_access,publish_checkins,manage_pages&redirect_uri=http://www.facebook.com/connect/login_success.html&display=wap&client_id=[APPLICATION_ID]&response_type=token
Error message null.
where APPLICATION_ID is my correct application ID.
The above URL opens fine in my PC browser, and I have debugged for a while through the Facebook sdk's source and found nothing.
It is possible that the application id might have changed recently without me knowing, and my next step is to revert back to using the .jar just for testing purposes.
Has anyone seen similar behavior with the BlackBerry SDK before?
I'm not sure if this is what happened in your case, but I've seen that error when the ProtocolController is set before the BrowserField is initialized. Like so:
private BrowserField bf;
...
BrowserFieldConfig bfc = new BrowserFieldConfig();
// bf not initialized yet but no compiler error
bfc.setProperty(BrowserFieldConfig.CONTROLLER, new ProtocolController(bf){
public void handleNavigationRequest(BrowserFieldRequest request) throws Exception {
super.handleNavigationRequest(request);
}
public InputConnection handleResourceRequest(BrowserFieldRequest request) throws Exception {
return super.handleResourceRequest(request);
}
});
bf = new BrowserField(bfc);
add(bf);
bf.requestContent("http://www.google.com");
...
Simply setting the ProtocolController after the BrowserField is initialized but before content is requested solves it.