1

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)
  • Have already tried the solution given in the duped link , but still facing the issue. – Chiranjib Goswami Apr 15 '19 at 05:23
  • Have resolved the issue: device_names = self.driver.find_elements_by_css_selector(self.e_css_device_name) for device_name in device_names: if device_name.is_displayed(): self.driver.execute_script("arguments[0].scrollIntoView(false);", device_name) device_name.click() device_name.clear() device_name.send_keys(str(self.device_name)) time.sleep(2) – Chiranjib Goswami Apr 15 '19 at 11:13

0 Answers0