ROBOT Framework Exception Handling - automation

How to use Run Keyword And Ignore Error in ROBOT Keyword , Please give with example
I have tried to do scrolling by using Scroll Element Into View /html/body/section/div[3]/div
it is scrolling correctly to that point but it is showing it was failed throwing an error of movetargetoutofboundsexception: message: move target out of bounds , for handling this I tried to use Run Keyword And Ignore Error but don't know to how to write this in code please help to solve this issue with an example

It should work like this:
Run Keyword And Ignore Error Scroll Element Into View /html/body/section/div[3]/div

Related

Unable to evaluate the expression Object has been collected

There is one object from one class which is not getting identified during the runtime or debugging.
The same object gets highlighted on devtools. I'm not understanding what is wrong over here.
Does anyone have any idea what is the cause of this issue?
Let me know if require more details.
The reason it was not getting highlighted during runtime was because it is the part of one iframe. After pointing my webDriver to the iframe and then the object , my code was running successfully.

face Uncaught Syntax Error when check (add try-catch wrapping)

i face this error
The error I receive
here the file : https://igrafix.ir/wp-content/cache/autoptimize/autoptimize_c709febde8a57bd03504ae5fe6f38a57.php
when this option in photo Be checked above error happening. (site performance Improves 60%) But I encountered some problems ! like (Header menu doesn't load)
i tried : de active all plugins but doesn't work !?
solved by adding this Excluded JavaScript Code
/jquery-?[0-9.](.*)(.min|.slim|.slim.min)?.js

nightwatch test fails with multiple click events in sequence

When running a nightwatch.js test on a browser with a checkbox that
is not visible using the following code.
browser.moveToElement('input[id="2verificationYes"]')
.click('input[id="2verificationYes"]')
I get the following error :
An error occurred while running .click() command on ,input[id="2verificationYes"]>: unknown error: Element `element` is not clickable at point (111, 701). Other element would receive the click: `otherElement`
at process._tickCallback (internal/process/next_tick.js:64:7)
I am using
nightwatch v.1.0.19, chromedriver ^2.43.0, geckodriver ^1.16.2, selenium-server ^3.14.0
I have tried using the callback functions with each call but the result is the same. Tried to research how to scroll to an element in nightwatch, but the api's don't have that. It is my understanding the the moveToElement function is supposed to scroll to the element.
For me moveToElement is working good. I believe you are seeing error because you forgot to mentioned the Xoffset and Yoffset.
Try my below work around and let me know:
browser.moveToElement('input[id="2verificationYes"]',Xoffset,Yoffset)
.click('input[id="2verificationYes"]')
for your reference: search 'moveToElement' here
Can you try giving '0' and let me know:
browser.moveToElement('input[id="2verificationYes"]',0,0)
.click('input[id="2verificationYes"]')
Same time try giving little wait time to narrow down the issue. Good luck

Issue in using dynamic XPATH in selenium

I have written the below code to identify the element in chrome and click on it, but later I realized that value for "#id" (u_jsonp_X_x) is keep on changing and that's causing fail to identify the element.
dr2.findElement(By.xpath("//*[#id='u_jsonp_2_4']/div/a[3]/span[1]")).click();
To resolve this issue, I have used below code based on my understanding but still not working
dr2.findElement(By.xpath("[starts-with(#id=(),'u_jsonp_2')]")).click();
Could you please help me to resolve this issue?
The XPath syntax in the second case is not correct, you meant:
dr2.findElement(By.xpath("//*[starts-with(#id, 'u_jsonp')]/div/a[3]/span[1]")).click();

Silverlight Application Navigation to a fragment requires the Frame to have content currently

One of our users has recently reported the following error popping up on our production Silverlight application:
"Navigation to a fragment requires the Frame to have content currently"
I've Googled it but there doesn't seem to be too much information regarding the error. Does anyone know exactly what this error means?
In my case this happens when you first set the content of the frame to null as the following:
this.ContentFrame.Content = null;
this.ContentFrame.Navigate(uri);