How to open "find bar" in chrome using katalons script?

I need to use “find bar” in chrome because some of the pages that I test is don’t have its own search box.
Screen Shot 2020-05-15 at 11.34.56

So, how to open that “find bar” in chrome with a shortcut like ( ctrl + f / command + f) with katalons script? I have tried with
WebUI.sendKeys(findTestObject('txt_Comment'), Keys.chord(Keys.CONTROL, 'f'))
, but still does’t work.

Can someone help me?

Unfortunately, the WebUI.sendKeys() method cannot handle function keys. You’ll need to use pure selenium for that approach:

WebDriver driver = DriverFactory.getWebDriver()
driver.findElement(By.xpath("//body")).sendKeys(Keys.chord(Keys.CONTROL, "f"))

Sorry for the late reply.

@Brandon_Hein Still can’t open the “find bar” with your solution T_T. Is the script different if I use a Mac? Because I use mac, I try with

WebDriver driver = DriverFactory.getWebDriver()
driver.findElement(By.xpath("//body")).sendKeys(Keys.chord(Keys.COMMAND, "f"))

Still can’t open the find bar. Another function key is works besides “COMMAND+F or COMMAND+G”. Any other solution?

What is happening when you run the code? Is there an error? Does nothing happen? This would be the only way I know of to do this, however, I’m still not sure the purpose. Once the find bar is open, you wouldn’t be able to type anything into the field anyway.

But is any solution to find a specific name on a page? For example test03 I ask because the list is not ordonated so every time will not be or donate so I will need to search for an item.

For anyone else who might stumble across this, I found the solution here:

So in your case, that should be:

import java.awt.Robot
import java.awt.event.KeyEvent

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

WebUI.openBrowser("www.google.com")
Robot robot = new Robot()
robot.keyPress(KeyEvent.VK_META)
robot.keyPress(KeyEvent.VK_F)
robot.keyRelease(KeyEvent.VK_META)
robot.keyRelease(KeyEvent.VK_F)