Could not click IFRAME element due to hide


#1

Hi All,

I am facing issue with “Click IFRAME Element” because of the element is hide in scroll . If you want see the element need to scroll . there is two different scroll , one is IFRAME scroll bar and another one is browser scroll bar. I tried "Scroll element " and “Scroll Position” it doesn’t work. At the same time i tried to "Zoom in " but the default content elements are zoomed in . But IFRAME elements are not zoom in. like that i tried “send key” as well that too not working. At the same time i used time “delay” and scroll manually the object can click and it is working fine. but i can’t do this every time right .

So please help me to fix this.

Thanks & Regards,
Vignes


#2

Please read this and pay attention to points 1, 2, 3, and 4. (You seem to have covered points 6 and 7 quite well)


#3

hi as per request added details below
WebUI.scrollToElement(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Quote/Click Quote Details’), ‘60’)

Error log
Test Cases/AMS Direct/IQ Automation_AMS Direct_Happy Path for Low Touch quote FAILED.
Reason:
groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.scrollToElement() is applicable for argument types: (com.kms.katalon.core.testobject.TestObject, java.lang.String) values: [TestObject - ‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Quote/Click Quote Details’, …]
Possible solutions: scrollToElement(com.kms.katalon.core.testobject.TestObject, int), scrollToElement(com.kms.katalon.core.testobject.TestObject, int, com.kms.katalon.core.model.FailureHandling)
at IQ Automation_AMS Direct_Happy Path for Low Touch quote.run(IQ Automation_AMS Direct_Happy Path for Low Touch quote:106)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1563156795422.run(TempTestCase1563156795422.groovy:21)


#4

The error is telling you WebUI.scrollToElement is not happy being passed a TestObject and a string

WebUI.scrollToElement takes a TestObject and an int (with an optional flowControl value).

Because you chose not to post your code, I can’t tell you where the problem is.


#5

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import java.awt.Robot as Robot
import java.awt.event.KeyEvent as KeyEvent
import org.openqa.selenium.JavascriptExecutor
import com.kms.katalon.core.webui.driver.DriverFactory

import org.openqa.selenium.WebElement
import com.kms.katalon.core.webui.common.WebUiCommonHelper
import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver
import org.openqa.selenium.WebElement;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.interactions.internal.Coordinates;
import org.testng.annotations.Test;

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

WebUI.openBrowser(’’)

WebUI.navigateToUrl(‘https://hpsales-itg.crm.dynamics.com’)

WebUI.maximizeWindow()

WebUI.setText(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/microsoft sign in/input_login_Email’),
‘Test@gmail.com’)

WebUI.click(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/microsoft sign in/Sign in_Next Button’))

test = ‘C:\Users\alaguv\Desktop\auth\val1.exe’

Runtime.getRuntime().exec(test)

WebUI.delay(10)

def t1 = new Thread((({
for (i = 0; i < 10; i++) {
Robot robot = new Robot()

        Thread.sleep(5000)

        robot.keyPress(KeyEvent.VK_ENTER)

        Thread.sleep(1000)

        break
    }
}) as Runnable))

t1.start()

WebUI.delay(10)

autoit_prj = ‘C:\Users\alaguv\Desktop\auth\code.exe’

Runtime.getRuntime().exec(autoit_prj)

WebUI.delay(30)

WebUI.click(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/microsoft sign in/input_(Don t show this again)_Button’))

WebUI.delay(60)

WebUI.click(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Opportunities creation/button_New’))

// ------------------------- End of Click + sign for creatig OPP -----------------------------------//
WebUI.click(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Opportunities creation/OPP_Account Name’))

WebUI.setText(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Opportunities creation/OPP_Account Name’),
‘EDG Asia Pacific Pte Ltd’)

WebUI.click(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Opportunities creation/Account Name_Lookup’))

WebUI.click(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Opportunities creation/span_EDG Asia Pacific Pte Ltd’))

WebUI.click(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Opportunities creation/input_Opportunity Name’))

WebUI.setText(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Opportunities creation/input_Opportunity Name’),
‘amsn6auto3’)

WebUI.click(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Opportunities creation/Select-New Business- OPP Type’))

WebUI.selectOptionByIndex(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Opportunities creation/Select-New Business- OPP Type’),
‘1’)

WebUI.click(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Opportunities creation/Customer Engagement’))

WebUI.selectOptionByIndex(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Opportunities creation/Customer Engagement’),
‘1’)

WebUI.click(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Opportunities creation/Close Date_TextField’))

WebUI.setText(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Opportunities creation/Close Date_TextField’),
‘7/26/2019’)

// WebUI.click(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Opportunities creation/date 3’))
WebUI.click(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Opportunities creation/button_Save’))

WebUI.delay(10)

WebUI.click(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Opportunities creation/span_Create Quote’))

//----------------------------OPP End-----------------------------------------------------//
WebUI.delay(60)

WebUI.scrollToElement(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Quote/quote details manual’), ‘60’)

WebUI.click(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Quote/form quote details’))

WebUI.setText(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Quote/input_Created By Phone number’),
‘01111023082’)

WebUI.click(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Quote/Click_Customer’))

WebUI.setText(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Quote/Customer Contact First Name’),
‘vig’)

WebUI.setText(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Quote/Customer Contact Last Name’),
‘testing’)

WebUI.setText(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Quote/Customer Email Address’),
‘vigneswaran.alagu1@hp.com’)

WebUI.setText(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Quote/Customer Telephone Number’),
‘01111025555’)

WebUI.click(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Quote/Click_Save_quote’))

WebUI.click(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Quote/Quick Key Plus Button’))

WebUI.setText(findTestObject(‘Object Repository/IQ Automation_AMS Direct_Happy Path for Low Touch quote/Quote/input_Product number’),
‘U4414E’)

WebUI.delay(20)


#6

See the quotes around the value 60? Remove them.


#7

deleted…wrong comment earlier


#8

Did you ask a question on the forum ?

That error is usually due to element not being fully rendered or other elements are being displayed above it. Please try to use waitForElementVisible or waitForElementClickable (possibly both).

Cheers !