# -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.common.action_chains import ActionChains
import time, unittest

def is_alert_present(wd):
    try:
        wd.switch_to_alert().text
        return True
    except:
        return False

class test_add_group(unittest.TestCase):
    def setUp(self):
        self.wd = WebDriver()
        self.wd.implicitly_wait(60)
    
    def test_test_add_group(self):
        success = True
        wd = self.wd
        wd.get("http://192.168.10.214/addressbook/index.php")
        wd.find_element_by_name("user").click()
        wd.find_element_by_name("user").clear()
        wd.find_element_by_name("user").send_keys("admin")
        wd.find_element_by_name("pass").click()
        wd.find_element_by_name("pass").send_keys("\\undefined")
        wd.find_element_by_xpath("//form[@id='LoginForm']/input[3]").click()
        wd.find_element_by_link_text("groups").click()
        wd.find_element_by_name("new").click()
        wd.find_element_by_name("group_name").click()
        wd.find_element_by_name("group_name").clear()
        wd.find_element_by_name("group_name").send_keys("python_test_group")
        wd.find_element_by_name("group_header").click()
        wd.find_element_by_name("group_header").clear()
        wd.find_element_by_name("group_header").send_keys("python_test_group_Logo")
        wd.find_element_by_name("group_footer").click()
        wd.find_element_by_name("group_footer").clear()
        wd.find_element_by_name("group_footer").send_keys("python_test_group_Comment")
        wd.find_element_by_name("submit").click()
        wd.find_element_by_link_text("group page").click()
        wd.find_element_by_link_text("Logout").click()
        self.assertTrue(success)
    
    def tearDown(self):
        self.wd.quit()

if __name__ == '__main__':
    unittest.main()

@@ -164,16 +164,17 @@
 ittest%0A%0A
+%0A
 def is_a
@@ -288,16 +288,17 @@
  False%0A%0A
+%0A
 class te
@@ -379,16 +379,50 @@
 bDriver(
+capabilities=%7B%22marionette%22: False%7D
 )%0A      
@@ -641,233 +641,84 @@
 r%22).
-click()%0A        wd.find_element_by_name(%22user%22).clear()%0A        wd.find_element_by_name(%22user%22).send_keys(%22admin%22)%0A        wd.find_element_by_name(%22pass%22).click()%0A        wd.find_element_by_name(%22pass%22).send_keys(%22%5C%5Cundefined
+send_keys(%22admin%22)%0A        wd.find_element_by_name(%22pass%22).send_keys(%22secret
 %22)%0A 
@@ -754,14 +754,12 @@
 th(%22
+.
 //
-form
+*
 %5B@id
@@ -782,9 +782,22 @@
 put%5B
-3
+@value='Login'
 %5D%22).
@@ -956,453 +956,121 @@
 e%22).
-click()%0A        wd.find_element_by_name(%22group_name%22).clear()%0A        wd.find_element_by_name(%22group_name%22).send_keys(%22python_test_group%22)%0A        wd.find_element_by_name(%22group_header%22).click()%0A        wd.find_element_by_name(%22group_header%22).clear()%0A        wd.find_element_by_name(%22group_header%22).send_keys(%22python_test_group_Logo%22)%0A        wd.find_element_by_name(%22group_footer%22).click()%0A        wd.find_element_by_name(%22group_footer%22).clear(
+send_keys(%22python_test_group%22)%0A        wd.find_element_by_name(%22group_header%22).send_keys(%22python_test_group_Logo%22
 )%0A  

add capabilities, remove unused code