Test case working fine on Chrome but not on Firefox

Looks like the element (image) the script is trying to interact with is inside of an iframe. Did you remember to use WebUI.switchToFrame() in the previous step?

1 Like

Mr Firefox, here. :stuck_out_tongue:

The only issues I’ve noticed with geckodriver occur with checkboxes. For reasons I’ve never been able to fathom*, a jQuery click [ $(selector).click ] fails “often” where a vanilla JS click [document.querySelector(selector).click] works 100%.

*Pragmatism wins - I spent minimal time looking, tried qS, found it worked and moved on.

1 Like

Hello @Mate,

Yes I have used Switchtoframe keyword.Without it I wasn’t able to enter anything in the CC Number field.

Firefox is failing at this particular step, Chrome is not giving error and transactions are completing.

Is the Firefox failing with the same error message? If not, post the error message, we will be a step closer to the solution.

That is how you debug, btw. If our actions had consenquences, something changed when we added another command. So, anything that showed up after that is a useful piece of information.

1 Like

Hello @Mate_Mrse

I will try to post the error. I didn’t got chance to work on this yesterday.I hope today I will be working on this.

Thanks,

Hello @Mate_Mrse @Russ_Thomas @Brandon_Hein

This is very weird. I added a delay right before the step where the test case was failing in Firefox and it worked. I am under impression that it has something to do with my Custom keyword Clickwithjavascript. The reason why I am saying this is because I have another Test Case with the same issue and adding delay also worked there. I am happy now that its working but just wanted to let you guys know.

Now as my test case is able to make progress I am facing another issue :stuck_out_tongue: in which on Firefox the CCnumber feild is not getting input from Katalon properly. Getting only first four digits. I will try my best to fix it myself before starting another post.

I am attaching the script of that custom keyword in case you guys want to see.

package clickusingjavascript

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.annotation.Keyword

import com.kms.katalon.core.checkpoint.Checkpoint

import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW

import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile

import com.kms.katalon.core.model.FailureHandling

import com.kms.katalon.core.testcase.TestCase

import com.kms.katalon.core.testdata.TestData

import com.kms.katalon.core.testobject.TestObject

import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS

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

import internal.GlobalVariable

import org.openqa.selenium.WebDriver as WebDriver

import org.openqa.selenium.WebElement as WebElement

import org.openqa.selenium.interactions.Actions as Actions

import com.kms.katalon.core.webui.common.WebUiCommonHelper as WebUiCommonHelper

import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory

import org.openqa.selenium.JavascriptExecutor as JavascriptExecutor

@Keyword

def clickUsingJS(TestObject to, int timeout) {

WebDriver driver = DriverFactory.getWebDriver()

WebElement element = WebUiCommonHelper.findWebElement(to, timeout)

JavascriptExecutor executor = ((driver) as JavascriptExecutor)

executor.executeScript(‘arguments[0].click()’, element)

}

It is a good practice to add waits before interacting with a page after a page changes. Maybe just, for whatever reason, it took half a second longer for Firefox to render the element and that’s why the test failed. :man_shrugging:

2 Likes

@Mate_Mrse Thanks for your suggestion. I will keep your suggestion in mind while working on test.

Also I fixed the CCNumber issue but its again firefox thing.

Hi,

I am getting the same problem as me test case is working fine in chrome but is not working on firefox. I am getting the following error:
Can anybody suggest the solution

Test Cases/TestCase1 FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to open browser with url: ‘’
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword.openBrowser(OpenBrowserKeyword.groovy:81)
at com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword.execute(OpenBrowserKeyword.groovy:67)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.openBrowser(WebUiBuiltInKeywords.groovy:60)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$openBrowser.call(Unknown Source)
at TestCase1.run(TestCase1:16)
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 TempTestCase1561645065934.run(TempTestCase1561645065934.groovy:21)
Caused by: org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: WIN10
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘COB10L-PF0V6548’, ip: ‘172.29.6.203’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: driver.version: CGeckoDriver
at org.openqa.selenium.firefox.FirefoxBinary.(FirefoxBinary.java:100)
at org.openqa.selenium.firefox.FirefoxOptions.getBinary(FirefoxOptions.java:216)
at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:187)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:147)
at com.kms.katalon.selenium.driver.CFirefoxDriver.(CFirefoxDriver.java:21)
at com.kms.katalon.core.webui.driver.firefox.CGeckoDriver.(CGeckoDriver.java:12)
at com.kms.katalon.core.webui.driver.firefox.CGeckoDriver.from(CGeckoDriver.java:17)
at com.kms.katalon.core.webui.driver.DriverFactory.createNewFirefoxDriver(DriverFactory.java:463)
at com.kms.katalon.core.webui.driver.DriverFactory.startNewBrowser(DriverFactory.java:237)
at com.kms.katalon.core.webui.driver.DriverFactory.openWebDriver(DriverFactory.java:191)
at com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword$_openBrowser_closure1.doCall(OpenBrowserKeyword.groovy:74)
at com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword$_openBrowser_closure1.call(OpenBrowserKeyword.groovy)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
… 17 more

Check your Firefox install.

I re-installed the firefox but not as an admin of the machine, just as a user. May be that can be the problem??
I am getting the following error while trying to execute on internet explorer.
Also the IE gets opened and a message “This is the initial start up page for web driver server” is diplayed.

Test Cases/TestCase1 FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to open browser with url: ‘’
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword.openBrowser(OpenBrowserKeyword.groovy:81)
at com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword.execute(OpenBrowserKeyword.groovy:67)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.openBrowser(WebUiBuiltInKeywords.groovy:60)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$openBrowser.call(Unknown Source)
at TestCase1.run(TestCase1:16)
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 TempTestCase1561647219865.run(TempTestCase1561647219865.groovy:21)
Caused by: org.openqa.selenium.SessionNotCreatedException: Unexpected error launching Internet Explorer. Browser zoom level was set to 150%. It should be set to 100%
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘COB10L-PF0V6548’, ip: ‘172.30.89.176’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: driver.version: CInternetExplorerDriver
remote stacktrace:
at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$errorHandler$0(W3CHandshakeResponse.java:62)
at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at com.kms.katalon.selenium.driver.CInternetExplorerDriver.execute(CInternetExplorerDriver.java:22)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
at org.openqa.selenium.ie.InternetExplorerDriver.run(InternetExplorerDriver.java:221)
at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:213)
at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:190)
at com.kms.katalon.selenium.driver.CInternetExplorerDriver.(CInternetExplorerDriver.java:15)
at com.kms.katalon.core.webui.driver.DriverFactory.createNewIEDriver(DriverFactory.java:449)
at com.kms.katalon.core.webui.driver.DriverFactory.startNewBrowser(DriverFactory.java:240)
at com.kms.katalon.core.webui.driver.DriverFactory.openWebDriver(DriverFactory.java:191)
at com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword$_openBrowser_closure1.doCall(OpenBrowserKeyword.groovy:74)
at com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword$_openBrowser_closure1.call(OpenBrowserKeyword.groovy)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
… 17 more

@ravneet.boparai I am not sure if that is an Admin issue but the overall approach in dev / QA teams is that they should have full admin rights on the machines. This would speed up many things.

I also saw a post which says you need admin rights to run test on IE

Thank You @manpreet.mukkar ,can you suggest anything for running the script on firefox as it is not working on firefox.

@ravneet.boparai Did you changed the default location of firefox when you reinstalled it ? That might be automatically changed as you don’t have admin rights.

Give this post a read and let us know if it works ?

Location of my FF is “C:\Users\RB\AppData\Local\Mozilla Firefox” and I think that’s the only issue because when i type “firefox” in command line it gives an error as ‘firefox’ is not recognized as an internal or external command,
operable program or batch file.

will try changing it on getting the admin rights.

Thank You @manpreet.mukkar

@ravneet.boparai Did you tried the comment above the post I shared?

@manpreet.mukkar Yes, i tried but i am unable to add firefox.exe to the path and thus command prompt is showing error as well.
This error is shown by command prompt:-
‘firefox’ is not recognized as an internal or external command,
operable program or batch file.

@ravneet.boparai I would say install of Firefox as Admin may fix this issue.

Then you may also want to give Katalon a restart and then run it to see if the issues are fixed.

I sincerely doubt that. Installing apps in the AppData structure is unusual.

@manpreet.mukkar and @Russ_Thomas Thank You for your help