Hi. I am new to Katalon Studio. I am trying to read the version number but for some reason, it detected the version num as null. The version num should be v. 220.127.116.11. Can anyone help me? Thanks
you are trying to get the attribute “v. 18.104.22.168”, which doesn’t exist, which therefore returns null
what you likely want to use is WebUI.getText()
Possibly you want this:
result = WebUI.verifyElementText( findTestObject('Object Repository/PLS Atafu/Page_Log in - FSG Atafu (Back Office Terminal)/h3_v. 22.214.171.124), "v. 126.96.36.199", FailureHandling.STOP_ON_FAILURE)
Or, the following might be simpler
result = WebUI.verifyElementPresent( findTestObject('Object Repository/PLS Atafu/Page_Log in - FSG Atafu (Back Office Terminal)/h3_v. 188.8.131.52), 10, FailureHandling.STOP_ON_FAILURE)
in that case, try
if that still doesn’t work, i’m out of ideas
What is the xpath that you are using to get the “h3_v. 184.108.40.206” element?
Is this the only “h3 version” on the page?
Also, you should address the error messages about your “Timeout” that are the red items in your output. Just change them to 10. It doesn’t actually take 10 seconds each and you don’t get the error message.
And, unless you need to use the result from the “getText()”, I would go with the method that @kazurayam has given you:
WebUI.verifyElementText(findTestObject('PLS Atafu/Page_Log in - FSG Atafu (Back Office Terminal)/h3_v. 220.127.116.11), "v. 18.104.22.168")
Yes I want to read the value and compare it to check if the version num is correct. So I tried the verify element text method but this error is shown.
=============== ROOT CAUSE =====================
Caused by: com.kms.katalon.core.exception.StepFailedException: Actual text ‘’ and expected text ‘v. 22.214.171.124’ of test object ‘Object Repository/PLS Atafu/Page_Log in - FSG Atafu (Back Office Terminal)/h3_v. 126.96.36.199’ are NOT matched.
This is the xpath /html/body/form/div/div/div/div/div/section/h3
I think it is the only h3 version on the page. Is there anyway for me to confirm this?
Thanks for the advice but may i know how do i change the error message about “Timeout” to 10? Sorry I am new to this.
Yes i need the result to compare and check if the version num is correct but someone it keep reading it as null
- The fragment
h3suggests that in the HTML there are 2 or more
- But you wrote:
the only h3.
This contradiction suggests either of:
- The xpath is wrong.
- You are not careful enough.
I can not tell which is the case.
Possibly the following XPath expression is better, provided that there are only 2
h3 elements in the page.
The double slashes (
//) is an abbreviate syntax in XPath expression.
//paraselects all the
paradescendants of the document root and thus selects all
paraelements in the same document as the context node
Or the following tutorial:
You have displayed some of your code in your question above and within your statement:
The timeout value is the 0 (zero). Change the zero value to 10, so it becomes:
That will stop the red warnings from displaying in your Console log.
If you hover your mouse over the method, verifyElementPresent, a popup will display with information on the method, such as what parameters are expected.
Alright. Thanks for the info.
Does the HTML has any
If yes, you need to switch the context by
As @kazurayam said, ensure if the page has Frame or not.
Open your application in chrome browser. And right click on the element and check to see if the context menu has “View Frame Source” is available. If so, the element is available in frame.
The below attribute’s can be used to get text: