automated-tests

Getting 422 error while trying to use Coveralls with GitHub actions

Getting 422 error while trying to use Coveralls with GitHub actions Question: I’m trying to set up Coveralls to work with GitHub Actions for a Python project, and although I’ve reviewed the documentation multiple times and followed all the instructions to the best of my understanding, I’m still facing the following error: Bad Response 422 …

Total answers: 1

Pywinauto Not Entering Address into Mozilla Address bar

Pywinauto Not Entering Address into Mozilla Address bar Question: app = pywinauto.Application(backend="win32").start("C:\Program Files\Mozilla Firefox\firefox.exe") app = pywinauto.Application(backend="win32").connect(title_re=’.*Mozilla Firefox’, timeout=5) dlg_spec = app.window(title="Mozilla Firefox", class_name="MozillaWindowClass") #dlg_spec.print_control_identifiers() child_window = dlg_spec.child_window(class_name="MozillaCompositorWindowClass") address_bar = child_window.child_window(control_type=’Edit’, class_name=’Edit’) address_bar.set_edit_text("https://google.com") The above script launches Mozilla Firefox window and then throws the following runtime error after about 5-10 seconds: pywinauto.timings.TimeoutError: During handling of …

Total answers: 1

How do I insert element reference in an xpath string?

How do I insert element reference in an xpath string? Question: Given a UI element reference, how do I "append" a string to it so that I can find its next sibling element of type XCUIElementTypeStaticText? The framework I am using contains a driver_helper.py file. Within that file are the find_element & find_elements methods defined …

Total answers: 3

How to read a line from text file (file containing logs) and remove timestamp IF it's there?

How to read a line from text file (file containing logs) and remove timestamp IF it's there? Question: I am writing an automated code that opens a text file and reads it line by line: if __name__ == ‘__main__’: #Argument Required: Full directory of log file for processing parser = ArgumentParser() parser.add_argument("–logDestination", dest="logDest", help="Provide the …

Total answers: 1

Check that function return types match the def statements in PR test in python

Check that function return types match the def statements in PR test in python Question: I have a Github Action that runs unit tests on each Pull Request (PR). It effectively runs pytest. Seeing that we leverage the type hints introduced in PEP 484, I’d like a method like this to cause a PR check …

Total answers: 1

Python function not failing and returning none

Python function not failing and returning none Question: I am writing robot test cases with python functions. I have a python function like this def ParseJSONUserData(jsonstring): if len(jsonstring) == 0: print("String is empty. No processing is possible.") json_dict = json.loads(jsonstring) if len(json_dict) == 0: print("No data found in file.") currentdt = json_dict[CURRENTDATETIME] if len(currentdt) == …

Total answers: 1

How can I run several test files with Pytest?

How can I run several test files with Pytest? Question: I have a pytest project and a want to run tests from TWO python files. The project structure looks like this: at the root of the project there is a "tests" folder, it contains several folders "test_api1", "test_api2", "test_api3", each of them contains conftest.py and …

Total answers: 1

What are some reasons Selenium wouldn't find an Element?

What are some reasons Selenium wouldn't find an Element? Question: I’m writing an automated test for a Web-based application that’s coded in JavaScript and uses the Dojo framework. I can find the elements I want the bot to find in Developer Tools using well-defined XPATHS, but the automated test fails to find the text the …

Total answers: 1

Requests-html can I get status codes of all requests (or selenium alternative)

Requests-html can I get status codes of all requests (or selenium alternative) Question: I have the following code: from requests_html import HTMLSession ses = HTMLSession() r = ses.get(MYURL) # start a headless chrome browser and load MYURL r.render(keep_page=True) # This will now ‘render’ the html page # which means like in a real browser trigger …

Total answers: 2

I can't run a simple test in RIDE (ROBOT FRAMEWORK)

I can't run a simple test in RIDE (ROBOT FRAMEWORK) Question: I was trying to run a test I wrote in RIDE IDE I’m using SelenuimLibrary and i’m trying to open the Linkedin login page Here is the code below Library Selenium2Library *** Variables *** ${Username} [email protected] ${Password} wrongpass ${Browser} Firefox ${SiteUrl} http://www.linkedin.com ${DashboardTitle} World’s …

Total answers: 2