APPIUM iOS 13 & Above: XCUIElementTypeTextField "Value" attribute shows ”OBJ" as supposed to Actual Value - ios13

Issue: For "XCUIElementTypeTextField" element (On iOS 13 & Above), The value is displayed as "OBJ" in the Appium Inspector and programmatically when I tried to Element.GetAttribute("value") I get " ". Please see attached screenshot and Page Source
I tried to get the page source and even the page source does not contain the value for "XCUIElementTypeTextField".
But when I tried on a device with 12.4.1 OS, it works perfectly fine and displays the value in the inspector as well as page source.
I am wondering if anyone is facing the same issue ?
Configuration:
* Appium version (or git revision) that exhibits the issue: 1.17.0
* Desktop OS/version used to run Appium: macOS Catalina, 10.15.4
* Npm or Yarn package manager:
* Mobile platform/version under test: iOS
* Real device or emulator/simulator: Real Device (iPhone X 13.4.1)
* Java Client: 7.3.0
* Xcode: 11.4
* Device OS: 13.4.1
Appium Inspector Screenshot
Page Source Snippet:
</XCUIElementTypeStaticText>
</XCUIElementTypeOther>
<XCUIElementTypeOther type="XCUIElementTypeOther" enabled="true" visible="true" x="16" y="159" width="343" height="75">
**<XCUIElementTypeTextField type="XCUIElementTypeTextField" enabled="true" visible="true" x="16" y="161" width="343" height="53" label="" value="">
</XCUIElementTypeTextField>**
<XCUIElementTypeOther type="XCUIElementTypeOther" enabled="true" visible="true" x="28" y="159" width="50" height="30" name="Username" label="Username">
<XCUIElementTypeStaticText type="XCUIElementTypeStaticText" enabled="true" visible="true" x="28" y="167" width="50" height="14" name="Username" label="Username" value="Username">
</XCUIElementTypeStaticText>
</XCUIElementTypeOther>
</XCUIElementTypeOther>
<XCUIElementTypeOther type="XCUIElementTypeOther" enabled="true" visible="true" x="16" y="232" width="343" height="75">
<XCUIElementTypeSecureTextField type="XCUIElementTypeSecureTextField" enabled="true" visible="true" x="16" y="234" width="343" height="53" label="" value=" ">
</XCUIElementTypeSecureTextField>
<XCUIElementTypeOther type="XCUIElementTypeOther" enabled="true" visible="true" x="28" y="232" width="49" height="30" name="Password" label="Password">
<XCUIElementTypeStaticText type="XCUIElementTypeStaticText" enabled="true" visible="true" x="28" y="240" width="49" height="14" name="Password" label="Password" value="Password">

I experienced a similar issue. iOS 13 adds surplus XCUIElementTypeOther elements which change the path compared to iOS 12.
To solve this for my use case, I added a unique identifier to elements for direct access (quicker lookups), and in the case where a unique identifier wasn't possible (e.g. WebView) I changed the selector to rely on first match.
e.g. under Appium 1.17.0:
//XCUIElementTypeTextField[#name="foo"] for direct lookup to a single item.
//XCUIElementTypeWebView for a find all multi match.
Assuming there is only one WebView on the screen, on iOS 12 that generic lookup yields a single item, where as on iOS 13 it yields 3 (nested within each other). Thankfully capabilities.useFirstMatch resolves it back to one.

Related

How can I force DNN to load a CSS file in the last position?

I try to load a CSS file of skin in the last position of CSS files in the header.
I use the below code.
<dnn:DnnCssInclude runat="server" FilePath="https://cdn.jsdelivr.net/npm/bootstrap#5.0.0-beta1/dist/css/bootstrap.min.css" PathNameAlias="" ForceProvider="DnnPageHeaderProvider" />
<dnn:DnnCssInclude runat="server" FilePath="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" PathNameAlias="" ForceProvider="DnnPageHeaderProvider" />
<dnn:DnnCssInclude runat="server" FilePath="https://cdn.linearicons.com/free/1.0.0/icon-font.min.css" PathNameAlias="" ForceProvider="DnnPageHeaderProvider" />
<dnn:DnnCssInclude runat="server" FilePath="https://fonts.googleapis.com/css?family=Roboto:regular,500|Poppins:300,regular,500&subset=&cdv=120" PathNameAlias="" ForceProvider="DnnPageHeaderProvider" />
<dnn:DnnCssInclude runat="server" FilePath="skin.css" PathNameAlias="SkinPath" ForceProvider="DnnPageHeaderProvider" />
skin.css file loaded pre another CSS files!
How can I do that?
You should be able to set a high number as the Priority - the default is 100.
You can see the properties available on here with the Client Resource Management API
Here's what some of the general value are for Priorities to help you understand.

autocompleteextender on IE is missing a list item

I have two autocomplete extenders on the aspx page.
<div class="wrapper left">
<div class="col214 left label">
Location Name
</div>
<div class="col234 left">
<asp:TextBox ID="txtLocationName" CssClass="col225 tb" runat="server"></asp:TextBox>
<loc:AutoCompleteExtender ServiceMethod = "getLocationDetails" MinimumPrefixLength="4" CompletionInterval="10" EnableCaching="true" CompletionSetCount="10"
TargetControlID="txtLocationName" ID="AutoCompleteLocation" runat="server" FirstRowSelected="false" DelimiterCharacters="," ShowOnlyCurrentWordInCompletionListItem="true" ></loc:AutoCompleteExtender>
</div>
</div>
<br />
<div class="wrapper left">
<div class="col214 left label">
Clinician Surname
</div>
<div class="col234 left">
<asp:TextBox ID="txtClinicianSurname" CssClass="col225 tb" runat="server"></asp:TextBox>
<sur:AutoCompleteExtender ServiceMethod="getClinicianDetails" MinimumPrefixLength="2" CompletionInterval="100" EnableCaching="true" CompletionSetCount="10"
TargetControlID="txtClinicianSurname" ID="AutoCompletSurname" runat="server" FirstRowSelected="false" DelimiterCharacters="," ShowOnlyCurrentWordInCompletionListItem="true" ></sur:AutoCompleteExtender>
</div>
</div>
They are working fine on my localhost when displaying the list items. Once I deployed onto test environment, the list items displayed on the chrome browser are fine, but on the IE, the second list item is missing due to the textbox below it at the position of second list item. The second textbox is appearing in place of the second list item of the first textbox autocompleteextender. In the image attached, list item 'test 2' is missing on IE,however second textbox is appearing in place of it. Could anyone please help.
Thanks in advance.
images of chrome and IE
I have got it resolved by writing the following in web.config.
This is being incompatibility of IE 11 on the deployed version on IIS7
<httpProtocol>
<customHeaders>
<add name="X-UA-Compatible" value="IE=EmulateIE8" />
</customHeaders>
</httpProtocol>
This is working fine on my machine. But once I deployed on to live, it is not working on some machines. When I press F12, the error it's coming up with is 'jquery not defined'. The auto populate text box is working fine, but there are two jquery date calendars on the page which are not working and the user unable to submit the page.
With the above code in config, it is working fine on some machines but not on others(they cannot get the date calendar displayed and cannot submit). If I delete the above code, it's working fine on some machines but not on others (they cannot see the second listed item on auto populate text box)
This is due to caching issue. Delete the temp files and browsing history and it's back up and running with the below code in web.config
<httpProtocol>
<customHeaders>
<add name="X-UA-Compatible" value="IE=EmulateIE8" />
</customHeaders>
</httpProtocol>

RadGrid Rendering differently in Different Machine of 100% Same Application when opening app in Visual Studio 2013

I have a .NET 4.0 application which uses RadGrid in a web-page. When I open my page on 1st machine, I got the following HTML,
<div id="ctl00_mainContentPlaceHolder_ctl00_mainContentPlaceHolder_radMainPanel">
<div id="ctl00_mainContentPlaceHolder_radMain" class="RadGrid RadGrid_Metro">
<img width="64px" style='max-height: 100px; max-width: 100px;' src="/Data/Images/2013_09_16_17_18_37_1837_30f9.jpg" />
</td><td>
and when I open the same page on second machine I got,
<div id="ctl00_mainContentPlaceHolder_ctl00_mainContentPlaceHolder_radMainPanel">
<div id="ctl00_mainContentPlaceHolder_radMain" class="RadGrid RadGrid_Metro">
<table class="rgMasterTable" id="ctl00_mainContentPlaceHolder_radMain_ctl00" style="width:100%;table-layout:auto;empty-cells:show;">
<colgroup>
<col style="width:35px" />
<col />
<col />
<col />
<col />
<col />
<col />
...............................................................
The second one is correct but why my first machine does not show any table element which is the root cause.
UPDATE: After a lot of search, I was able to find the answer at here.
<add key="vs:EnableBrowserLink" value="false" />
UPDATE: After a lot of search, I was able to find the answer at here.
<add key="vs:EnableBrowserLink" value="false" />
Yes, problem is in Browser link that VS 2013 enable it by default.
This is connection between VS2013 and browsers that have opened solution. When debugging, VS2013 opens port and inserts js script that communicate with VS2013. Currently this feature is not so usefull. You can only refresh all browsers that opened your solution. In some cases this feature distorts HTML, so is in this case.
So how to disable it?
There are 3 ways:
http://www.asp.net/visual-studio/overview/2013/using-browser-link
In the Browser Link dropdown menu, uncheck Enable Browser Link.
In the Web.config file, add a key named “vs:EnableBrowserLink” with the value “false” in the appSettings section.
In the Web.config file, set debug to false.

HTMLEditorExtender does not correctly load on Server.Transfer

I'm writing a web application that utilizes HTMLEditorExtender. I invoke it using the following code:
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnablePageMethods="true" />
<asp:TextBox ID="htmlTextBox" runat="server" TextMode="Multiline" Width="90%" Rows="25" />
<asp:HtmlEditorExtender ID="htmlEditorExtender" TargetControlID="htmlTextBox" runat = "server" EnableSanitization="false" >
<Toolbar>
<asp:Undo />
<asp:Redo />
<asp:Bold />
<asp:Italic />
<asp:Underline />
<asp:ForeColorSelector />
<asp:FontNameSelector />
<asp:FontSizeSelector />
<asp:JustifyLeft />
<asp:JustifyCenter />
<asp:JustifyRight />
<asp:JustifyFull />
<asp:InsertOrderedList />
<asp:InsertUnorderedList />
<asp:CreateLink />
<asp:UnLink />
</Toolbar>
</asp:HtmlEditorExtender>
NOTE: I know it's bad to set EnableSanitization="false", but this application will only be used privately.
With that code, when the page loads, the text box looks like this:
That looks good!
But, in my application, I navigate to another page and then need to navigate back to this page using Server.Transfer(page_URL). When I do that, the HTMLEditorExtender no longer loads correctly and I get something that looks like this:
How can I get it to load correctly on Server.Transfer()? I'm thinking that it may be a simply flag I need to invoke on the creation of the HTMLEditorExtender element, but I've tried a few and can't get anything to work.
EDIT: I should add that I am using IE 8 and it must work in IE 8.
I changed stopped using Server.Transfer() and decided to set the PostBackUrl in the ASP. For some reason, this worked.

Changing ControlRenderingCompatibilityVersion to version 4.0 loses the src attribute on an ImageButton

I'm upgrading an application and have changed the compatibility mode to version 4. After doing this, the following code no longer generates the src attribute in the html of an image button.
<asp:ImageButton id="LogOnButton" runat="server"
ImageUrl="~/Images/login.png" OnClick='LogOnButton_Click' AlternateText="Login">
</asp:ImageButton>
<input type="image" name="LogOnButton" id="LogOnButton" alt="Login" />
If I change the mode to 3.5 it renders thus:
<input type="image" name="LogOnButton" id="LogOnButton"
src="Images/login.png" alt="Login" border="0" />
Has anyone experienced this, or know how to fix it?
Try removing this line from web.config:
<xhtmlConformance mode="Legacy"/>
Or change the mode to Strict or Transitional.

Resources