Not Able to edit XML in a branch of a GIT HUB repository

I am not able to edit an xml in a git repository.
While i am able to navigate till the pom.xml page in the repository and also able to click edit button , post which i am not able to select and edit a given tag in the xml i.e version tag.
as seen in the screenshot . I have tried multiple methods to resolve this and surprising fact is i am able to get the value of the intended tag using GetText() even though SetText() doesnt work-
WebUI.setText(findTestObject(‘object repo path’), ‘20.10.00.01-SNAPSHOT’)

  1. SetText - gives element not interactable error . :- error given below.
  2. WaitForElement - so as to wait for the element to be available but in vain.
  3. Send Keys - so as to use SHIFT+HOME to select the text and then press DELETE ,
    but that resulted in send keys error .
  4. Using JS -
    WebElement element = WebUiCommonHelper.findWebElement(findTestObject(‘textarea’),
    30)
    WebUI.executeJavaScript(“arguments[0].value=‘’”, Arrays.asList(element)). This step doesnt give any error but doesn’t edit too
  • Katalon Studio Version: 7.2.1
  • OS Version:Windows 10
  • Browser Version:Chrome - 83.0.4103.116

Steps to reproduce - try editing any xml within a github repository page
Error stack trace for setText() :-

com.kms.katalon.core.exception.StepFailedException: Unable to set text ‘20.10.00.01-SNAPSHOT’ of object ‘Object Repository/Release auto/Page_Source of pomxml - SCOE - Tele2 NL Bitbucket/textarea’
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.SetTextKeyword.setText(SetTextKeyword.groovy:66)
at com.kms.katalon.core.webui.keyword.builtin.SetTextKeyword.execute(SetTextKeyword.groovy:37)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:72)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.setText(WebUiBuiltInKeywords.groovy:950)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$setText$1.call(Unknown Source)
at Scoe Branch change.run(Scoe Branch change:83)
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 TempTestCase1595412704713.run(TempTestCase1595412704713.groovy:23)
Caused by: org.openqa.selenium.InvalidElementStateException: invalid element state

Screenshots:

Before working on Katalon Studio, I would suggest to you to learn how to use “Google Chrome Developer Tool” and understand how the DOM of your target web page looks like.

@kazurayam , we have inspected using the DOM of the target web page . Also there isnt any issue with the locator since in GetText the value of the locator is visible .Kindly help

I do not know how to do it using usual Katalon Studio instructions such as setText, sendKeys, executeJavaScript.

The locator to <textarea> may work getting the text inside it. But it does not mean you can automagically parse and edit the XML content inside the <textarea>. You need to drive a lot more technologies — parsing an XML document with XMLSlurper or DOM4J, and transforming XML document using XSLT, etc. It is a long long way to go and too difficult.

You want to change the content string of <version>....</version> tag in the pom.xml of your Maven project, right?

It would be far easier if you download the XML file from Bitbucket to your local PC using git clone command, edit the <version> value manually using text editor, do git add and git commit, then upload the file to Bitbucket using git push command. All can be done manually just easily.

I do not see any reason why you want to automate this process using web browser and Katalon Studio. Why not you do it using bash + git + sed.

1 Like

Thanks for the insight @kazurayam . I was trying to automate the stuff using katalon, but need to look elsewhere now.

Yes, you should. Katalon is not the tool to do that sort of work.