Skip to content

How to verify file download in automation test in UnitTest on LambdaTest

Notifications You must be signed in to change notification settings

LambdaTest/UnitTest-verify-download

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

How to verify file download in automation test in UnitTest on LambdaTest

If you want to verify file download in automation test in UnitTest on LambdaTest, you can follow the below steps. You can refer to sample test repo here.

Steps:

Step 1: Add test case

You can use the following testcase to verify download in automation test:

def test_verify_download(self):
		# try:
		driver = self.driver
		driver.get('https://chromedriver.storage.googleapis.com/index.html?path=79.0.3945.36/')
		driver.maximize_window()
		sleep(2)
		driver.find_element_by_xpath("/html/body/table/tbody/tr[]/td[2]/a").click()
		sleep(5)
		if(driver.execute_script("lambda-file-exists=chromedriver_win32.zip") == True):
			driver.execute_script("lambda-status=passed")
			print("Tests are run successfully!")
		else:
			driver.execute_script("lambda-status=failed")

Step 2: Run your test

python lambdatest_test.py

Links:

LambdaTest Community

About

How to verify file download in automation test in UnitTest on LambdaTest

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages