I want to run a selenium script on mobile devices. for
For this purpose, I am using the Browserstack website. now
Now, the problem is, I have written a script and it runs properly in web browser invocation right .but
But, when I run init for the mobile device it gives me an error. I will share
I'm sharing with you my code and my browser stack video link and also show you mythe console error I am getting. kindlyKindly look at it once and tellhelp me how we solve this query.issue?
https://drive.google.com/file/d/1HxQdZb0r0tsiw160-m7UiSMS_BdVJBl6/view?usp=sharing
https://drive.google.com/file/d/1HxQdZb0r0tsiw160-m7UiSMS_BdVJBl6/view?usp=sharing
import time
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.support.select import Select
BROWSERSTACK_URL = 'https://muhammadyousufkh1:[email protected]/wd/hub'
BROWSERSTACK_URL = 'https://muhammadyousufkh1:[email protected]/wd/hub'
desired_cap = {
"os_version" : "7.0",
"device" : "Samsung Galaxy S8",
"real_mobile" : "true", "browserstack.local" : "false" }
"real_mobile" : "true",
"browserstack.local" : "false"
}
driver = webdriver.Remote(
command_executor=BROWSERSTACK_URL,
desired_capabilities=desired_cap
)
driver.get("https://catevolution.com.au/litter-robot-3-connect.html")
time.sleep(3)
action = ActionChains(driver)
action.move_to_element(driver.find_element_by_xpath("//header//strong[contains(text(),'Litter Robot')]")).perform()
action.move_to_element(driver.find_element_by_link_text("Litter-Robot Connect")).click().perform()
dropdown = Select(driver.find_element_by_id("input-option240"))
dropdown.select_by_visible_text("Grey (SKU: LR3C-1200 )")
print("***********************Scrolled down starts***************")
for i in range(10):
time.sleep(0.5)
driver.execute_script("window.scrollBy(0,350);")
print("scrolling time: " + str(i))
print("*************************scrolling down end**********************")
time.sleep(3)
print("**************************************Scrolled up starts****************")
for i in range(10):
time.sleep(0.5)
driver.execute_script("window.scrollBy(0,-350);")
print("scrolling time: - " + str(i))
print("**************************************Scrolled up End ****************")
Error showshowing in the mobile device when a running script ;script;