Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Mr.wang
    @Contentment
    image.png
    image.png
    @luciano-renzi why?
    ironexmaiden
    @ironexmaiden
    @luciano-renzi Problem still exists i have tried this with several solution but I must refer that this process is running on jenkins system with root as user
    OS:4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux python3 version 3.5.2 python2 version 2.7.12
    Mr.wang
    @Contentment
    27.0.0.1 - - [12/Jul/2019 15:23:46] "POST /new_project/ HTTP/1.1" 404 -
    127.0.0.1 - - [12/Jul/2019 15:23:49] "GET /static/js/external/toastr.js.map HTTP/1.1" 404 -
    Luciano Renzi
    @luciano-renzi
    @ironexmaiden @Contentment please submit a ticket with reproducible steps, read the guide: https://github.com/golemhq/golem/blob/master/CONTRIBUTING.md#submitting-a-bug thanks
    Jamil Abu Shehadeh
    @Jshehadeh

    Hey guys,
    Anyone knows how to repeat the same action in range loop?

    I tried to to it using a CSV and its keep opening new session for the CSV.

    @luciano-renzi any thoughts?
    Meghrikyan
    @Meghrikyan
    @Jshehadeh HI, you can create a function and put your code there. 1. Create PY file in pages. 2. Create function in that file with any code you want to execute. 3. import following file, as it is done for any POM file (add name of file in pages [])
    I suggest to not mess the test scenario with FOR cycles. It is better to create a function for that, and pass the list to that function
    Jamil Abu Shehadeh
    @Jshehadeh
    @Meghrikyan could you please provide an example of this?
    Meghrikyan
    @Meghrikyan
    @Jshehadeh here is - how to use pages: https://golem-framework.readthedocs.io/en/latest/pages.html
    there you can create your own function with for loop. The you can use it in your test case
    Meghrikyan
    @Meghrikyan
    for_loop_in_pages.png
    Ben Harold
    @benharold
    Is it possible to pass data between tests? I tried store_secret('key', 'value') and get_secrets().key but this only appears to work in a single test case.
    Meghrikyan
    @Meghrikyan
    @benharold - If it is constant value, you can use environments json, to keep info there.
    Meghrikyan
    @Meghrikyan
    -If you get info from one test case and want to pass it to another one, use proxy files:
    1. Create "data" temporary folder
    2. For each type of value use one file to as an exchange place.
    3. In "pages" folder create necessary functions to put and get those values in files
    Ben Harold
    @benharold
    okay, that makes sense. thanks
    Luciano Renzi
    @luciano-renzi
    @benharold There is no built-in method to share data between tests because when running in parallel there's no shared memory between tests (it uses multiprocessing). @Meghrikyan offers a few great solutions
    Dana Schwehr
    @dana-schwehr
    Hi there, I was wondering if there's going to be any support for error handling. I've been starting up some tests recently, and found that try/except statements seem to break the interface
    Luciano Renzi
    @luciano-renzi
    Hi @dana-schwehr, there is error handling, a test that raises AssertionError ends in 'failure' and a test that raises any other exception ends in 'code error'. Try/except works within the test function or any function called from the test function. If you share an example of what you are trying to achieve I can take a look
    Dana Schwehr
    @dana-schwehr

    Sure! The problem arises in the GUI when I have a test with a try/except block in it. I get this stack trace in the test's Preview view:
    File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2463, in __call__ return self.wsgi_app(environ, start_response) File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2449, in wsgi_app response = self.handle_exception(e) File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1866, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise raise value File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise raise value File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/usr/local/lib/python3.7/site-packages/flask_login/utils.py", line 261, in decorated_view return func(*args, **kwargs) File "/usr/local/lib/python3.7/site-packages/golem/gui/gui_utils.py", line 217, in wrapper return func(*args, **kwargs) File "/usr/local/lib/python3.7/site-packages/golem/gui/gui_utils.py", line 240, in wrapper return func(*args, **kwargs) File "/usr/local/lib/python3.7/site-packages/golem/gui/web_app.py", line 135, in test_case_view test_components=test.components, File "/usr/local/lib/python3.7/site-packages/golem/core/test.py", line 290, in components 'steps': self.steps File "/usr/local/lib/python3.7/site-packages/golem/core/test.py", line 263, in steps steps['test'] = test_parser.parse_function_steps(test_function) File "/usr/local/lib/python3.7/site-packages/golem/core/test_parser.py", line 51, in parse_function_steps if _code_block_is_function_call(block): File "/usr/local/lib/python3.7/site-packages/golem/core/test_parser.py", line 147, in _code_block_is_function_call parsed = ast.parse(block.lstrip()) File "/usr/local/lib/python3.7/ast.py", line 35, in parse return compile(source, filename, mode, PyCF_ONLY_AST) File "<unknown>", line 4 send_keys("8d16e63f-c625-4f02-8d71-67804bd91d1c") ^ SyntaxError: unexpected EOF while parsing

    I can view and run the code fine from the command line, and from the code view, it's just the preview that's messed up. If I have the same code with the try/except statements removed, then it shows up fine. We have been having some weird results in some tests, so we are trying to write tests that end in failure or success, so try/except handling would be nice.

    Zeeshan
    @zeeshanyshaikh
    Hi...is there any way to write custom functions?
    Luciano Renzi
    @luciano-renzi
    @dana-schwehr I confirmed this is a bug in the test parser, golemhq/golem#186
    @zeeshanyshaikh yes, you can write functions inside pages, check out https://golem-framework.readthedocs.io/en/latest/pages.html
    Zeeshan
    @zeeshanyshaikh
    @luciano-renzi thanks.
    Dana Schwehr
    @dana-schwehr
    @luciano-renzi Cool, thank you for looking into that!
    Zeeshan
    @zeeshanyshaikh

    @luciano-renzi how to get project path from page functions? am using

    import os
    ROOT_DIR = os.path.abspath(os.curdir)

    and am getting golem directory path not the project path

    Zeeshan
    @zeeshanyshaikh
    image.png
    get_element_text, get_element_attribute, get_element_value
    does not show element field on gui
    Zeeshan
    @zeeshanyshaikh
    where to check printed text? (used via print of python)...i can't see in logs
    Zeeshan
    @zeeshanyshaikh

    get_element_text, get_element_attribute, get_element_value

    does not print anything in the logs

    Zeeshan
    @zeeshanyshaikh

    finally worked with this

    from golem import execution
    execution.logger.info("this text needs to be printed")

    There should be some method to print the text. Not sure why python print() is not working

    Luciano Renzi
    @luciano-renzi

    how to get project path from page functions?

    One way would be:

    import os
    from golem import execution
    
    project_path = os.path.join(execution.testdir, 'projects', execution.project)

    I'll add this value to the execution module so it's not required to be generated

    Luciano Renzi
    @luciano-renzi

    get_element_text, get_element_attribute, get_element_value does not show element field on gui

    This is a bug, food find! :thumbsup:

    Luciano Renzi
    @luciano-renzi

    get_element_text, get_element_attribute, get_element_value does not print anything in the logs

    Yes, they don't log anything, but you could print the returned value: print(get_element_text('.my-element'))

    They should probably log the values found

    Zeeshan
    @zeeshanyshaikh
    @luciano-renzi print() does not show any value... i tried with basic text print and the examples given in document. None of them were shown in logs
    print("Test comment")
    
    from golem import actions
    print(actions.get_browser().title)
    Luciano Renzi
    @luciano-renzi
    got it, yes, print only outputs to the console and not to the log files. I can add a new action log(message, level='INFO')
    Zeeshan
    @zeeshanyshaikh
    Thanks @luciano-renzi. what will be the ETA for this? shall i raise issue on github?
    Luciano Renzi
    @luciano-renzi
    I already fixed the missing inputs on the gui, I also added the 'log' action. This is going to be out in the next minor version
    Zeeshan
    @zeeshanyshaikh
    Thanks @luciano-renzi
    aloknag
    @aloknag
    Hey guys, I am trying golem out and it looks cool.
    though in my first test case, I am seeing 'Internal Server Error' in gui, if I use xpath to find element.
    from golem import actions description = 'Register a new user to Mercury Tours' ... Skipped... def test(data): browser = actions.get_browser() actions.verify_title_contains('Welcome: Mercury Tours') element = browser.find_element_by_xpath("//a[contains(text(),'REGISTER')]") actions.click(element) ...Skipped...
    Luciano Renzi
    @luciano-renzi

    There's not much I can tell without the full trace but I think the issue is that you are using the original Selenium find method: find_element_by_xpath.

    With Golem you should use browser.find and browser.find_all:

    https://golem-framework.readthedocs.io/en/latest/golem_public_api/webdriver-class.html#find-args-kwargs-small-golem-small

    https://golem-framework.readthedocs.io/en/latest/finding-elements.html#find

    shchokin
    @shchokin

    Hello, guys. I have the following issue. My test stars in Chrome browser with the "Chrome is being controlled by automated test software" message on the top of page
    I try to remove this info-bar. I found solution for python, but I don't know how use this with Golem's syntax.

    chrome_options = webdriver.ChromeOptions()
    chrome_options.add_experimental_option("excludeSwitches", ['enable-automation'])
    driver = webdriver.Chrome(options=chrome_options)

    Could you please help rewrite this code or suggest another solution? Thanks in advance!

    Meghrikyan
    @Meghrikyan
    Hi Artyom, if i am not mistaken, chrome_options are available when you use "remote Selenium grid". Documentation Chapter 3.13 - settings.json
    shchokin
    @shchokin
    I don't use remote Selenium grid in my cases. I tried set chrome options using set_browser_capability("excludeSwitches", ['enable-automation']) as well but it did not help
    Luciano Renzi
    @luciano-renzi
    yeah, currently there aren't a lot of ways to control how the browser starts
    Luciano Renzi
    @luciano-renzi