Tarun
Katalon Apprentice
01/12/2018

How To open Dev tools in katalon after i place my project Url in Browser? and perform execution

Hi 

Due to budget constraints ,my company wants to execute katalon scripts which are developed using desktop to be executed in Chrome mobile version using Dev Tools
.My question is 
1)How can i open Dev tools in katalon after i place my project Url in Browser?and perform execution in Mobile mode of chrome
2)Locators which are used in script,will it be compatible in Mobile version of chrome?

Here is my dekstop version of code

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.checkpoint.CheckpointFactory as CheckpointFactory
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testcase.TestCaseFactory as TestCaseFactory
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testdata.TestDataFactory as TestDataFactory
import com.kms.katalon.core.testobject.ObjectRepository as ObjectRepository
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSBuiltInKeywords
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.JavascriptExecutor as JavascriptExecutor
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
import com.kms.katalon.core.webui.common.WebUiCommonHelper as WebUiCommonHelper
import org.openqa.selenium.Keys as Keys

for (def index : (1..27)) {
    WebUI.openBrowser('')

    WebUI.maximizeWindow()

    WebUI.navigateToUrl('http://172.16.81.78/timetrax/#/login')
    
    WebUI.sendKeys(findTestObject('TimeTraxUserLogin/Page_TimeTraxUi/input_userName'), findTestData('Excel Data source/Timesheet_input_data').getValue(
            1, 4))

    WebUI.sendKeys(findTestObject('TimeTraxUserLogin/Page_TimeTraxUi/input_passWord'), findTestData('Excel Data source/Timesheet_input_data').getValue(
            2, 4))

    WebUI.click(findTestObject('TimeTraxUserLogin/Page_TimeTraxUi/button_Sign In'))

    WebUI.click(findTestObject('EmployeeClick/Page_About Screen/span_TimeEntries'))

    WebUI.delay(5)

    WebUI.click(findTestObject('EmployeeClick/Page_User Screen/span_TimeSheet'))

    WebUI.doubleClick(findTestObject('TimeSheet/ModalSection/TS_MS_Btn_PlusSign'))

    WebUI.delay(3)

    WebUI.sendKeys(findTestObject('TimeSheet/ModalSection/TS_MS_Txt_Employee'), findTestData('Excel Data source/Timesheet_input_data').getValue(
            3, 4))

    WebUI.delay(1)

    WebUI.click(findTestObject('TimeSheet/ModalSection/TS_MS_Btn_ClickEmployeeAutoComplete'))

    WebUI.click(findTestObject('TimeSheet/ModalSection/TS_MS_DD_EmployeeRemoveDropDown'))

    WebUI.sendKeys(findTestObject('TimeSheet/ModalSection/TS_MS_Date_WorkDate'), findTestData('Excel Data source/Timesheet_input_data').getValue(
            14, index))

    WebUI.delay(1)

    WebUI.waitForElementClickable(findTestObject('TimeSheet/ModalSection/TS_MS_DD_selectWorkGroup'), 3)

    WebUI.click(findTestObject('TimeSheet/ModalSection/TS_MS_DD_selectWorkGroup'))

    WebUI.selectOptionByLabel(findTestObject('TimeSheet/ModalSection/TS_MS_DD_selectWorkGroup'), findTestData('Excel Data source/Timesheet_input_data').getValue(
            10, 4), false)

    WebUI.delay(1)

    WebUI.click(findTestObject('TimeSheet/ModalSection/TS_MS_DD_PositionToRemoveDependentDropDown'))

    WebUI.waitForElementClickable(findTestObject('TimeSheet/ModalSection/TS_MS_Txt_Position'), 3)

    WebUI.click(findTestObject('TimeSheet/ModalSection/TS_MS_Txt_Position'))

    WebUI.selectOptionByLabel(findTestObject('TimeSheet/ModalSection/TS_MS_Txt_Position'), findTestData('Excel Data source/Timesheet_input_data').getValue(
            6, 4), false)

    WebUI.waitForElementClickable(findTestObject('TimeSheet/ModalSection/TS_MS_DD_PayCategory'), 3)

    WebUI.click(findTestObject('TimeSheet/ModalSection/TS_MS_DD_PayCategory'))

    WebUI.selectOptionByLabel(findTestObject('TimeSheet/ModalSection/TS_MS_DD_PayCategory'), findTestData('Excel Data source/Timesheet_input_data').getValue(
            7, 1), false)

    WebUI.sendKeys(findTestObject('TimeSheet/ModalSection/TS_MS_Date_StartDate'), findTestData('Excel Data source/Timesheet_input_data').getValue(
            14, index))

    WebUI.sendKeys(findTestObject('TimeSheet/ModalSection/TS_MS_Date_StartTime'), findTestData('Excel Data source/Timesheet_input_data').getValue(
            18, 1))

    WebUI.sendKeys(findTestObject('TimeSheet/ModalSection/TS_MS_Date_EndDate'), findTestData('Excel Data source/Timesheet_input_data').getValue(
            14, index))

    WebUI.sendKeys(findTestObject('TimeSheet/ModalSection/TS_MS_Date_EndTime'), findTestData('Excel Data source/Timesheet_input_data').getValue(
            18, 2))

    WebUI.sendKeys(findTestObject('TimeSheet/ModalSection/TS_MS_Txt_comments'), 'Project B')

    WebUI.doubleClick(findTestObject('TimeSheet/SearchSection/TS_MS_Btn_ClickSave'))

    WebUI.rightClick(findTestObject('TimeSheet/SearchSection/TS_MS_Btn_ClickSave'))

    WebUI.waitForElementAttributeValue(findTestObject('TimeSheet/SearchSection/TS_MS_Date_SearchWorkDate'), 'Error', 'Saved', 
        5)

    WebUI.click(findTestObject('TimeSheet/SearchSection/TS_MS_DD_Status'))

    WebUI.selectOptionByLabel(findTestObject('TimeSheet/SearchSection/TS_MS_DD_Status'), 'Saved', false)

    WebUI.waitForElementPresent(findTestObject('TimeSheet/SearchSection/TS_MS_Date_SearchWorkDate'), 3)

    WebUI.click(findTestObject('TimeSheet/SearchSection/TS_MS_Date_SearchWorkDate'), FailureHandling.STOP_ON_FAILURE)

    WebUI.sendKeys(findTestObject('TimeSheet/SearchSection/TS_MS_Date_SearchWorkDate'), findTestData('Excel Data source/Timesheet_input_data').getValue(
            14, index))

    WebUI.waitForElementHasAttribute(findTestObject('TimeSheet/SearchSection/TS_MS_DD_ViewType'), 'Employee', 1)

    WebUI.click(findTestObject('TimeSheet/SearchSection/TS_MS_DD_ViewType'))

    WebUI.selectOptionByLabel(findTestObject('TimeSheet/SearchSection/TS_MS_DD_ViewType'), 'Employee', false)

    WebUI.waitForElementClickable(findTestObject('TimeSheet/SearchSection/TS_MS_Btn_Employee'), 5)

    WebUI.sendKeys(findTestObject('TimeSheet/SearchSection/TS_MS_Btn_Employee'), findTestData('Excel Data source/Timesheet_input_data').getValue(
            3, 4))

    WebUI.delay(1)

    WebUI.click(findTestObject('TimeSheet/ModalSection/TS_MS_Btn_ClickEmployeeAutoComplete'))

    WebUI.waitForElementPresent(findTestObject('TimeSheet/SearchSection/TS_MS_Btn_ClickSearch'), 1)

    WebUI.click(findTestObject('TimeSheet/SearchSection/TS_MS_Btn_ClickSearch'))

    WebUI.delay(2)

    WebUI.waitForElementClickable(findTestObject('TimeSheet/SearchSection/TS_MS_Btn_ClickSubmit'), 1)

    WebUI.doubleClick(findTestObject('TimeSheet/SearchSection/TS_MS_Btn_ClickSubmit'))

    WebUI.rightClick(findTestObject('TimeSheet/SearchSection/TS_MS_Btn_ClickSubmit'))

    WebUI.delay(2)

    WebUI.closeBrowser()
}


Tagged:
Upvote
Quote
Sign In or Register to comment.