Katalon : Unable to click on object after use switchTo and waitForElementClickable - selenium-webdriver

I have problem with find element in my script. I use switchToframe and waitForElementClickable and a still have error
Unable to click on object 'Object Repository/1_2.Wniosek_o_OsFiz_v2/Page_Do wysyki i robocze - seap-testskgpl/label_Zaznacz lini' (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to click on object 'Object Repository/1_2.Wniosek_o_OsFiz_v2/Page_Do wysyki i robocze - seap-testskgpl/label_Zaznacz lini'
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.click(ClickKeyword.groovy:76)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:43)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:72)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:616)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$1.call(Unknown Source)
at 1_2.Wniosek_o_OsFiz_v2.run(1_2.Wniosek_o_OsFiz_v2:85)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1586510087999.run(TempTestCase1586510087999.groovy:23)
This is details for my element:
And this is my code (I still work in iframe, page reload. Element is in this same iframe):
WebUI.waitForElementClickable(findTestObject('Object Repository/1_2.Wniosek_o_OsFiz_v2/Page_Do wysyki i robocze - seap-testskgpl/label_Zaznacz lini'),
10)
WebUI.click(findTestObject('Object Repository/1_2.Wniosek_o_OsFiz_v2/Page_Do wysyki i robocze - seap-testskgpl/label_Zaznacz lini'))
Somebody can help me ?

The XPath for the link you are trying to get is generated by web-recorder. Those selectors tend to be flaky because they are dynamic (so, they won't be the same every time you run the tests). I suggest you learn how to get the XPath yourself using Google DevTools or similar.
In this particular case, change the value of Selected Locator from //div[#id='document0']/div[3]/label to //a[#title='Documenty do wysylki'].

Related

Android Manifest merger error in Codename One

In a bare bones project, I added these build hints:
android.gradleDep=compile 'com.erikagtierrez.multiple_media_picker:multiple-media-picker:1.0.5'
android.min_sdk_version=23
I would like to import the following Android library to make a CN1Lib (that requires at least Android SDK 23):
https://github.com/erikagtierrez/multiple-media-picker
To be short: I spent one day trying to import that, I also experimented with Android Studio and with suggestions found on Stack Overflow (trying to make a custom .aar), without success.
Could you help me to import that library? There is manifest merger error.
In fact, the issue reported by the build server is:
* What went wrong:
Execution failed for task ':processReleaseManifest'.
> Manifest merger failed : Attribute application#label value=(BareBones) from AndroidManifest.xml:15:17-42
is also present at [com.erikagtierrez.multiple_media_picker:multiple-media-picker:1.0.5] AndroidManifest.xml:23:9-41 value=(#string/app_name).
Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:15:3-43:103 to override.
I also tried to add the build hint:
android.xapplication_attr=tools:replace="android:label"
as suggested by the previous error, without success.
In the last case, I get:
Merging result: ERROR
/tmp/build1659178556337293135xxx/Test/src/main/AndroidManifest.xml:15:3-43:103 Error:
tools:replace specified at line:15 for attribute android:label, but no new value specified
/tmp/build1659178556337293135xxx/Test/src/main/AndroidManifest.xml Error:
Validation failed, exiting
-- Merging decision tree log ---
The last full log is here: https://gist.github.com/jsfan3/dd6c23f86a2ac949f996910c8cece62b
Thank you
This is happening because our code things you injected android:label on your own and doesn't inject it to avoid collision...
Change the code to this:
android.xapplication_attr=tools:replace="android:label" android:label="App Name"

Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: Cannot read property 'defaultView' of undefined [duplicate]

I am trying to use Selenium for Python eith the Chrome webdriver to automate the download of a file.
My program works perfectly up to the last step (clicking on the 'download' button) at which point a dialog box is triggered with the text:
"An error has occured in 'site url': Uncaught TypeError: Cannot read property 'getColomnSet' of undefined41"
What does this error mean and what are the most probable causes?
For reference, here are the last few commands of my program:
try:
elem = wait.until(EC.presence_of_element_located((By.ID,'element_1_id')))
finally:
elem1 = driver.find_element_by_id('element_1_id')
elem2 = driver.find_element_by_id('element_2_id')
action = ActionChains(driver).move_to_element(elem1).move_to_element(elem2)
action.perform()
elem2.click()
This error message...
An error has occured in 'site url': Uncaught TypeError: Cannot read property 'getColomnSet' of undefined
...implies that your program was unable to read the property getColomnSet while trying to download the desired file.
Possibly, the main problem is the js involved to download the document is invoked before the client renders the HTML DOM completely.
The relevant HTML, a bit more of your previous lines of code and the error stack trace would have given us some more idea about what's going wrong.
Solution
You can induce some measures to wait till the complete DOM Tree is rendered following the discussion:
Generic funtion to check if page has completely loaded in Selenium
A couple of facts:
In your code trials I don't see you interacting with the element (By.ID,'element_1_id') so possibly you can remove the step of presence_of_element_located() for the element (By.ID,'element_1_id').
If you still require presence_of_element_located((By.ID,'element_1_id')) catch the exception and initiate required steps.
As you invoke move_to_element() over elem1 and elem2 and moving ahead invoke perform() you need to induce WebDriverWait with expected_conditions as element_to_be_clickable(locator)
tl;dr (references)
Cannot read property 'getContext' of null, using canvas
Uncaught TypeError: Cannot read property 'getContext' of undefined
Uncaught Error remote.js
Try the following - it works on Salesforce Lightning UI screens:
WebElement element = driver.findElement(By.id("your ID"));
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("arguments[0].click();", element);

NullPointer on Bitmap.getWidth in Codenameone Android app

I have an app created in CodenameOne running on Android that is throwing NullPinterExpections after trying to scale too many images. I've used CacheMap to help the situation but still get the issue after loading too many images.
Here is my code that throws the issue, from within InfiniteContainer fetchComponents
Image i = (Image) MoveService.getInstance().getImage(thumbnail_url);
if (i == null) {
i = theme.getImage(move.getThumbnail_url());
if (i != null) {
i = i.fill(width+20, (width / 2) * 3);
MoveService.getInstance().putImage(move.getThumbnail_url(), i);
}
}
And here is what I get from the logs:
[EDT] 0:8:57,596 - Exception: java.lang.NullPointerException - Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:748)
at com.codename1.impl.android.c.a(AndroidImplementation.java:1688)
at com.codename1.k.s.c(Image.java:1008)
at com.codename1.k.s.c_(Image.java:954)
at com.codename1.k.s.b(Image.java:919)
at com.codename1.impl.android.c$8.a(AndroidImplementation.java:6216)
at com.codename1.k.n.a(EncodedImage.java:627)
at com.codename1.k.n.b(EncodedImage.java:654)
at com.codename1.k.s.e(Image.java:903)
at com.codename1.k.s.f(Image.java:974)
at com.altitude.studios.polebible.e$b.<init>(Unknown Source)
at com.altitude.studios.polebible.e$16.a(Unknown Source)
at com.codename1.k.u.m(InfiniteContainer.java:143)
at com.codename1.k.u$5.run(InfiniteContainer.java:172)
at com.codename1.k.m.l(Display.java:1154)
at com.codename1.k.m.j(Display.java:1098)
at com.codename1.k.m.i(Display.java:999)
at com.codename1.k.ad.run(RunnableWrapper.java:120)
at com.codename1.impl.b$1.run(CodenameOneThread.java:60)
at java.lang.Thread.run(Thread.java:818)
This can happen if an image went thru the wrong pipeline and the underlying native image is gone. If the image is a font image or a similar "exotic" image try converting it to a regular image using toEncodedImage() or similar method.
It can also happen if you explicitly invoked dispose() on an image.

An unexpected severe error has occurred in Jdeveloper

My Jdeveloper is continuously prompting me with this error popup window.
The error details is as follows:-
The details of the error message is as follows:-
Exception while updating action Block Selection
java.lang.NoClassDefFoundError: oracle/javatools/editor/EditorSelectionColumns
o.i.ceditor.CodeEditorController.update(CodeEditorController.java:462)
o.i.controller.IdeAction.updateAction(IdeAction.java:787)
o.i.controller.IdeAction.updateAction(IdeAction.java:749)
o.i.view.View.updateAction(View.java:390)
o.i.view.View.updateToolbarActions(View.java:384)
o.i.view.View.updateVisibleActions(View.java:214)
com.oracle.jdeveloper.nbwindowsystem.NbMainWindow$UpdateVisibleActions.fireUpdate(NbMainWindow.java:1794)
com.oracle.jdeveloper.nbwindowsystem.NbMainWindow$UpdateVisibleActions.actionPerformed(NbMainWindow.java:1779)
jx.s.Timer.fireActionPerformed(Timer.java:313)
jx.s.Timer$DoPostEvent.run(Timer.java:245)
j.a.event.InvocationEvent.dispatch(InvocationEvent.java:311)
j.a.EventQueue.dispatchEventImpl(EventQueue.java:756)
j.a.EventQueue.access$500(EventQueue.java:97)
j.a.EventQueue$3.run(EventQueue.java:709)
j.a.EventQueue$3.run(EventQueue.java:703)
j.security.AccessController.doPrivileged(Native Method)
j.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
j.a.EventQueue.dispatchEvent(EventQueue.java:726)
o.javatools.internal.ui.EventQueueWrapper._dispatchEvent(EventQueueWrapper.java:169)
o.javatools.internal.ui.EventQueueWrapper.dispatchEvent(EventQueueWrapper.java:151)
j.a.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
j.a.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
j.a.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
j.a.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
j.a.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
j.a.EventDispatchThread.run(EventDispatchThread.java:82)
I cant figure it out what is the problem. It worked few times by cancelling the pop up. But I think it's better to find a solution for it.
This is a fairly regular screen in jDeveloper, I get it at least twice a day. I click save and exit (which does nothing) and continue working.

How to use ReactiveUI with WinForms

I have decided to learn ReactiveUI after seeing what can be done with it, but my enthusiasm has been broken at the first attempt to run a simple project. I have recreated the example from this article, using reactiveui-winforms.Net40 version 6.5.0 from NuGet. Everything compiles ok, but i get an exception during runtime at the following line
var OKCmdObs = this.WhenAny(vm => vm.EnteredText,
s => !string.IsNullOrWhiteSpace(s.Value));
System.InvalidOperationException occurred
HResult=-2146233079
Message=The current thread has no Dispatcher associated with it.
Source=System.Reactive.Windows.Threading
StackTrace:
at System.Reactive.Concurrency.DispatcherScheduler.get_Current()
at ReactiveUI.PlatformRegistrations.<>c.<Register>b__0_7() in C:\workspace\git-perso\ReactiveUI\ReactiveUI\Platform\Registrations.cs:line 75
InnerException:
Does anyone have any idea of what's happening ?
The mentioned article does not have the compiled project available for download, and i didn't find any complete "Hello-World" project for reactiveui-winforms.
My test project can be downloaded here.
In Visual Studio, if i Continue(F5), another exception occures :
System.NullReferenceException occurred
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=ReactiveUI
StackTrace:
at ReactiveUI.IROObservableForProperty.<>c__DisplayClass1_0.<GetNotificationForProperty>b__6(IReactivePropertyChangedEventArgs`1 x) in C:\workspace\git-perso\ReactiveUI\ReactiveUI\IROObservableForProperty.cs:line 44
InnerException:
If i continue to hit F5 i get :
System.Exception was unhandled by user code
HResult=-2146233088
Message=An OnError occurred on an object (usually ObservableAsPropertyHelper) that would break a binding or command. To prevent this, Subscribe to the ThrownExceptions property of your objects
Source=ReactiveUI
This exception is caused because RxUI always tries to initialize for WPF, even though (because you're also using the winforms package) it'll override this setting with a Winforms-based scheduler right after.
It should be harmless though, as it's catched and ignored. You're probably hitting it within VS ?

Resources