from arjuna.tpi import Arjuna from arjuna.tpi.guiauto.helpers import With from commons import * init_arjuna() automator = launch_automator() login(automator) automator.element(With.link_text("Settings")).click() date_format = automator.radio_group(With.name("date_format")) print(date_format.has_value_selected("Y-m-d")) print(date_format.has_index_selected(1)) print(date_format.first_selected_option_value) date_format.select_value(r"\c\u\s\t\o\m") date_format.select_index(2) logout(automator)
from arjuna.tpi import Arjuna from arjuna.tpi.guiauto.helpers import With from commons import * init_arjuna() automator = launch_automator() login(automator) automator.element(With.link_text("Posts")).click() automator.element(With.link_text("Categories")).click() check_boxes = automator.multi_element(With.name("delete_tags[]")) check_boxes.at_index(0).uncheck() check_boxes.at_index(0).check() check_boxes.at_index(0).check() check_boxes.at_index(1).uncheck() check_boxes.first.uncheck() check_boxes.last.uncheck() check_boxes.random.uncheck() logout(automator)
from commons import * from arjuna.tpi.guiauto.helpers import With, Screen init_arjuna() automator = launch_automator() go_to_wp_home(automator) # Two identifiers. Only first one would be tried as it succeeds. element = automator.element(With.id("user_login"), With.name("log")) element.identify() print(element.source.content.root) # Two identifiers. First invalid, second valid. Hence it succeeds by using second With construct # Identification max wait time is for all With constructs clubbed together. element = automator.element(With.id("INVALID"), With.name("log")) element.identify() print(element.source.content.root) automator.quit()
from commons import * from arjuna.tpi.guiauto.helpers import With, GuiActionConfig init_arjuna() automator = launch_automator() url = automator.config.get_user_option_value("narada.ex.radio.url").as_str() automator.browser.go_to_url(url) radios = automator.radio_group(With.name("Traditional")) radios.select_index(1) # Tag mix up radios = automator.radio_group(With.name("Prob1")) radios.select_index(1) # Type mix up radios = automator.radio_group(With.name("Prob2")) radios.select_index(1) # Group mix up radios = automator.radio_group(With.class_name("Prob3")) radios.select_index(1) # state check off conf = GuiActionConfig.builder().check_pre_state(False).build() radios = automator.element(With.name("Traditional").configure(config)) radios.select_index(1) # tag mix up, state check off
from commons import * from arjuna.tpi.guiauto.helpers import With init_arjuna() automator = launch_automator() go_to_wp_home(automator) # The following code is for user name field. # Html of user name: <input type="text" name="log" id="user_login" class="input" value="" size="20"> element = automator.element(With.id("user_login")) element.identify() print(element.source.content.root) element = automator.element(With.name("log")) element.identify() print(element.source.content.root) element = automator.element(With.class_name("input")) element.identify() print(element.source.content.root) element = automator.element(With.tag_name("input")) element.identify() print(element.source.content.root) # The following options are for # Html of link: <a href="http://192.168.56.103/wp-login.php?action=lostpassword" title="Password Lost and Found">Lost your password?</a> element = automator.element(With.link_text("Lost your password?")) element.identify() print(element.source.content.root)