Browserstack python sdk is throwing type error in init file of its own libary

358 views Asked by At

I am trying to run the automation in local using browserStack. I am using python and appium for this.

I am getting the below error. I am unable to understnad what I need to change. Appium server v1.22.3

Browserstack python sdk version browserstack-sdk 1.10.2(from pip)

19:58:05 [browserstack_sdk.__init__][INFO] - Using existing app id bs://id for hash : somehash.

19:58:05 [browserstack_sdk.__init__][INFO] - Using App : bs://id.

19:58:10 [browserstack_sdk.__init__][INFO] - Starting Browserstack Local
The process cannot access the file because it is being used by another process.

19:58:17 [browserstack_sdk.__init__][INFO] - Browserstack Local is now running!

19:58:17 [browserstack_sdk.__init__][INFO] - Setting up for Browserstack, using framework: python
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "E:\BrowserStack_Automate\python-appium-app-browserstack\env\Scripts\browserstack-sdk.exe\__main__.py", line 7, in <module>
  File "E:\BrowserStack_Automate\python-appium-app-browserstack\env\Lib\site-packages\browserstack_sdk\__init__.py", line 2332, in run_on_browserstack
    t.join()
  File "E:\BrowserStack_Automate\python-appium-app-browserstack\env\Lib\site-packages\browserstack_sdk\__init__.py", line 643, in join
    raise self.exc
  File "E:\BrowserStack_Automate\python-appium-app-browserstack\env\Lib\site-packages\browserstack_sdk\__init__.py", line 637, in run
    self.ret = self._target(*self._args, **self._kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\BrowserStack_Automate\python-appium-app-browserstack\env\Lib\site-packages\browserstack_sdk\__init__.py", line 2049, in bstack111l1l11_opy_
    exec(open(bstack1l111l_opy_).read())
  File "<string>", line 27, in <module>
  File "E:\BrowserStack_Automate\python-appium-app-browserstack\env\Lib\site-packages\appium\webdriver\webdriver.py", line 230, in __init__
    super().__init__(
  File "E:\BrowserStack_Automate\python-appium-app-browserstack\env\Lib\site-packages\browserstack_sdk\__init__.py", line 1454, in bstack1lll1l11_opy_
    bstack111111ll_opy_ = bstack1l1ll1l_opy_(CONFIG, bstack1lll11l1_opy_)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\BrowserStack_Automate\python-appium-app-browserstack\env\Lib\site-packages\browserstack_sdk\__init__.py", line 1001, in bstack1l1ll1l_opy_
    bstack1llllll_opy_[bstack1llllll1_opy_] = str(config[bstack1l1l_opy_ (u"࠭ࡰ࡭ࡣࡷࡪࡴࡸ࡭ࡴࠩଧ")][index][bstack1llllll1_opy_] * 1.0)
                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
TypeError: can't multiply sequence by non-int of type 'float'

19:58:18 [browserstack_sdk.__init__][INFO] - Handling session close

19:58:18 [browserstack_sdk.__init__][INFO] - Stopping Browserstack Local

19:58:22 [browserstack_sdk.__init__][INFO] - All done!

I tried adding these thing in browserStack.yml

browserstackLocal: true
browserStackLocalOptions:
  forceLocal: true # <boolean> (Default false)
1

There are 1 answers

2
grandEL-dsouza On

Please make sure your system has the following config in place: Appium-Python-Client==2.6.1;python_version >= '3.0' browserstack-local==1.2.2

Additionally, in the logs you have sent here, I see this error:

"TypeError: can't multiply sequence by non-int of type 'float'"

This indicates some data type error in your test.

Please try cloning this sample repository and try to run the test.

https://github.com/browserstack/python-appium-app-browserstack

Thanks.