I am using Robot Framework with SikuliLibrary to compare some reports, but it is throwing timeout exception intermittently. Some runs failed only.
The error message is:
com.github.rainmanwy.robotframework.sikulilib.exceptions.TimeoutException: Timeout happend, could not find P(Recibo_Financeiro.png) S: 0.699999988079071
I created a helper keyword to use in my tests:
*** Settings ***
Library SikuliLibrary
*** Variables ***
${IMAGE_DIR} ${EXECDIR}\\Images
*** Keywords ***
Verify PDF
[Arguments] ${PDF}
Add Image Path ${IMAGE_DIR}
Wait Until Screen Contain ${PDF} 20
Remove Image Path ${IMAGE_DIR}
Related
I have S3 remote logging enabled, Airflow is installed on an EC2. My dags are running however, they don't always create a log and then fails. The error is as follows:
*** Falling back to local log
*** Log file does not exist: /home/ec2-user/airflow/logs/REMOVED/REMOVED/2022-03-07T07:00:00+00:00/2.log
*** Fetching from: http://ip-10-105-32-92.eu-west-1.compute.internal:8793/log/REMOVED/REMOVED/2022-03-07T07:00:00+00:00/2.log
*** Failed to fetch log file from worker. Client error '404 NOT FOUND' for url 'http://ip-10-105-32-92.eu-west-1.compute.internal:8793/log/REMOVED/REMOVED/2022-03-07T07:00:00+00:00/2.log'
For more information check: https://httpstatuses.com/404
After a few attempts (3-5), it eventually does end up working.
I have even disabled the remote logging in an attempt to debug, and it still doesn't work. Any suggestions?
Apache Airflow version: 2.2.4
We use a describe stacks API call to get the latest ECS Task Definition, and I've noticed we have lots of these errors:
An error occurred (Throttling) when calling the DescribeStacks operation (reached max retries: 4): Rate exceeded
I have two files one for keywords and other one is to run the actual test case
testkeywords.robot
*** Settings ***
Library Requestslibrary
Library JSONlibrary
Library Collections
*** Variables ***
${Base_URL} http://www.thetestingworldapi.com/
*** Keywords ***
Get Student Name
[Arguments] ${id}
create session Get_student_details ${base_url}
${response}= get request Get_student_details api/studentsDetails/${id}
#log to console ${response.content}
${json_res}= to json ${response.content}
#log to console ${json_res}
#{first_name_list}= get value from json ${json_res} data.first_name
${first_name}= get from list ${first_name_list} 0
[return] ${first_name}
sample.robot
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Resource Resources/testkeywords.robot
*** Variables ***
${id} 56841
*** Test Cases ***
TC_01
Get Student Name ${id}
I am getting the error Error "Importing test library 'Requestslibrary' failed: ModuleNotFoundError: No module named 'Requestslibrary"
but the sample file is ruining without any issues , while importing the same libraries
I have 2 files in my project
TestCase.robot
UserKeys.robot
UserKeys.robot file has below Setting
*** Settings ***
Library SeleniumLibrary
Library DatabaseLibrary
Library Collections
Library difflib
Suite Setup Connect To Database psycopg2 ${DBName} ${DBUser} ${DBPass}
Suite Teardown Disconnect From Database
When I run my project I get below error:
Error in file 'Projects/POC/Resources/UserKeyWords.robot': Non-existing setting 'Suite Setup'.
Error in file 'Projects/POC/Resources/UserKeyWords.robot': Non-existing setting 'Suite Teardown'.
Not sure what I am missing !!!
Resource files cannot contain Suite Setup and Suite Teardown.
From the robot framework user guide:
Additionally, the Setting table in resource files can contain only import settings (Library, Resource, Variables) and Documentation.
So here is my code I see the app open in the emulator then close and I still get this error
** Variables **
${REMOTE_URL} http://localhost:4723/wd/hub
${PLATFORM_NAME_ANDROID} Android
${DEVICE_NAME_ANDROID} emulator-5554
${APP_ANDROID} /Users/william_flow/Documents/Code/xxx/App/base.apk
${APP_PACKAGE} com.xxx.android
${AUTOMATION_NAME} appium
${RESET_OFF} true
${AppAct} com.xxx.android.flavor.full.activities.HomeActivity
** Test Cases *
Open Android app
Open Application ${REMOTE_URL} app=${APP_ANDROID}
automationName=${AUTOMATION_NAME}
platformName=${PLATFORM_NAME_ANDROID}
deviceName=${DEVICE_NAME_ANDROID} appPackage=${APP_PACKAGE}
noReset=${RESET_OFF}
sleep 5s
I run it I see it run in my simulator and it Fails saying
Open Android app | FAIL |
WebDriverException: Message: An unknown server-side error occurred
while processing the command. Original error: Cannot start the
‘com.xxx.android’ application. Visit
https://github.com/appium/appium/blob/master/docs/en/writing-running-
appium/android/activity-startup.md for troubleshooting. Original
error: ‘com.xxx.android.activities.MainActivity’ or
‘com.xxx.android.com.xxx.android.activities.MainActivity’ never
started. Visit
https://github.com/appium/appium/blob/master/docs/en/writing-running-
appium/android/activity-startup.md for troubleshooting
so what am I doing wrong?
I have modfied your code, so that it becomes more redable and get executed easily
*** Settings ***
Documentation This script starts apps on two phones
Library AppiumLibrary
Library Collections
*** Variables ***
${REMOTE_URL} http://localhost:4723/wd/hub
${PLATFORM_NAME_ANDROID} Android
${DEVICE_NAME_ANDROID} emulator-5554
${APP_ANDROID} /Users/william_flow/Documents/Code/xxx/App/base.apk
${APP_PACKAGE} com.xxx.android
${AUTOMATION_NAME} appium
${RESET_OFF} true
${AppAct} com.xxx.android.flavor.full.activities.HomeActivity
*** Test Cases ***
First test case
Open Android app
*** Keywords ***
Open Android app
Open Application ${REMOTE_URL} app=${APP_ANDROID} automationName=${AUTOMATION_NAME} platformName=${PLATFORM_NAME_ANDROID} deviceName=${DEVICE_NAME_ANDROID} appPackage=${APP_PACKAGE} noReset=${RESET_OFF} appActivity=${AppAct}
sleep 5s
Couple of Key points
appActivity was missing
Assuming appium server is running at 4723
Assuming Appium library is installed
You may also want to have a look on this link Automating mobile App using Robot Framework and Appium
If you can address above 4 points , your error should get resolved!!
I have been trying to run the test cases against I.E browser
The following is my code
*** settings ***
Library Selenium2Library
Library ExcelLibrary
*** variables ***
${URL_LOCATIONS} www.google.com(for example)
${BROWSER_TYPE} ie
${DELAY_TIME} 1
*** keywords ***
Open Browser
Open Browser ${URL_LOCATIONS} ${BROWSER_TYPE}
and running the script using the following command
pybot --variable BROWSER:ie Main.txt
If you want to set ${BROWSER_TYPE} from the command line, you must use that name with the --variable argument:
pybot --variable BROWSER_TYPE:ie Main.txt