Thanks for responding.
I cannot still initiate the application with automation. Kindly, help me out of this:
Error:
Traceback (most recent call last):
File “D:\appiumPython\tests\demo3.py”, line 20, in
driver = webdriver.Remote(command_executor=appium_server_url, options=appium_options.load_capabilities((capabilities)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “D:\appiumPython.venv\Lib\site-packages\appium\webdriver\webdriver.py”, line 229, in init
super().init(
File “D:\appiumPython.venv\Lib\site-packages\selenium\webdriver\remote\webdriver.py”, line 209, in init
self.start_session(capabilities)
File “D:\appiumPython.venv\Lib\site-packages\appium\webdriver\webdriver.py”, line 321, in start_session
response = self.execute(RemoteCommand.NEW_SESSION, w3c_caps)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “D:\appiumPython.venv\Lib\site-packages\selenium\webdriver\remote\webdriver.py”, line 348, in execute
self.error_handler.check_response(response)
File “D:\appiumPython.venv\Lib\site-packages\selenium\webdriver\remote\errorhandler.py”, line 229, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
My Code:
import time
from appium import webdriver
from appium.webdriver.common.appiumby import AppiumBy # Updated import statement
capabilities = {
“appium:platformName”: “Android”,
“appium:deviceName”: “Pixel 7 Pro”,
“appium:app”: “D://appiumPython//Applications//facebook.apk”,
“appium:automationName”: “UiAutomator2”,
“appium:fullReset”: True,
“appium:uiautomator2ServerInstallTimeout”: 60000
}
appium_server_url = ‘http://127.0.0.1:4723/wd/hub’
Initialize AppiumOptions and add capabilities
appium_options = webdriver.webdriver.AppiumOptions()
Initialize the driver with the AppiumOptions
driver = webdriver.Remote(command_executor=appium_server_url, options=appium_options.load_capabilities((capabilities)))
driver.find_element(AppiumBy.ACCESSIBILITY_ID, “Media”).click() # Updated usage of AppiumBy
time.sleep(3)
audioFxText = driver.find_element(AppiumBy.ACCESSIBILITY_ID, “AudioFx”).text # Updated usage of AppiumBy
assert audioFxText == “AudioFx”
driver.quit()