Key words for test case with pop-up message - automated-tests

I would like to writing a key words to the test where
Upload a file on web page
After I can get one of pop-up message: "Operation successful" or "Operation failed"
When uploading file was finished with message "Operation successful" test should will be continue, else test should start again at 1.
I don't know how a key words I may to use to verify text from message.
I wrote something like this, but doesn't work:
Run Keyword If Page Should Contain Operation successful. Click Element xpath://*[#id="modal-button-"]
... ELSE Run Keywords
... Click Element xpath://*[#id="modal-button-"]
... Execute Manual Step "Operation failed. Try again"

Related

Action requested: Declare your Ad ID permission but i cant An unexpected error has occurred. Please try again. (58FCB30C)

i am try to uplaode my app but
Errors, warnings and messages
Your app targets Android 13 (API 33) or above. You must declare the use of advertising ID in Play Console.
then i go to
App content -> Advertising ID
try to select No or yes alwase return
An unexpected error has occurred. Please try again. (58FCB30C)
58FCB30C
save sucssess and coutenu

Robot Framework Browser Library: Save and access PDF file returned by server

In my robot framework script I use the browser library to open a webpage and click on a button to get a receipt in PDF.
The button does not contain the direct link to the PDF: when you click the button, it opens a new page and after ~0.5 second the page returns a PDF file generated by the server.
I was not able to get and access the generated file in the Robot Framework script.
My tentative #1
I thought the PDF file could be captured by downloading it with a promise but it failed:
Click button.okButton
Switch Page NEW
${dl_promise} Promise To Wait For Download ./${SUITE_NAME}/downloads
${file_obj}= Wait For ${dl_promise}
File Should Exist ${file_obj}[saveAs]
Failure:
Tentative #1bis
${dl_promise} Promise To Wait For Download ./${SUITE_NAME}/downloads
Click button.okButton
Switch Page NEW
${file_obj}= Wait For ${dl_promise}
File Should Exist ${file_obj}[saveAs]
Same failure (TimeoutError: page.waitForEvent: Timeout 20000ms exceeded while waiting for event "download")
My tentative #2
The new page source code is the following:
<html><head></head><body><embed name="9AF27FA0E167C8860EB51FD926BE211B" src="about:blank" type="application/pdf" internalid="9AF27FA0E167C8860EB51FD926BE211B"></body></html>
I thought it is a local storage ID, am I right? So I tried the following:
Click button.okButton
Switch Page NEW
${sourceCode} = Get Page Source
${storageItem} = Get Regexp Matches ${sourceCode} (?<=(internalid="))(.*)(?=(">))
${myPDFfile} = Local Storage Get Item ${storageItem}
Log ${myPDFfile}
But seems it does not work:
... any idea how I should proceed? Thanks so much for your help and suggestions.
Keyword Promise To Wait For Download should be before triggering action. So the logic should be the following:
Promise
Trigger download
Wait for promise

use of unconstructed message in an orchestration

I have this problem that I hope someone can help solve.
I have an orchestration that as input receive a file (message as Microsoft.XLANGs.BaseTypes.Any). Just a file with some unstructured text.
I have created a Dynamic send port that save the received file in a backup folder.
The issue is that when someone send the same file (with the same filename), it doesn't overwrite the file in the backup folder.
when a try this following in a constructMessage shape
Message_new = orgMessage;
Message_new(FILE.CopyMode)= 2; //2=overwrite,
Both message are of same type: Microsoft.XLANGs.BaseTypes.Any
I'm getting this error:
Error 1 use of unconstructed message 'orgMessage'
'': message has not been initialized in
The error you got is not linked to the dynamic port neither the copy mode.
You are trying to assign to your message named "NewMessage" a message that is not constructed neither received in the orchestration.
Please check that the message named "orgMessage" is a message that was received via a receive shape or if it is constructed before your message assignment.

Qt Sql error coming from nowhere: No query Unable to fetch row

I have a client connected to a server, and it is also connected to a Sqlite3 database. When I receive a message from the server a get an QMessageBox showing an error
"No query Unable to fetch row"
I tried it with qDebug() outputs and by Debugging the application but the message is not produced by me nor thrown by any DB execution, since none is executed at the moment when I get the message.
Ok I figured out that the error is shown when I write something to the socket. The error does not affect anything, the program continues to run. Here is the code piece were the error is shown:
void ConnectionHandler::sendBytes(QByteArray bytes) {
QMessageBox::critical(0, "test", "test");
this->socket->write(bytes);
this->socket->flush(); // after this call the error message is shown
this->socket->waitForBytesWritten();
QMessageBox::critical(0, "test2", "test2");
}
I checked the bytes that are supposed to be written but they look like what they are supposed to!?
Screenshot of the error:

sendmailR: how to handle occasional "Unknown SMTP code" errors

I'm using sendmailR in my R script to send notifications.
Sometimes notification fails with the following error:
Unknown SMTP code: 452
Error in if (code == lcode) { : argument is of length zero
Execution halts.
How can I handle such errors, so that even if notification fails the script runs on?
Wrap the try function around sendmail (assuming you use sendmail, if not then wrap it around the function or code that produces the error) this way:
try(sendmail(from,to,subject), silent=T)
You can set silent to FALSE if you want the error message to appear but still continue with the process

Resources