Skip to content

Python 3 support: NameError: 'unicode' is not defined when 'Wait Until Page Contains' text #809

Closed

Description

@Sushma-Kattinti-Bose

Python Version: 3.6.1
S2L Version: 3dca1dd

I tried to get the latest master to work with python 3.6.1, but when running the following test I get a stack trace about unicode support (something that changed between python 2 and 3):

*** Settings ***
Documentation  This is basic info about the whole suite
Library  Selenium2Library

*** Variables ***

*** Test Cases ***
User must sign in to check out
    [Documentation]  This is some basic info about the test
    [Tags]  Smoke
    Open Browser  http://www.amazon.com  chrome
    Wait Until Page Contains  Your Amazon.com
    Input Text  id=twotabsearchtextbox  Ferrari 458
    Click Button  xpath=//*[@id='nav-search']/form/div[2]/div/input
    Wait Until Page Contains  results for "Ferrari 458"
    Click Link  css=#result_0 a.s-access-detail-page
    Wait Until Page Contains  Back to search results
    Click Button  xpath=//*[@id='add-to-cart-button']
    Wait Until Page Contains  Added to Cart
    Click Link  Proceed to checkout
    Page Should Contain Element  xpath=//*[@id='hlb-ptc-btn-native']
    Sleep  3s
    Close Browser

*** Keywords ***

KEYWORD Selenium2Library . Wait Until Page Contains Your Amazon.com
Documentation:
Waits until text appears on current page.
Start / End / Elapsed: 20170522 19:18:18.463 / 20170522 19:18:24.097 / 00:00:05.634
19:18:24.097 FAIL NameError: name 'unicode' is not defined

Activity

  1. aaltat commented on May 23, 2017

    @aaltat
    Contributor

    This is actually the last thing to be fixed for the Python 3 support. The good news is that that there is a fix in my Selenium2Library fork: https://github.com/aaltat/robotframework-selenium2library/tree/python_3_support?files=1

    The unit and acceptance test did pass in my local environment and the code contains bunch of TODO comments which needs to be removed but it should work. If you want, you could give it a try and I would gladly take feedback.

  2. changed the title [-]NameError: 'unicode' is not defined when 'Wait Until Page Contains' text[/-] [+]Python 3 support: NameError: 'unicode' is not defined when 'Wait Until Page Contains' text[/+] on May 23, 2017
  3. added this to the milestone on May 23, 2017
  4. self-assigned this
    on May 23, 2017
  5. aaltat commented on May 23, 2017

    @aaltat
    Contributor

    Made a PR: #810 so that it easier to find and contains some code cleanup too.

  6. pekkaklarck commented on May 23, 2017

    @pekkaklarck
    Member

    Isn't there already an open issue about Py3? This should be closed as its dupe. And soon the original can be closed too!

  7. added a commit that references this issue on May 23, 2017
  8. aaltat commented on May 23, 2017

    @aaltat
    Contributor

    I actually thought so but could not find an open issue. Perhaps the original issue was closed... But code is merged to master and therefore closing this one too

  9. pekkaklarck commented on Sep 26, 2017

    @pekkaklarck
    Member

    #479 covers Python 3 support.

  10. removed this from the v3.0.0 milestone on Sep 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions