Python Selenium TypeError : 'str'및 'WebElement'개체를 연결할 수 없습니다.

리아 즈 라 다니

Selenium Webdriver와 함께 Python을 사용 중입니다. 텍스트 필드의 값이 1,000.000입니다.

다음 오류가 발생합니다. TypeError : 'str'및 'WebElement'개체를 연결할 수 없습니다.

Error
Traceback (most recent call last):
File "C:\Webdriver\reverted to backup\ClearCore 501\TestCases\DataPreviewsPage_TestCase.py", line 93, in test_add_DataPreviews
dp.is_maxrecords_1000_displayed()
File "C:\Webdriver\reverted to backup\ClearCore 501\Pages\data_previews.py", line 76, in is_maxrecords_1000_displayed
print "max_records_textfield does not have default value 1,000.00 The value  is = " + max_records_textfield
TypeError: cannot concatenate 'str' and 'WebElement' objects

내 코드 조각은 다음과 같습니다.

최대 레코드 텍스트 필드의 기본값은 1,000.000입니다.

    def is_maxrecords_1000_displayed(self):
        max_records_textfield = self.driver.find_element(*MainPageLocators.datapreviews_maxrecords_textfield2)
        print "max_records_textfield = ",  max_records_textfield.get_attribute('value')
        if max_records_textfield.get_attribute('value') == "1,000.000":
            print "max_records_textfield" + max_records_textfield.get_attribute('value')
        else:
            print "max_records_textfield does not have default value 1,000.00 The value is = " + max_records_textfield
            print "Going to enter 1,000.00 into the textfield"
            max_records_textfield.send_keys("1,000.00")

webelement (max_records_textfield)를 문자열 변수로 캐스트해야합니까? 어떻게해야합니까?

아난드 S 쿠마

오류 메시지는 매우 명확 WebElement합니다. 문자열을 개체 와 연결하려고 합니다.

값을 인쇄하려면- max_records_textfield.get_attribute('value')(if 조건과 if블록 내부의 print 문에서 사용한 것과 동일 )-

print "max_records_textfield does not have default value 1,000.00 The value is = " + max_records_textfield.get_attribute('value')

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

TypeError : 'str'및 'float'개체를 연결할 수 없습니다. : Pandas

분류에서Dev

Python TypeError : 인쇄를 시도 할 때 'str'및 'int'개체를 연결할 수 없습니다.

분류에서Dev

TypeError : 'str'및 'function'객체를 연결할 수 없습니다.

분류에서Dev

Tkinter Label, TypeError : 'str'및 'instance'개체를 연결할 수 없습니다.

분류에서Dev

TypeError : Flask의 'str'및 'float'개체를 MySQL과 연결할 수 없습니다.

분류에서Dev

Python 오류 : 'str'및 'builtin_function_or_method'개체를 연결할 수 없습니다.

분류에서Dev

django-selenium TypeError : 'str'개체를 호출 할 수 없습니다.

분류에서Dev

Python : TypeError : 'str'과 'int'를 연결할 수 없습니다.

분류에서Dev

TypeError : '<class'str '>'유형의 개체를 연결할 수 없습니다. Series 및 DataFrame obj 만 유효합니다.

분류에서Dev

re.search () TypeError : 'str'및 'NoneType'객체를 연결할 수 없습니다.

분류에서Dev

TypeError : scrapy.Request ()에 맞춤 URL을 배치 할 때 'str'및 'NoneType'개체를 연결할 수 없습니다.

분류에서Dev

Python TypeError : 메시지의 이메일 본문 부분에서 'str'및 'list'개체를 연결할 수 없습니다.

분류에서Dev

TypeError : 'str'과 'NoneType'객체를 연결할 수 없습니다 .python BS4

분류에서Dev

형식 오류는 'str'및 'ErrorList'개체를 연결할 수 없습니다.

분류에서Dev

TypeError : str에 바이트를 연결할 수 없습니다.

분류에서Dev

Python str () : TypeError : 'str'객체를 호출 할 수 없습니다-중지 코드

분류에서Dev

TypeError : 'str'객체는 Python을 통해 Selenium을 사용하여 호출 할 수 없습니다.

분류에서Dev

TypeError : 'str'객체는 Python을 통해 Selenium을 사용하여 호출 할 수 없습니다.

분류에서Dev

Python에서 str과 int를 연결할 수 없습니다.

분류에서Dev

Python / Pygame TypeError : 'str'객체는 호출 할 수 없습니다.

분류에서Dev

Python 3.4 : TypeError : 'str'객체는 호출 할 수 없습니다.

분류에서Dev

TypeError : 'str'객체는 호출 할 수 없습니다-Python

분류에서Dev

TypeError 'str'객체는 호출 할 수 없습니다-Python

분류에서Dev

xml에 디렉터리 목록- 'str'및 'NoneType'개체를 연결할 수 없습니다. 처리 방법?

분류에서Dev

for 루프 내에서 열린 상태에서 TypeError : 'str'개체를 호출 할 수 없습니다 (Python).

분류에서Dev

TypeError : print를 호출 할 때 'str'개체를 호출 할 수 없습니다.

분류에서Dev

TypeError : 'list'개체를 암시 적으로 str로 변환 할 수 없습니다.

분류에서Dev

TypeError : 파일을 읽을 때 'str'개체를 호출 할 수 없습니다.

분류에서Dev

TypeError : 'str'개체는 MySQL에서 호출 할 수 없습니다.

Related 관련 기사

  1. 1

    TypeError : 'str'및 'float'개체를 연결할 수 없습니다. : Pandas

  2. 2

    Python TypeError : 인쇄를 시도 할 때 'str'및 'int'개체를 연결할 수 없습니다.

  3. 3

    TypeError : 'str'및 'function'객체를 연결할 수 없습니다.

  4. 4

    Tkinter Label, TypeError : 'str'및 'instance'개체를 연결할 수 없습니다.

  5. 5

    TypeError : Flask의 'str'및 'float'개체를 MySQL과 연결할 수 없습니다.

  6. 6

    Python 오류 : 'str'및 'builtin_function_or_method'개체를 연결할 수 없습니다.

  7. 7

    django-selenium TypeError : 'str'개체를 호출 할 수 없습니다.

  8. 8

    Python : TypeError : 'str'과 'int'를 연결할 수 없습니다.

  9. 9

    TypeError : '<class'str '>'유형의 개체를 연결할 수 없습니다. Series 및 DataFrame obj 만 유효합니다.

  10. 10

    re.search () TypeError : 'str'및 'NoneType'객체를 연결할 수 없습니다.

  11. 11

    TypeError : scrapy.Request ()에 맞춤 URL을 배치 할 때 'str'및 'NoneType'개체를 연결할 수 없습니다.

  12. 12

    Python TypeError : 메시지의 이메일 본문 부분에서 'str'및 'list'개체를 연결할 수 없습니다.

  13. 13

    TypeError : 'str'과 'NoneType'객체를 연결할 수 없습니다 .python BS4

  14. 14

    형식 오류는 'str'및 'ErrorList'개체를 연결할 수 없습니다.

  15. 15

    TypeError : str에 바이트를 연결할 수 없습니다.

  16. 16

    Python str () : TypeError : 'str'객체를 호출 할 수 없습니다-중지 코드

  17. 17

    TypeError : 'str'객체는 Python을 통해 Selenium을 사용하여 호출 할 수 없습니다.

  18. 18

    TypeError : 'str'객체는 Python을 통해 Selenium을 사용하여 호출 할 수 없습니다.

  19. 19

    Python에서 str과 int를 연결할 수 없습니다.

  20. 20

    Python / Pygame TypeError : 'str'객체는 호출 할 수 없습니다.

  21. 21

    Python 3.4 : TypeError : 'str'객체는 호출 할 수 없습니다.

  22. 22

    TypeError : 'str'객체는 호출 할 수 없습니다-Python

  23. 23

    TypeError 'str'객체는 호출 할 수 없습니다-Python

  24. 24

    xml에 디렉터리 목록- 'str'및 'NoneType'개체를 연결할 수 없습니다. 처리 방법?

  25. 25

    for 루프 내에서 열린 상태에서 TypeError : 'str'개체를 호출 할 수 없습니다 (Python).

  26. 26

    TypeError : print를 호출 할 때 'str'개체를 호출 할 수 없습니다.

  27. 27

    TypeError : 'list'개체를 암시 적으로 str로 변환 할 수 없습니다.

  28. 28

    TypeError : 파일을 읽을 때 'str'개체를 호출 할 수 없습니다.

  29. 29

    TypeError : 'str'개체는 MySQL에서 호출 할 수 없습니다.

뜨겁다태그

보관