Requirement: Need to automate WebUi of a server where , multiple device needs to be added.
Problem : While adding device , each time a popup window will open where i need to add device details. Could able to add 1st device but for for 2nd device i am facing an error :
"WIRELESS-ERROR: Message: Element "input class="default-input" type="search"" could not be scrolled into view"
Have checked the elements , and all remain same for every device add popup window.
I am using css selector , snippet of code:
self.e_css_device_name = "#addDeviceTab ._deviceNameRow ._deviceName input"
try:
#click to Add -----------------------------------------------------------------
add_device = self.driver.find_element_by_css_selector(self.e_css_add_device)
try:
ActionChains(self.driver).move_to_element(add_device).perform()
except Exception as e:
self.driver.execute_script("arguments[0].scrollIntoView(false);", add_device)
add_device.click()
time.sleep(10)
#add details---------------------------------------------------------------
WebDriverWait(self.driver, 10, 0.1).until(
EC.presence_of_element_located((By.CSS_SELECTOR, self.e_css_device_name)))
device_name = self.driver.find_element_by_css_selector(self.e_css_device_name)
try:
ActionChains(self.driver).move_to_element(device_name).perform()
except Exception:
self.driver.execute_script("arguments[0].scrollIntoView(false);", device_name)
device_name.clear()
device_name.send_keys(str(self.device_name))
time.sleep(2)
Have also tried :
WebDriverWait(self.driver, 10).until(EC.element_to_be_clickable(
(By.CSS_SELECTOR, self.e_css_device_name)))
device_name.click()
device_name.clear()
device_name.send_keys(str(self.device_name))
time.sleep(2)