Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: Timeout value connect was <object object at >, but it must be an int, float or None #4761

Closed
v1v3kls opened this issue May 11, 2023 · 21 comments

Comments

@v1v3kls
Copy link

v1v3kls commented May 11, 2023

OS: Windows
Python Version: 3.11.3
Packages Installed while installing Robotframework:

Package                      Version
---------------------------- --------
adbutils                     1.2.9
apkutils2                    1.0.0
Appium-Python-Client         2.9.0
async-generator              1.10
attrs                        23.1.0
cached-property              1.5.2
certifi                      2023.5.7
cffi                         1.15.1
charset-normalizer           3.1.0
cigam                        0.0.3
colorama                     0.4.6
decorator                    5.1.1
Deprecated                   1.2.13
deprecation                  2.1.0
docutils                     0.20
exceptiongroup               1.1.1
filelock                     3.12.0
h11                          0.14.0
idna                         3.4
kitchen                      1.2.6
logzero                      1.7.0
lxml                         4.9.2
outcome                      1.2.0
packaging                    20.9
Pillow                       9.5.0
pip                          22.3.1
pip-review                   1.3.0
progress                     1.6
py                           1.11.0
pycparser                    2.21
pyelftools                   0.29
pyparsing                    3.0.9
PySocks                      1.7.1
requests                     2.30.0
retry                        0.9.2
robotframework               6.0.2
robotframework-appiumlibrary 2.0.0
selenium                     4.9.1
setuptools                   67.7.2
six                          1.16.0
sniffio                      1.3.0
sortedcontainers             2.4.0
trio                         0.22.0
trio-websocket               0.10.2
uiautomator                  1.0.2
uiautomator2                 2.16.23
urllib3                      2.0.2
whichcraft                   0.6.1
wrapt                        1.15.0
wsproto                      1.2.0
xmltodict                    0.13.0

I am trying run a sample robot file for flutter generated Android App.

I am getting below error.

ValueError: Timeout value connect was <object object at 0x000001E972884B80>, but it must be an int, float or None.

Below is my robot file config. And appium server is running with appium --allow-insecure chromedriver_autodownload --allow-cors

*** Settings ***

| Library | AppiumLibrary | run_on_failure=No Operation
# | Library | AppiumLibrary | timeout=500000
Library  AppiumLibrary
Library  BuiltIn

*** Variables ***
${ANDROID_AUTOMATION_NAME}    UIAutomator2
${ANDROID_APP}                ${CURDIR}\\app\\app-debug.apk
${PLATFORM_NAME}              Android
${PLATFORM_VERSION}  %{ANDROID_PLATFORM_VERSION=12}
${DEVICE_NAME}  emulator-5554
# ${APP_ACTIVITY}  MainActivity

*** Test Cases ***
Start the App
    # Set Appium Timeout    100000
    Open Test Application
    

*** Keywords ***
Open Test Application
    Open Application    http://127.0.0.1:4723/wd/hub   automationName=${ANDROID_AUTOMATION_NAME}    platformName=${PLATFORM_NAME}    platformVersion=${PLATFORM_VERSION}    deviceName=${DEVICE_NAME} app=${ANDROID_APP} timeout=100s

Please help. :)

@gunaNeelamegam
Copy link

Can you very the android driver name.I think so.

caps["deviceName"] = "" caps["platformName"] = "Android" caps["platformVersion"] = "10" caps["automationName"] = "uiAutomator2" caps["appPackage"] = "com.google.android.apps.maps" caps["appActivity"] = "" url = "http://localhost:4723/wd/hub" self.driver = webdriver.Remote(url, caps)

@v1v3kls
Copy link
Author

v1v3kls commented May 11, 2023

@gunaNeelamegam I use Appium library and Flutter's Android for testing. Where is self.driver comes from ? Any Reference to Docs ?

@gunaNeelamegam
Copy link

gunaNeelamegam commented May 11, 2023

@v1v3kls we are working with creating the own Keyword using robot framework with bare python script.

https://github.com/appium/python-client
With robot python module.

@v1v3kls
Copy link
Author

v1v3kls commented May 11, 2023

@gunaNeelamegam I am new to Appium + Robot.

I am using .robot file to execute the code. And I run with robot <filename.robot>

Do I need to run python code to run script ? Please help.

@gunaNeelamegam
Copy link

@v1v3kls yes,if you interested to create own Keyword, follow the steps below.

###Steps:

1, create the python file and inside the python file implement the function or class based components .
2, import the file into the robot file as Library with Implement python file name.

Note:

1, when you create the class based component import the keyword decorator.
from robot.deco.api port keyword decorator.

2, python class name as same as python file name and import into robot file.

3, use as the keyword as same as using.

4, you,can also able to use the app the external.module inside the python script as you created.

If you have any doubts ping me.

@v1v3kls
Copy link
Author

v1v3kls commented May 11, 2023

Thank you. I do not want to write Python Script.

I came reading from the link - https://pypi.org/project/robotframework-appiumlibrary/2.0.0/#usage

I see there is way of testing the app using Only Robotframework from above link. Why not I use that ?

As you had suggested, still I am not getting How Python and Robot Interacts ? - Are you suggesting this one ? - https://github.com/robotframework/RobotDemo/blob/master/keyword_driven.robot

@gunaNeelamegam
Copy link

gunaNeelamegam commented May 12, 2023

Okay 👍, Readability and scalability of the code is must need for contribution.

If the code base goes must higher you cannot find where the error is raised for debugging tooks the time long. So must to break down the script it's important.

@aamirnesar
Copy link

I am also facing same issue, can someone please help.

@gunaNeelamegam
Copy link

gunaNeelamegam commented May 12, 2023 via email

@gunaNeelamegam
Copy link

gunaNeelamegam commented May 12, 2023 via email

@gunaNeelamegam
Copy link

gunaNeelamegam commented May 12, 2023 via email

@AntoineGa
Copy link

I have the same issue and setting the lib urllib3 to 1.26.15 seems to have unblocked me

@wenxie18
Copy link

got the same error on mac

@v1v3kls
Copy link
Author

v1v3kls commented May 20, 2023

I had downgraded to Python 3.8 now.

Now, I am trying to run the robot file for opening the App. I am getting error as below.

MaxRetryError: HTTPConnectionPool(host='"http', port=80): Max retries exceeded with url: //127.0.0.1:4723/wd/hub/%22/session (Caused by NameResolutionError('<urllib3.connection.HTTPConnection object at 0x039F8748>: Failed to resolve \'"http\' ([Errno 11001] getaddrinfo failed)'))

I had also run the Appium Server as below.

appium --allow-insecure chromedriver_autodownload --allow-cors

@gunaNeelamegam
Copy link

gunaNeelamegam commented May 21, 2023 via email

@v1v3kls
Copy link
Author

v1v3kls commented May 25, 2023

Hi @gunaNeelamegam

Thanks for the reply.

Only Emulator is used for testing.

Should I uninstall the above package even though I use Emulator Only ? [Haven't verified the packages is installed]

@gunaNeelamegam
Copy link

Hi @gunaNeelamegam

Thanks for the reply.

Only Emulator is used for testing.

Should I uninstall the above package even though I use Emulator Only ? [Haven't verified the packages is installed]

What ever the device when testing with appium it implicitly install all the dependency services.

Can you provide much more information error log

@av1v3k
Copy link

av1v3k commented May 30, 2023

I have the same issue and setting the lib urllib3 to 1.26.15 seems to have unblocked me

@AntoineGa How is this applicable If I use only Robot Framework alone ? [I mean using DSL language]

image

@AntoineGa
Copy link

set the version in your requirements.txt file
example : https://github.com/robotframework/robotframework/blob/master/utest/requirements.txt

@av1v3k
Copy link

av1v3k commented May 30, 2023

But, there is no urllib3 mentioned here ? I was asking about urllib version to be specified.

@pekkaklarck
Copy link
Member

This tracker is only for bug reports and enhancement requests related to Robot Framework itself. This issue seem to be about AppiumLibrary and it thus doesn't belong here. If you suspect there's a bug in AppiumLibrary, submit an issue to its tracker.

There's been active discussion here. Feel free to continue even though I now close this issue. You can also try asking help on our Slack or other support forums listed at robotframework.org.

@pekkaklarck pekkaklarck closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants