Embed presentation
Downloaded 12 times



































![self.wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, div.gs-disclaimer')))div = self.driver.find_element_by_css_selector('div.gs-disclaimer')agree_button = div.find_element_by_css_selector('button[data-gs-handler=agree]')agree_button.click()](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2ftestingwebapplication-160624130548%2f75%2fTesting-web-application-with-Python-36-2048.jpg&f=jpg&w=240)

![menu_button = self.driver.find_element_by_css_selector('div.test-menu-button button[data-gs-handler=menu]')menu_button.click()login_item = case.driver.find_element_by_css_selector('ul.gs-main-menu li button ...')login_button = login_item.find_element_by_xpath('..')login_button.click()](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2ftestingwebapplication-160624130548%2f75%2fTesting-web-application-with-Python-38-2048.jpg&f=jpg&w=240)

![user_input = loginform.find_element_by_css_selector('input[name=login_username]')passwd_input = loginform.find_element_by_css_selector('input[name=login_password]')submit_button = loginform.find_element_by_css_selector('button[data-gs-handler=submit]')user_input.send_keys(login_username)passwd_input.send_keys(login_password)submit_button.click()](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2ftestingwebapplication-160624130548%2f75%2fTesting-web-application-with-Python-40-2048.jpg&f=jpg&w=240)










![======================================================================ERROR: test_datagrid (tests.map_application.servers.TestBranchComplex)Test gs.module.Datagrid----------------------------------------------------------------------Traceback (most recent call last):File "tests/map_application/__init__.py", line 153, in test_datagriddatagrid.test(self, True)File "tests/map_application/modules/datagrid.py", line 20, in testls_show_module(case, 'datagrid', layer_id)File "tests/map_application/modules/layerswitcher.py", line 169, in show_modulemodule_button.click()File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webelement.py", line 75, in clickself._execute(Command.CLICK_ELEMENT)File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webelement.py", line 469, in _executereturn self._parent.execute(command, params)File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 201, in executeself.error_handler.check_response(response)File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_responseraise exception_class(message, screen, stacktrace)StaleElementReferenceException: Message: {"errorMessage":"Element is no longer attached to the DOM","request":{"headers":{"Accept":"application/json","Accept-Encoding":"identity","Connection":"close","Content-Length":"81","Content-Type":"application/json;charset=UTF-8","Host":"127.0.0.1:46272","User-Agent":"Python-urllib/2.7"},"httpVersion":"1.1","method":"POST","post":"{"sessionId": "89569f10-33c8-11e6-bee5-bb4fe1c88b42", "id": ":wdc:1466084714415"}","url":"/click","urlParsed":{"anchor":"","query":"","file":"click","directory":"/","path":"/click","relative":"/click","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/click","queryKey":{},"chunks":["click"]},"urlOriginal":"/session/89569f10-33c8-11e6-bee5-bb4fe1c88b42/element/:wdc:1466084714415/click"}}Screenshot: available via screen](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2ftestingwebapplication-160624130548%2f75%2fTesting-web-application-with-Python-51-2048.jpg&f=jpg&w=240)





Testing web mapping applications and services using Python provides concise summaries in 3 sentences or less:The document discusses using Python for testing web mapping applications and services, including unit, integration, and system testing. It provides an example of using Selenium to test a web map application, writing tests to interact with elements and assert expected behavior. Implementing tests in Python makes the process easy and allows new programmers to get involved, helping to catch bugs and improve software quality.



































![self.wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, div.gs-disclaimer')))div = self.driver.find_element_by_css_selector('div.gs-disclaimer')agree_button = div.find_element_by_css_selector('button[data-gs-handler=agree]')agree_button.click()](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2ftestingwebapplication-160624130548%2f75%2fTesting-web-application-with-Python-36-2048.jpg&f=jpg&w=240)

![menu_button = self.driver.find_element_by_css_selector('div.test-menu-button button[data-gs-handler=menu]')menu_button.click()login_item = case.driver.find_element_by_css_selector('ul.gs-main-menu li button ...')login_button = login_item.find_element_by_xpath('..')login_button.click()](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2ftestingwebapplication-160624130548%2f75%2fTesting-web-application-with-Python-38-2048.jpg&f=jpg&w=240)

![user_input = loginform.find_element_by_css_selector('input[name=login_username]')passwd_input = loginform.find_element_by_css_selector('input[name=login_password]')submit_button = loginform.find_element_by_css_selector('button[data-gs-handler=submit]')user_input.send_keys(login_username)passwd_input.send_keys(login_password)submit_button.click()](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2ftestingwebapplication-160624130548%2f75%2fTesting-web-application-with-Python-40-2048.jpg&f=jpg&w=240)










![======================================================================ERROR: test_datagrid (tests.map_application.servers.TestBranchComplex)Test gs.module.Datagrid----------------------------------------------------------------------Traceback (most recent call last):File "tests/map_application/__init__.py", line 153, in test_datagriddatagrid.test(self, True)File "tests/map_application/modules/datagrid.py", line 20, in testls_show_module(case, 'datagrid', layer_id)File "tests/map_application/modules/layerswitcher.py", line 169, in show_modulemodule_button.click()File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webelement.py", line 75, in clickself._execute(Command.CLICK_ELEMENT)File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webelement.py", line 469, in _executereturn self._parent.execute(command, params)File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 201, in executeself.error_handler.check_response(response)File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_responseraise exception_class(message, screen, stacktrace)StaleElementReferenceException: Message: {"errorMessage":"Element is no longer attached to the DOM","request":{"headers":{"Accept":"application/json","Accept-Encoding":"identity","Connection":"close","Content-Length":"81","Content-Type":"application/json;charset=UTF-8","Host":"127.0.0.1:46272","User-Agent":"Python-urllib/2.7"},"httpVersion":"1.1","method":"POST","post":"{"sessionId": "89569f10-33c8-11e6-bee5-bb4fe1c88b42", "id": ":wdc:1466084714415"}","url":"/click","urlParsed":{"anchor":"","query":"","file":"click","directory":"/","path":"/click","relative":"/click","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/click","queryKey":{},"chunks":["click"]},"urlOriginal":"/session/89569f10-33c8-11e6-bee5-bb4fe1c88b42/element/:wdc:1466084714415/click"}}Screenshot: available via screen](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2ftestingwebapplication-160624130548%2f75%2fTesting-web-application-with-Python-51-2048.jpg&f=jpg&w=240)



