Home > database >  Unable to run testcases in pytest
Unable to run testcases in pytest

Time:01-13

I am trying to use pytest framework for testing However when i run the command from the terminal pytest test_Analysis.py -s -v it shows no test rans

Below are the snapshots for your reference.

enter image description here

Also if remove the constructor it run but gives me the error stating there is not driver attribute present

enter image description here

and if i keep the constructor it gives me an error as well below is the error for your reference.

enter image description here

CodePudding user response:

You do not need constructor method. You can follow below approach.

class TestAnalysis:
    def test_navigate_to_analysis(self, apiuum_driver):
        analysis = appium_driver.find_element(By.ID, 'id name')
        analysis.click()

Instead of using apium_fixture from pytest.mark, you can refer it explicitly from the test method.

  •  Tags:  
  • Related