UINavigationBar overlaps with status bar after presented VC with prefersStatusBarHidden as true - uiviewcontroller

Presenting a VC(1) on Root VC(0) with prefersStatusBarHidden as true.
After that dismissing the presented vc(1) and pushing another vc on root vc(2) with prefersStatusBarHidden as false. UINavigationBar going under status bar as below:
This issue is persisting When I go back to root view controller as well. All the view controllers in the navigation stack are facing the issue.
I got this while migrating from Xcode 12 to Xcode 13.

Related

How to close browser popup in robot framework?

After login in Chrome browser, I am getting a save password popup from the browser. I want to handle that popup and want to close that using Robot Framework
Browse popup window
Thanks
This question has been asked and answered before with a pure Python context. This answer continues on this SO post for a working Robot Example.
The popup you see is generated by Chrome itself. It's not an HTML alert. For this reason none of the Selenium2Library keywords will have any effect on it. Nor wil settings cookies or javascript.
These settings can be manually set using the chrome://settings link. Go to advanced settings and then scroll down to Passwords and Forms. Untick the second item and this will prevent the popup.
To do the same automatically in Robot Framework the WebDriver needs to be started with additional preferences:
Chrome With Preferences
${chrome_options} = Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
${prefs} Create Dictionary credentials_enable_service=${false}
Call Method ${chrome_options} add_experimental_option prefs ${prefs}
Call Method ${chrome_options} add_argument --disable-infobars
Create WebDriver Chrome chrome_options=${chrome_options}
Go To https://secure.url.com
This key things here are credentials_enable_service=${false} where it is important to use ${false} and not false, as the latter is interpreted as a string and then added to Chrome as "false" instead of the correct value false.
The second item is that preferences are not added as arguments but through assigning a dictionary to the prefs property of the ChromeOptions() object like so: add_experimental_option prefs ${prefs}
I do not think this is real to be honest (as it's property of the browser.) Are you having issues with that? The only thing you can dismiss is javascript alert and probably the best way to handle this is:
${alert} = Get Alert Message dismiss=${dismiss}
I have this in my test teardown with Run Keyword and Ignore Error, it makes me able to fetch optional js alert content and debug (also dismisses it do the rest of the suite can be executed.)
Three Ways To do do it.
1) Many a times, Once pop-up appear on screen and Disappear a cookie is set which you can view in developer console-> application. If you set this cookie with value using Add Cookie keyword. Pop- up wont appear.
2) if first doesn't work, then open developer tools and monitor the local store from developer tools -> application and close the pop-up. U will notice some variable with a value is stored in local storage. You can set that value using your script and u wont see the pop-up while executing variable.
3) If first and second doesn't work, the pop-up is most likely linked to a javascript variable. set java script variable using Execute Javascript Keyword and your problem must be solved.
Talk with your dev team, to see which way will work for you.

Another user than me is displayed with pop up error message: "An error has occured." "Error: Invalid control reference

When I click on: "Macro detail" on that same pop up window
another pop up window displays and says...
Action Failed
Macro Name:
Home : Home
Condition:
True: [GlobalUserId] Is Null
Action Name:
null
Arguments:
null
Error Number:
2055
Namely when I come to the Home tab in my Access Web App I suppose to se myself as an user, however another user information is visible from the system and I get those pop up error messages mentioned. Note this issue is on Prod environment, in Test this issue does not exist and I havent find any difference in code or structure etc. Even when I backup the app from prod to test, the same app in test still works without this issue. If I refresh the "Home" page in prod the issue is fixed and I can see my user instead (as it should) but this is not the behaviour we want in production. Please any help is highly appreciated and rewarded.
Environment: Access 2013 Web App and SharePoint 2013 On-Prem
Thanks
Your description is not very precise but it seems it could be that your GlobalUserId became null, maybe caused by an ended session, when the user doesn't use the app for a while. You could add guard clauses at the beggining of youtr UI macro to test if the GlobalUserId variable is null. If so, you could display a message to invite the user to refresh the app and stop the macro, preventing errors.

Viewing console output from TVJS

I'm working with the tvOS beta 3 and trying to do some basic debugging on the tvml/tvjs side of things.
Messages logged via console.log(...) in my js files don't appear in the main Xcode output window.
Is there somewhere else I can find these messages or a setting which needs to be configured?
You should actually use the debug console in Safari. (The developer forum suggests you use Safari 9 and upgrade to El Capitan, both of which I have so haven't been able to test with inferior version)
Open Safari > Develop menu > Simulator
Your app name should appear here once and from there you can use the console.
Give it a few seconds to appear, it's not always instantaneous.
You must give a name to the Bundle Identifier in General/Identity (com.yourcompany.appname) to appear the app in the developers tool.
If you are developing a hybrid application (TVML/TVJS + Swift) with TVMLKitchen you can implement a logging function in Swift and use it in the TVJS code. For my projects I use the following code:
Kitchen.appController.evaluateInJavaScriptContext({context in
let printInJS : #convention(block) (NSString!) -> Void = {
(string : NSString!) -> Void in
print("Log: \(string)\n")
}
context.setObject(unsafeBitCast(printInJS, AnyObject.self), forKeyedSubscript: "printInJS")
})

View all XCUIElements in current screen

In UI/Automation Testing using Xcode 7, is there a way to list all of the XCUIElements on an app screen? Like in a tree or list, or even something in the Xcode UI? I can record tests for the app under test using clicks, but when I go to run the test, it fails. It fails because it can't find the XCUIElements from the generated code.
You can view it in Xcode hierarchy debugger.
From Apple Docs:
To enter the view debugger, run your app in Xcode and click the Debug View Hierarchy button in the debug bar.
You can debug the state of UI element using,
XCUIElement.debugDescription
It returns a snapshot of UIView in html format with a nice look up into the UI elements state with properties like element type(e.g textField, button), traits like focussed, enabled and values e.g placeholderValue.
You can also use accessibilityInspector app to look into accessibility attributes for the UI Elements on the view and verify that elements have accessibility properties set correctly.
Another handy tool to investigate the view is new hierarchy viewer which can be invoked during recording from debug console toolbar or Debug Navigator filter when you enable breakpoint in your test code.
Xcode 7 also has a nice test reporting under Report Navigator which can help you drill down exact reason with the test failure. e.g
UI Test Activity:
Assertion Failure: Asynchronous wait failed: Exceeded timeout of 10 seconds, with unfulfilled expectations: "Expect predicate `exists == 1` for object "Logout" Button".
Hope this helps.

Html.RenderPartial causing a loop

I have problem using html.RenderPartial.
For example: lets take the Account model, I took the LogOn view and copied it to a partial view and added it to the master page. When I run the app and the partial view of LogOn is open, using an ActionLink to another View from the same Model for example the Register view causing a loop and the web sticks.
The combination of these 2 commands cause a loop:
{ <%Html.RenderPartial("LogOn"); %>
<%Html.ActionLink("Register", "Register", "Account");%>}
Does anyone know how can I solve it?