Vue2 js and IE document mode (IE 11) - vue.js

I have a Vue2 application which runs perfectly in chrome. However, when I launch the site in IE 11, it gives a blank page. On further investigation, I observed the following -
1. From developer tool Emulator tab, If I change the document type to Edge or 10, my solution works perfectly fine., and there is no error in console
2. If I change the document type back to 7 (default), the page becomes blank and it gives three errors in console - "SCRIPT1028 - Expected identifier, string or number"
For the script error mentioned in point 2, I have checked my code and removed any unwanted commas, if applicable, but that did not help much.
I am using axios in my code.
Note: I get these errors only from deployed code (in dev, SIT, or UAT box). When I run it locally, IE does not give any error because when I run it locally, the default document type is Edge. It is only when I run from server, the default document type takes 7.
I believe if I take care of the script errors I get, it should resolve my problem. However, I am not too sure how to solve the script error.
I am pretty new to Vue. Any help would be highly appreciated.
Thanks in advance!

Related

Appium/WinAppDriver Can't Find Context Menu - But Only On Certain Machines

I'm running a set of automated UI tests using Appium/Winappdriver on Windows 10. The test framework is compiled in Visual Studio 2017 using mstest.
The problem that I am having is with tests that use a right-click to open a context menu, then select an element from the resulting menu. Locally, it works. It also works on our remote CI/CD machine. However, it does not work for the other two developers on the project, and we've spent two business days fruitlessly trying to figure out why.
We have the same Windows version (Windows 10, version 1903), we have the same Visual Studio 2017 (we also tried it with 2019, no luck), we have the same monitor resolution (1920 x 1080), we are targeting the same .NET framework (4.72), we have the same WinAppDriver, etc.
Everything else works just fine. But when the UI Test reaches that context menu, the test fails with the error "An element could not be located on the page using the given search parameters."
I used the WinAppDriver UI Recorder to find the XPath for the element. We also used it on the other user's machine and confirmed that, as far as the UI Recorder is concerned, the path is identical on both machines.
The specific call that fails:
Session.FindElementByXPath("/Pane[#ClassName=\"#32769\"][#Name=\"Desktop 1\"]/Menu[#ClassName=\"#32768\"][#Name=\"Context\"]/MenuItem[#Name=\"" + itemName + "\"]");
The WinAppDriver call on my machine (success):
{"using":"xpath","value":"/Pane[#ClassName=\"#32769\"][#Name=\"Desktop 1\"]/Menu[#ClassName=\"#32768\"][#Name=\"Context\"]/MenuItem[#Name=\"New Location\"]"}
HTTP/1.1 200 OK
Content-Length: 125
Content-Type: application/json
{"sessionId":"8970FDC1-E869-4304-A87D-D8F2CB711EA2","status":0,"value":{"ELEMENT":"42.856234.4.-2147483646.8140.18614751.1"}}
and the same call on the other user's machine (fail):
{"using":"xpath","value":"/Pane[#ClassName=\"#32769\"][#Name=\"Desktop 1\"]/Menu[#ClassName=\"#32768\"][#Name=\"Context\"]/MenuItem[#Name=\"New Location\"]"}
HTTP/1.1 404 Not Found
Content-Length: 139
Content-Type: application/json
{"status":7,"value":{"error":"no such element","message":"An element could not be located on the page using the given search parameters."}}
Again, everything else works. Other UI tests that don't use the right-click context menus work just fine. It's only this particular area that fails.
What I've tried so far:
Using Thread.Sleep to force a long wait before making the call
Wrapping the call with a DefaultWait and polling it over a period of several seconds to see if the element becomes available during that time.
When the "An element could not be located" is thrown, retry up to a set number of times to find the element.
Lots and lots of double-checking to make sure we're both on the same version of the code, same libraries, same nuget packages, etc.
Trying a much broader locator ( Session.FindElementByName(itemName); )
The biggest head-scratcher is that when we check with UI Recorder, the element is there. When we check on my machine or the remote build machine, WinAppDriver can find it normally. But for some reason WinAppDriver can't find it on my coworker's machines.
This is a peculiar issue indeed.
I'd like to rule out the XPath selector as a potential problem here. Based on your syntax, it looks like you are using an absolute XPath. These can be extremely brittle depending on the circumstances. Not saying it's the root problem, but I would like to try a different selector to rule this out.
{"using":"xpath","value":"//MenuItem[#Name=\"New Location\"]"}
Using relative // notation tells your path to look anywhere on the page, rather than following a specific path down to the element itself.
Give this a try, and let me know if it helps at all.
For my application context menu is listed out of the DOM of actual application in inspect.exe. So switching back to desktop session after selecting the context menu worked fine for me.
var regressionChannelRow = labelProcessorSession.FindElementByName("5000");
Actions action1 = new Actions(labelProcessorSession);
regressionChannelRow.Click();
action1.ContextClick(regressionChannelRow).Perform();
Now creating a desktop session to get the "Stop" option from the context menu
AppiumOptions appCapabilities = new AppiumOptions();
appCapabilities.AddAdditionalCapability("app", "Root");
WindowsDriver<WindowsElement> desktopSession;
desktopSession = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"), appCapabilities);
below is the context menu option which I need to select, remember to use desktop session here
var stopService = desktopSession.FindElementByName("Stop");
stopService.Click();
I've just replicated this issue. I was working on a test that I wrote last week, which was now getting stuck trying to find the context menu from a desktop session. I tried using various XPaths, searching by class name or just name, but it didn't seem to make any difference.
Eventually I tried closing Spotify, and that solved the issue! If you're experiencing this problem then try closing every application window possible.

How to fix types.ArgumentError: argument 1: <class 'TypeError'>: expected LP_POINT instance instead of pointer to POINT?

I'm using selenium, pyautogui, pywinauto to automate the desktop app. I'm automating settings app. And based on the user's input value I'm trying to change the value of the current brightness of the computer. but it keeps on showing this error.
The most important part is I wasn't getting the error 3 weeks ago and everything was working fine but yesterday when I run the script it started throwing the error.
The complete error I'm getting is-
ctypes.windll.user32.GetCursorPos(ctypes.byref(cursor))
ctypes.ArgumentError: argument 1: : expected LP_POINT instance instead of pointer to POINT
Some part of the script where the process get stuck and starts throwing the error. the script stop running at the 3rd line...
slider = content_of_page.find_element_by_id("SystemSettings_Display_Brightness_Slider")
slider.click()
pyautogui.dragRel(args.value, 0, duration=1.0, button='left')
pyautogui.click()
I'm using pyautogui=0.9.47
I also had the same issue and reinstall did not help. I found solution in: https://github.com/asweigart/pyautogui/issues/353
After installing pywinauto==0.6.6 all work ok for me.
I had the exact problem just right now.
I fixed it by un- and reinstalling pyautogui and pywinauto.
The problem persisted after reinstalling pyautogui, but was fixed after reinstalling pywinauto. So I am not sure if you need to reinstall both or just pywinauto.
Hope that helps!
Andreas

Using MXUnit or is there another way to display coldfusion output using Intellij IDEA 15

I'm loving IntelliJ because I also work with MySQL and the integration into one UI is great. Seems that IntelliJ works nicely with ColdFusion as well. I'm just hoping to successfully use MXUnit, but I seem to be getting an error upon testing. My main goal is just being able to display the output directly in IntelliJ instead of outputting in a browser.
My test site path: /Applications/ColdFusion11/cfusion/wwwroot/Test/test.cfc
Error http://localhost/mxunit-launcher.cfc?method=executeTestCase&componentName=test
Seems like I have to add in a mapping, maybe in CF Admin, because the path and web path don't match but I haven't done that before if that's the case. Here's a screenshot of input in IntelliJ, and the output at the bottom of the screenshot when running the debugger:
Thanks for any feedback on what I might be missing.

Javascript split working incorrectly in IE

I have one page checkout. My OPC works fine with other browsers but I get a fatal error with IE. IE's Javascript console says Object doesn't support this property or method.. The method in question is var items = field_name.split(reg) from the file: order-address.tpl.
I have no idea what is causing the problem. Because of this error, I cannot login properly from one page checkout when using IE. It seems that there are a lot of people with the same problem. What's the issue?
This error is present in 1.4.9, 1.4.10, and 1.5.3.
SOLVED. It turns out the issue is not with coding but with settings of IE.
All I had to do was reset IE from Tools => internet options => advanced => reset (including personal settings)
That did it for me. Thank you altafhussain for trying to help me out.

ReportViewer cannot shown in Firefox8 and Chrome15

I have an asp.net mvc3 project, it has some reports in aspx web pages. Everything works great in 2-3 weeks ago, but now, when I open the reports pages in FireFox8 and Chrome 15, the reports can not be displayed correctly.
In FF8, report content can be shown, but looks like css doesn't loaded, and report head control look like this:
In Chrome15, report head looks fine but content isn't shown up. I can see it has correct contents when using Firebug to view those .
Since data can ben loaded to browser, I think it maybe a browser compatibility problem, am I right?
Does anyone seeing same issues? I'm open to any suggestions.
BTW:My report viewer's version is 10.0.0.0.
Thanks.
[Edit in 12/21/2011]
FireFox
After several research on this, I have noticed when browse in firefox, server will catch an [Microsoft.Reporting.WebForms.HttpHandlerInputException: Missing URL parameter: Name], and the query string is OpType=BackImage&Version=10.0.40219.329&Color=%23ECE9D8&Name=Microsoft.Reporting.WebForms.Icons.toolbar_bk.png; path_info is Reserved.ReportViewerWebControl.axd
This may be the reason why firefox can't show page with correct CSS.
I don't know why this happens in Firefox & Chrome, while in IE everything is fine.
I've found this link shows same excpetion: http://social.msdn.microsoft.com/Forums/eu/vsreportcontrols/thread/80ce3ee8-e65b-476c-b668-ecc8e83ea73d
But I'm not sure how did he solve this, can you or somebody else gives some tip or example code to solve this?
Chrome
When browse in chrome, I found the report data is loaded into DOM, and surronded by a with id="ReportViewer1_fixedTable". Inside that element, there's a div with id="ReportViewer1_ctl09" nested in , if I remove the "height: 100%", the report can be seen.
this link http://www.apptools.com/examples/tableheight.php, explained why this 100% cannot be rendered correctly, but I'm still failed when trying to give a fixed height via CSS, the code can't be pasted here, please see this as a reference.
Thanks.
In Chrome, it's the "height=100%" problem.
Once I add following jQuery code, the report area can ben shown.
$(function () {
$("#ReportViewer1_ctl09").css("height", "auto");
});
In FireFox, the report page raise an error as following:
"Microsoft.Reporting.WebForms.HttpHandlerInputException 缺少 URL 参数: Name"
and the Query String is: "OpType=BackImage&Version=10.0.40219.329&Color=%23ECE9D8&Name=Microsoft.Reporting.WebForms.Icons.toolbar_bk.png"
according to this article, I think it's caused by a proxy that handles http request..
I checked my request, there's a "FiftyOne ..." in "Brwoser" property of "Request" ojbect.
Since fifty one is no longer used in this project, I removed it from Bin and web config, then the report can be shown in FireFox!
Hope this article can be usefule to other guys.