mardi 24 avril 2018

For Looping doesn't change variables in Katalon Studio

I'm making a script . And I'm having issues with the Loop. On pastebin it's index(0..0), i've tried countless combinations and whatever i do i cannot make the loop change variables.

One of the combinations i tried was (int i=0; i<=3; i++) but this made the loop run 3 times with one variable and then start over from the very beginning with the next variable.

Any Help is appreciated

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.Keys as Keys

WebUI.openBrowser('')

WebUI.delay(10)

WebUI.navigateToUrl('https://my.pcloud.com/')

WebUI.setText(findTestObject('Page_pCloud  Log in/input_email'), 'wraithmarketing@gmail.com', FailureHandling.CONTINUE_ON_FAILURE)

WebUI.setText(findTestObject('Page_pCloud  Log in/input_password'), 'password', FailureHandling.CONTINUE_ON_FAILURE)

WebUI.click(findTestObject('Page_pCloud  Log in/button_Log in'), FailureHandling.CONTINUE_ON_FAILURE)

WebUI.delay(5)

WebUI.navigateToUrl('https://toolbox.seositecheckup.com/user/login')

WebUI.setText(findTestObject('Page_Login to SEO Site Checkup (2)/input_email'), 'sukkajikka@tutye.com')

WebUI.setText(findTestObject('Page_Login to SEO Site Checkup (2)/input_password'), 'password')

WebUI.delay(2)

WebUI.click(findTestObject('seologinbutt/button_Log In'))

WebUI.click(findTestObject('Page_Dashboard  SEO Site Checkup (2)/big_SEO Checkup'))

WebUI.delay(2)

for (def index : (0..0)) {
    WebUI.navigateToUrl('https://toolbox.seositecheckup.com/apps/seo-checkup')

    WebUI.delay(3)

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/strong_ Edit Checkup Factors'))

    WebUI.delay(3)

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/input_selectItemfactors'))

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/input_selectItemfactors'))

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/input_selectItemfactors'))

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/input_selectItemfactors'))

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/label_Robots.txt Test'))

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/label_Sitemap Test'))

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/label_Deprecated HTML Tags'))

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/label_Google Analytics Test'))

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/label_JS Error Checker'))

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/label_Social Media Check'))

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/label_HTML Page Size Test'))

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/label_HTML CompressionGZIP Tes'))

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/label_Site Loading Speed Test'))

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/label_Flash Test'))

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/label_Nested Tables Test'))

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/label_Frameset Test'))

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/label_Doctype Test'))

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/label_URL Redirects Checker'))

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/label_Advanced SEO'))

    WebUI.setText(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/input_url'), varWeb)

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/button_Analyze URL'))

    WebUI.delay(20)

    WebUI.click(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/button_Pdf'))

    WebUI.delay(20)

    CustomKeywords.'WebUICustomKeyword.uploadFile'(findTestObject('Page_Seo Checkup  SEO Site Checkup (2)/button_Pdf'), 
        varDot)

    WebUI.delay(10)

    WebUI.navigateToUrl('https://my.pcloud.com/')

    WebUI.delay(3)

    WebUI.dismissAlert(FailureHandling.CONTINUE_ON_FAILURE)

    WebUI.click(findTestObject('Page_pCloud  File Manager/a_g-modal-close'), FailureHandling.CONTINUE_ON_FAILURE)

    WebUI.delay(2, FailureHandling.STOP_ON_FAILURE)

    WebUI.click(findTestObject('Page_pCloud  File Manager/div_Upload'))

    WebUI.delay(5)

    CustomKeywords.'upload.upload.uploadFile'(findTestObject('Page_pCloud  File Manager (1)/Browse_files'), '/Users/todorsrbinovski/Desktop/gucci1.pdf')

    WebUI.delay(15)

    WebUI.click(findTestObject('Page_pCloud  File Manager (4)/span_minimize'))

    WebUI.delay(2)

    WebUI.click(findTestObject('Page_pCloud  File Manager (4)/span_praeferenzliste17f48667-4'))

    WebUI.delay(3)

    WebUI.click(findTestObject('Page_pCloud  File Manager (4)/a_Share'))

    WebUI.delay(3)

    WebUI.click(findTestObject('Page_pCloud  File Manager (4)/span_Settings'))

    WebUI.delay(3)

    WebUI.click(findTestObject('Page_pCloud  File Manager (4)/input_enable_shortlink'))

    WebUI.delay(3)

    WebUI.click(findTestObject('Page_pCloud  File Manager (4)/div_Save'))

    WebUI.delay(3)

    WebUI.click(findTestObject('Page_pCloud  File Manager (4)/span_Short link'))

    WebUI.delay(3)

    WebUI.doubleClick(findTestObject('Page_pCloud  File Manager (6)/input'))

    WebUI.delay(3)

    WebUI.navigateToUrl('https://www.rapidtables.com/tools/notepad.html')

    WebUI.delay(5)

    WebUI.click(findTestObject('Page_Notepad  Online Notes free no (2)/textarea_S1'))

    WebUI.sendKeys(findTestObject('Page_Notepad  Online Notes free no (2)/textarea_S1'), Keys.chord(Keys.PAGE_DOWN))

    WebUI.delay(2)

    WebUI.sendKeys(findTestObject('Page_Notepad  Online Notes free no (2)/textarea_S1'), Keys.chord(Keys.CONTROL, 'v'))

    WebUI.delay(1)

    WebUI.sendKeys(findTestObject('Page_Notepad  Online Notes free no (2)/textarea_S1'), Keys.chord(Keys.ENTER))

    WebUI.delay(2)
}

WebUI.click(findTestObject('Page_Notepad  Online Notes free no (1)/i_save'))

WebUI.delay(2)

WebUI.click(findTestObject('Page_Notepad  Online Notes free no (1)/input_save'))




Aucun commentaire:

Enregistrer un commentaire