Hey Shanmuga Sugash,
Was this the first time you ran those tests on ATS2.5? We have fixed an item in ATS2.5 that you now need to add a return statement everytime you use a JavaScript action, with this action you would need to return a String. ATS2.4 did not check for this, but for JavaScript code it is better to do check for this. So at the end of your code you would need something like: return "";
Could you please tell me if this helps? If not we can look further at what the problem migth be.
Kind regards,
Myrthe
We Use Return statement for actions which needed.For this Issue we used return statement for "Find/Assert Widget" action i added the screenshot for 9th and 10th step.i think it will help you to figure out.
I can see the Scroll down operation which is working as excepted in Browserstack and in ATS its fails and throws Error
Hey Myrthe Walhout,We again tried this action "Scroll down to element" and observed the same issue exists. No problem with scrolldown operation but it throws an error in ATS results log file . Please let me know other way to work around this and also we got an custom action scroll down xml file,let me know how to use the xml file in existing action. please guide us on this
Error Log: Testing purpose: at 10: [Scroll down to element]: with Widget: [org.openqa.selenium.remote.RemoteWebElement@37 -> unknown locator] Scroll down to element: at 2: Fast scroll: with Script: TEXT: function getScrollParent(element, includeHidden) { var style = getComputedStyle(element); var excludeStaticParent = style.position === "absolute"; var overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/; if (style.position === "fixed") return document.body; for (var parent = element; (parent = parent.parentElement);) { style = getComputedStyle(parent); if (excludeStaticParent && style.position === "static") { continue; } if (overflowRegex.test(style.overflow + style.overflowY + style.overflowX)) return parent; } return document.body; } X = getScrollParent(arguments[0]); X1 = X.scrollHeight; X2 = $(X); X3 = X2.animate({ scrollTop: $(arguments[0]).offset().top }, 20); with Argument0: ANY: [org.openqa.selenium.remote.RemoteWebElement@37 -> unknown locator] Execute Javascript String Caused by: com.mansystems.ATS.Runner.exceptions.RunnerException: at com.mansystems.ATS.Runner.definitions.functions.FunctionImpl.run(FunctionImpl.java:62) at com.mansystems.ATS.Runner.definitions.functions.FunctionImpl$1.run(FunctionImpl.java:36) at com.mansystems.ATS.Runner.execution.ExecutionContextRoutine.execute(ExecutionContextRoutine.java:172) at com.mansystems.ATS.Runner.execution.ExecutionContextTestStep.execute(ExecutionContextTestStep.java:140) at com.mansystems.ATS.Runner.execution.ExecutionContextActionComposition.run(ExecutionContextActionComposition.java:41) at com.mansystems.ATS.Runner.execution.ExecutionContextRoutine.execute(ExecutionContextRoutine.java:172) at com.mansystems.ATS.Runner.execution.ExecutionContextTestStep.execute(ExecutionContextTestStep.java:140) at com.mansystems.ATS.Runner.execution.ExecutionContextTestCase.executeTestSteps(ExecutionContextTestCase.java:153) at com.mansystems.ATS.Runner.execution.ExecutionContextTestCase.run(ExecutionContextTestCase.java:121) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at com.mansystems.ATS.Runner.execution.ExtendedFuture.run(ExtendedFuture.java:69) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor200.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.mansystems.ATS.Runner.definitions.functions.FunctionReflectionHelper.invokeRunInternalMethod(FunctionReflectionHelper.java:29) at com.mansystems.ATS.Runner.definitions.functions.FunctionImpl.run(FunctionImpl.java:59) ... 14 more Caused by: java.lang.NullPointerException
Hey Suresh,
The xml file that I send to you should be imported into your ATS project you can do that as follows:
1. Open your project in ATS
2. Go to the menu item Test Cases and to the tab Repository
3. Click on the Actions dropdown and then on Import
4. Click import from file and select the xml file that I have send you.
5. Click Upload and then Import
Then you should use that custom action in your test cases instead of the old 'scroll down to element' custom action.
Please run your test case with the new 'Scroll down to element' test case. Does your test case work now?
Kind regards,
Myrthe Walhout
We have navigated as per your steps but the file "Scroll down to element(v2).xml" was not uploaded instead received an error message as " Keyword update denied".
I am sorry, I forgot to delete something. Could you try it again?
Thanks Mytrthe and now the scroll down action is working fine without any error in logs
That is great to hear! :)