# Xpath in groovy script

**URL:** <https://forum.katalon.com/t/xpath-in-groovy-script/24485>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [May 4, 2019, 9:59am UTC](https://forum.katalon.com/t/xpath-in-groovy-script/24485 "2019-05-04T09:59:30Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![vdavuluri2](https://avatars.discourse-cdn.com/v4/letter/v/ec9cab/32.png) [@vdavuluri2](https://forum.katalon.com/u/vdavuluri2)\
**Post date:** [May 4, 2019, 9:59am UTC](https://forum.katalon.com/t/xpath-in-groovy-script/24485/1 "2019-05-04T09:59:30Z")

</div>

Hi,  
can you please suggest how to code the xpath in the coding of groovy script. For example…if we want to enter the text in the text box, what would be the syntax for this.

WebUI.setText() ??

Please suggest.

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [May 4, 2019, 8:12pm UTC](https://forum.katalon.com/t/xpath-in-groovy-script/24485/2 "2019-05-04T20:12:23Z")

</div>

You can use a Test Object to store your xpath:

[https://docs.katalon.com/katalon-studio/docs/manage-test-object.html#create-a-test-object](https://docs.katalon.com/katalon-studio/docs/manage-test-object.html#create-a-test-object)

in which case you would utilize the WebUI methods as you’ve suggested.

Another way is to use the WebUiCommonHelper methods to convert everything to WebElements and use Selenium as usual:

```
WebElement textArea = WebUiCommonHelper.findWebElement(By.xpath(“//textarea[@id=‘some_id’]”));
textArea.sendKeys(“xyz”);

```

You can also create and use Test Objects programmatically in your script:

> [@Creation of Test Object in Object Repository in Runtime](http://forum.katalon.com/t/creation-of-test-object-in-object-repository-in-runtime/10333/2):
>
> Hi Indurajan I use this: /\*\* \* Construct a Katalon-compatible TestObject in memory. \* @param css (String) The CSS selector used to find the target element. \* @return (TestObject) The constructed TestObject. \*/ static TestObject makeTO(String css) { TestObject to = new TestObject() to.addProperty("css", ConditionType.EQUALS, css) return to }

---

<div class="post-metadata">

**Author:** ![vdavuluri2](https://avatars.discourse-cdn.com/v4/letter/v/ec9cab/32.png) [@vdavuluri2](https://forum.katalon.com/u/vdavuluri2)\
**Post date:** [May 5, 2019, 6:54am UTC](https://forum.katalon.com/t/xpath-in-groovy-script/24485/3 "2019-05-05T06:54:04Z")

</div>

Thanks for your reply.  
I wanted to use it in property name in the web application is very lengthy. So, i wanted to use xpath in the scripting for drop down.

To select the value from the drop down, how to code in the script. I want to select the property and select the value from the drop down. For this, I need the example syntax to code it.

---

<div class="post-metadata">

**Author:** ![vdavuluri2](https://avatars.discourse-cdn.com/v4/letter/v/ec9cab/32.png) [@vdavuluri2](https://forum.katalon.com/u/vdavuluri2)\
**Post date:** [May 6, 2019, 6:28am UTC](https://forum.katalon.com/t/xpath-in-groovy-script/24485/4 "2019-05-06T06:28:48Z")

</div>

I tried this option and it is not working. Below is the code that I have tried with.  
WebElement textArea = WebUICommonHelper.findWebElement(By.xpath(“//select[@id=‘service\_type\_code’]”))  
textArea.select(“AUDIO CONFERENCING (MAC)”)

Below is the html code for the same. I need to select the **service\_type\_code** value as  
**AUDIO CONFERENCING (MAC)** from the drop down list.

Please share the syntax how to code this.

\<html lang=“en”\>  
\<head\>

\<title\>Create Dispute \</title\>  
\<link rel=“stylesheet” type=“text/css” href="[?appId=gmpdispute&amp;flName=/uitmpl/en/css/uitmpl.css](https://cstz0115.sldc.sbc.com:8201/servlet/GMPGate?appId=gmpdispute&flName=/uitmpl/en/css/uitmpl.css)" /\>  
\<link rel=“stylesheet” type=“text/css” href="[?appId=gmpdispute&amp;flName=/gdp/css/gdp.css](https://cstz0115.sldc.sbc.com:8201/servlet/GMPGate?appId=gmpdispute&flName=/gdp/css/gdp.css)" /\>  
\<script type=“text/javascript” src="[?appId=gmpdispute&amp;flName=/uitmpl/js/other\_scripts.js](https://cstz0115.sldc.sbc.com:8201/servlet/GMPGate?appId=gmpdispute&flName=/uitmpl/js/other_scripts.js)"\>\</script\>  
\<script type=“text/javascript” src="[?appId=gmpdispute&amp;flName=/uitmpl/js/freezingHeader.js](https://cstz0115.sldc.sbc.com:8201/servlet/GMPGate?appId=gmpdispute&flName=/uitmpl/js/freezingHeader.js)"\>\</script\>

\<noscript\>  
\<style\>  
table.mQH {display:block;}  
\</style\>  
\</noscript\>  
\<style id=“antiClickjack”\>body{display:none !important;}\</style\>  
\<script type=“text/javascript”\>  
if (self === top) {  
var antiClickjack = document.getElementById(“antiClickjack”);  
antiClickjack.parentNode.removeChild(antiClickjack);  
} else {  
top.location = self.location;  
}  
\</script\>  
\</head\>  
\<body onload=“uitmpl\_qhPageInit();registerOnchangeEvent();”\>

\<!-- Skip To Main Content should be the next element immediately after body element --\>  
\<div class=“skipnav”\>\<a href="[#maincontent](https://cstz0115.sldc.sbc.com:8201/servlet/GMPGate?appId=gmpdispute&nextScr=setupdispute&contract_grp=&methodToCall=create&sys_tracking_nbr=&context=%2Fgdp&from=#maincontent)" title=“Skip to Main Content”\>Skip to Main Content\</a\> \</div\>

\<script type=“text/javascript” src="[?appId=gmpdispute&amp;flName=/uitmpl/js/menu\_script.js](https://cstz0115.sldc.sbc.com:8201/servlet/GMPGate?appId=gmpdispute&flName=/uitmpl/js/menu_script.js)"\>\</script\>  
\<script type=“text/javascript” src="[?appId=gmpdispute&amp;flName=/uitmpl/js/application\_settings.js](https://cstz0115.sldc.sbc.com:8201/servlet/GMPGate?appId=gmpdispute&flName=/uitmpl/js/application_settings.js)"\>\</script\>  
\<script type=“text/javascript” src="[?appId=gmpdispute&amp;flName=/uitmpl/js/global\_settings.js](https://cstz0115.sldc.sbc.com:8201/servlet/GMPGate?appId=gmpdispute&flName=/uitmpl/js/global_settings.js)"\>\</script\>

\<script type=“text/javascript”\>  
application.data = {  
td\_1: “Home”,  
td\_2: “Govt Dispute”,  
td\_3: “Create Disputes”,  
td\_4: “Reports/Search”,  
td\_5: “My Preference”,

url\_1: “javascript:OnGMPPortalSubmit(document.frmMenuScr, ‘’)”,  
url\_2: “javascript:OnMenuSubmit (document.frmMenuScr, ‘homepage’)”,  
url\_3: “javascript:OnMenuSubmit (document.frmMenuScr, ‘disputesubmenu’)”,  
url\_4: “javascript:OnMenuSubmit (document.frmMenuScr, ‘reportLink’)”,  
url\_5: “javascript:OnMenuSubmit (document.frmMenuScr, ‘userpref’)”

};

global.data = {  
//td\_1: “AT&amp;T BusinessDirect”,  
td\_1: “Write Us”,  
td\_2: “Help\<span class=“offscrn”\> - Opens a PDF Document for Help\</span\>”,  
td\_3: “Close”,  
//td\_3\_1: “General Help”,  
//td\_3\_2: “Application Tutorial”,  
//td\_3\_3: “\<span id=“shHd”\>Show\</span\> Quick Help”,  
//url\_1: “javascript:bizDirect()”,  
url\_1: “javascript:OnMenuSubmit(document.frmMenuScr, ‘compose’)”,  
url\_2: “javascript:uitmpl\_popUpReg(document.frmMenuScr.action + ‘?appId=’ + document.frmMenuScr.appId.value + ‘&flName=’ + document.frmMenuScr.context.value + ‘/help/Disputes\_UG.pdf’)”,  
url\_3: “javascript: window\_close(document.frmMenuScr, ‘logoff’);”  
//url\_3\_1: “javascript:uitmpl\_popUpReg(document.frmMenuScr.action + \’?appId=\’ + document.frmMenuScr.appId.value + \’&flName=\’ + document.frmMenuScr.context.value + \’/help/Disputes\_UG.pdf\’)”,  
//url\_3\_2: “#”,  
//url\_3\_3: “javascript:uitmpl\_qhPageToggle()”  
};  
\</script\>

\<script type=“text/javascript” src="[?appId=gmpdispute&amp;flName=/gdp/js/script.js](https://cstz0115.sldc.sbc.com:8201/servlet/GMPGate?appId=gmpdispute&flName=/gdp/js/script.js)"\>\</script\>

\<!–\*\*\*\*\*\*\*\*\*\*\*\* uitmplbegin: tBAN \*\*\*\*\*\***–\>  
\<!–** begin:background graphic \*\*\*\*\*\*–\>

\<table width=“100%” cellspacing=“0” border=“0” class=“tBAN”\>

\<tr\>  
\<td\>\<img src="[?appId=gmpdispute&amp;flName=/uitmpl/en/img/swoosh.gif](https://cstz0115.sldc.sbc.com:8201/servlet/GMPGate?appId=gmpdispute&flName=/uitmpl/en/img/swoosh.gif)" width=“650” height=“69” alt="" border=“0” /\>\</td\>  
\</tr\>  
\</table\>  
\<!–\*\*\*\*\*\* end:background graphic **–\>  
\<!–** begin:logo and company title \*\*\*\*\*\*–\>  
\<div class=“logoCompany”\>  
\<table width=“100%” cellspacing=“0” border=“0” class=“tBAN”\>

\<tr\>  
\<td class=“logo”\>\<img src="[?appId=gmpdispute&amp;flName=/uitmpl/en/img/attbizdirect.gif](https://cstz0115.sldc.sbc.com:8201/servlet/GMPGate?appId=gmpdispute&flName=/uitmpl/en/img/attbizdirect.gif)" width=“291” height=“63” alt=“AT&T Business Direct” border=“0” /\>\</td\>  
\<td\>\<!-- stretchable cell --\>\</td\>  
\<!-- max characters for company title: 72 w/ breaks (24 per line) --\>  
\<td class=“company”\>ATT Gov Sol Dev\<br/\>rm0013\<br /\>\</td\>  
\</tr\>  
\</table\>  
\</div\>

\<!–\*\*\*\*\*\* end:logo and company title **–\>  
\<!– **begin:application title** –\>  
\<table cellspacing=“0” border=“0” class=“appTitle”\>  
\<tr\>  
\<td\>\<a href=“javascript:OnMenuSubmit (document.frmMenuScr, ‘homepage’)”\>View and Analyze Govt. Bills: Govt Dispute\</a\>\</td\>  
\</tr\>  
\</table\>  
\<!–** end:application title \*\*\*\*\*\*–\>

\<!–\*\*\*\*\*\*\*\*\*\*\*\* uitmplend: tBAN **–\>  
\<!–** uitmplbegin: tNAV \*\*\*\*\*\*\*\*\*\*\*\*–\>  
\<div id=“glbl”\>  
\<script language=“JavaScript1.3”\>  
\<!–  
uitmpl\_list(“global”);  
//–\>  
\</script\>  
\<noscript\>  
\<div class=“globalAcc”\>  
\<table class=“global\_main” cellspacing=“0” border=“0”\>  
\<tr\>  
\<td class=“global\_main\_spacer”\>&nbsp;\</td\>  
\<td\>\<a href=“javascript:bizDirect()”\>AT&amp;T BusinessDirect\</a\>\</td\>\<td class=“pipe”\> \</td\>\<td\>\<a href=“javascript:OnMenuSubmit(document.frmMenuScr, ‘compose’)” target="\_new"\>Write Us\</a\>\</td\>\<td class=“pipe”\> \</td\>\<td\>\<a href="#"\>Help\</a\>\</td\>  
\</tr\>  
\</table\>  
\</div\>  
\</noscript\>  
\</div\>  
\<div id=“app”\>  
\<script language=“JavaScript1.3”\>  
\<!–  
uitmpl\_list(“application”);  
//–\>  
\</script\>  
\<noscript\>  
\<div class=“applicationAcc”\>\<table class=“application\_main” cellspacing=“0” border=“0”\>  
\<tr\>  
\<td\>\<a href=“javascript:OnMenuSubmit (document.frmMenuScr, ‘homepage’)”\>Home\</a\>\</td\>  
\<td class=“pipe”\> \</td\>  
\<td\>\<a href=“javascript:alert (‘Under Construction…’)”\>Create/Update Dispute\</a\>\</td\>  
\<td class=“pipe”\> \</td\>  
\<td\>\<a href=“javascript:alert (‘Under Construction…’)”\>Reports/Search\</a\>\</td\>  
\<td class=“pipe”\> \</td\>  
\<td\>\<a href=“javascript:OnMenuSubmit (document.frmMenuScr, ‘UserPreference’)”\>My Preference\</a\>\</td\>  
\<td class=“pipe”\> \</td\>  
\<td\>\<a href=“javascript:alert (‘Under Construction…’)”\>User Management\</a\>\</td\>  
\</tr\>  
\</table\>  
\</div\>  
\</noscript\>  
\</div\>

\<!–\*\*\*\*\*\*\*\*\*\*\*\* uitmplend: tNAV _**–\>  
\<form name=“frmMenuScr” action="/servlet/GMPGate" method=“get”\>  
\<input type=“hidden” name=“appId” value=“gmpdispute”\>  
\<input type=“hidden” name=“nextScr” value=“userpref”\>  
\<input type=“hidden” name=“contract\_grp” value=""\>  
\<input type=“hidden” name=“methodToCall” value=""/\>  
\<input type=“hidden” name=“sys\_tracking\_nbr” value=""/\>  
\<input type=“hidden” name=“context” value="/gdp"/\>  
\<input type=“hidden” name=“from” value=""/\>  
\<!-- \<a name=“maincontent” id=“maincontent” tabindex="-1" \>\</a\> --\>  
\</form\>  
\<!– begin:grid –\>  
\<table width=“50%” cellspacing=“0” border=“0” class=“wrap”\>  
\<tr\>  
\<td width=“100%” class=“grid”\>  
\<!-- InstanceBeginEditable name=“PageHeader” --\>  
\<!– **_ uitmplbegin: tPH** –\>  
\<!– begin:titles –\>  
\<table cellspacing=“0” border=“0” class=“tPH”\>  
\<!– begin:page title –\>  
\<tr\>  
\<td\>\<h4 class=“pgTitle”\>\<a name=“maincontent” id=“maincontent” tabindex="-1"\>\</a\>Create Dispute \</h4\>\</td\>  
\</tr\>  
\<!– end:page title –\>  
\</table\>  
\<!– end:titles –\>  
\<!–** uitmplend: tPH \*\*\*\*\*\*\*\*\*\*\*\*–\>  
\<!-- InstanceEndEditable --\>  
\<!-- start error part --\>

\<!— BeginOptional name=“DataEntryEdit” —\>  
\<!-- InstanceBeginEditable name=“DataEntryEdit” --\>  
\<!–\*\*\*\*\*\*\*\*\*\*\*\* uitmplbegin: mUI \*\*\*\*\*\*\*\*\*\*\*\*–\>

\<form name=“disputeForm” action="/servlet/GMPGate" enctype=“multipart/form-data” method=“POST”\>  
\<input type=“hidden” name=“appId” value=“gmpdispute”\>  
\<input type=“hidden” name=“nextScr” value=“dispute”\>  
\<input type=“hidden” name=“fieldFocus” id=“fieldFocus” value=""\>  
\<input type=“hidden” name=“from” value=""\>  
\<input type=“hidden” name=“methodToCall” value=“create”\>  
\<input type=“hidden” name=“oldMethodToCall” value=""\>  
\<input type=“hidden” name=“sys\_tracking\_nbr” value=""\>  
\<input type=“hidden” name=“disp\_srce\_code” value=“3”\>  
\<!-- start data entry part --\>

\<table cellspacing=“0” border=“0” class=“mDL”\>  
\<!–\*\*\*\*\*\* begin:instructional text \*\*\*\*\*\*–\>

\<tr\>  
\<td class=“required” \>&nbsp;\</td\>  
\<td class=“required”\>\*\</td\>  
\<td colspan=“8” width=“100%”\>Indicates required data input fields\</td\>  
\</tr\>  
\<tr\>  
\<td class=“required” \>&nbsp;\</td\>  
\<td class=“required”\>\<!-- \* --\>\</td\>  
\<td colspan=“8” width=“100%”\>&nbsp;\</td\>  
\</tr\>

\<!–\*\*\*\*\*\* end:instructional text **–\>  
\<!–** begin:basic fields \*\*\*\*\*\*–\>

\<td class=“label” \>&nbsp;\</td\>  
\<td class=“label” \>\<labels class=“required”\>\</label\>\</td\>  
\<td class=“label” nowrap\>  
\<label for=“contract\_nbr” class=“abled”\>  
\<!-- \* --\>  
Contract Number :

\</label\>  
\</td\>  
\<td align=“left” width=“12” nowrap\>  
\<a id=“qhtxt\_h\_contract\_nbr” href=“javascript:uitmpl\_qhelp(‘h\_contract\_nbr’,‘qhdisp\_h\_contract\_nbr’);” tabindex="-1"\>\<img src="[?appId=gmpdispute&amp;flName=/uitmpl/en/img/quickhelp\_dk.gif](https://cstz0115.sldc.sbc.com:8201/servlet/GMPGate?appId=gmpdispute&flName=/uitmpl/en/img/quickhelp_dk.gif)" id=“qh\_img” width=“12” height=“12” alt=“Quick Help-Contract Number” border=“0” /\>\</a\>  
\</td\>  
\<td colspan=“6” class=“value” width=“500”\>

\<input type=“text” name=“contract\_nbr” maxlength=“15” size=“22” tabindex="-1" value=“GS00T07NSD0007” readonly=“readonly” id=“contract\_nbr” title=""\>

\</TD\>  
\</TR\>

\<td class=“label” \>&nbsp;\</td\>  
\<td class=“label” \>\<labels class=“required”\>\</label\>\</td\>  
\<td class=“label” nowrap\>  
\<label for=“ttl\_short\_desc\_text” class=“abled”\>  
\*  
Title :

\</label\>  
\</td\>  
\<td align=“left” width=“12” nowrap\>  
\<a id=“qhtxt\_h\_ttl\_short\_desc\_text” href=“javascript:uitmpl\_qhelp(‘h\_ttl\_short\_desc\_text’,‘qhdisp\_h\_ttl\_short\_desc\_text’);” tabindex=""\>\<img src="[?appId=gmpdispute&amp;flName=/uitmpl/en/img/quickhelp\_dk.gif](https://cstz0115.sldc.sbc.com:8201/servlet/GMPGate?appId=gmpdispute&flName=/uitmpl/en/img/quickhelp_dk.gif)" id=“qh\_img” width=“12” height=“12” alt=“Quick Help-Title” border=“0” /\>\</a\>  
\</td\>  
\<td colspan=“6” class=“value” width=“500”\>

\<input type=“text” name=“ttl\_short\_desc\_text” maxlength=“150” size=“80” tabindex="" value="" id=“ttl\_short\_desc\_text” title=""\>

\</TD\>  
\</TR\>

\<td class=“label” \>&nbsp;\</td\>  
\<td class=“label” \>\<labels class=“required”\>\</label\>\</td\>  
\<td class=“label” nowrap\>  
\<label for=“disp\_case\_status\_code” class=“abled”\>  
\<!-- \* --\>  
Status :

\</label\>  
\</td\>  
\<td align=“left” width=“12” nowrap\>  
\<a id=“qhtxt\_h\_disp\_case\_status\_code” href=“javascript:uitmpl\_qhelp(‘h\_disp\_case\_status\_code’,‘qhdisp\_h\_disp\_case\_status\_code’);” tabindex="-1"\>\<img src="[?appId=gmpdispute&amp;flName=/uitmpl/en/img/quickhelp\_dk.gif](https://cstz0115.sldc.sbc.com:8201/servlet/GMPGate?appId=gmpdispute&flName=/uitmpl/en/img/quickhelp_dk.gif)" id=“qh\_img” width=“12” height=“12” alt=“Quick Help-Status” border=“0” /\>\</a\>  
\</td\>  
\<td colspan=“6” class=“value” width=“500”\>

\<select name=“disp\_case\_status\_code” tabindex="-1" id=“disp\_case\_status\_code” title=“Status”\>\<option value=“OPEN” selected=“selected”\>OPEN\</option\>\</select\>

\<input type=“hidden” name=“disp\_case\_status\_code” value=“OPEN”\>

\</TD\>  
\</TR\>

\<td class=“label” \>&nbsp;\</td\>  
\<td class=“label” \>\<labels class=“required”\>\</label\>\</td\>  
\<td class=“label” nowrap\>  
\<label for=“ahc\_code” class=“abled”\>  
\*  
AHC :

\</label\>  
\</td\>  
\<td align=“left” width=“12” nowrap\>  
\<a id=“qhtxt\_h\_ahc\_code” href=“javascript:uitmpl\_qhelp(‘h\_ahc\_code’,‘qhdisp\_h\_ahc\_code’);” tabindex=""\>\<img src="[?appId=gmpdispute&amp;flName=/uitmpl/en/img/quickhelp\_dk.gif](https://cstz0115.sldc.sbc.com:8201/servlet/GMPGate?appId=gmpdispute&flName=/uitmpl/en/img/quickhelp_dk.gif)" id=“qh\_img” width=“12” height=“12” alt=“Quick Help-AHC” border=“0” /\>\</a\>  
\</td\>  
\<td colspan=“6” class=“value” width=“500”\>

\<input type=“text” name=“ahc\_code” maxlength=“28” size=“40” tabindex="" value="" id=“ahc\_code” title=""\>

\<input type=“button” class=“buttonExtraSmall” value=“Submit AHC” title=“Submit AHC” onclick=“setFocus(‘ahc\_code’);javascript:this.value=this.value.toUpperCase();this.form.nextScr.value=‘setupdispute’;if (this.form.methodToCall.value != ‘refresh’) this.form.oldMethodToCall.value=this.form.methodToCall.value;this.form.methodToCall.value=this.form.oldMethodToCall.value;this.form.submit()” onkeypress=“if(chkKey(event)){setFocus(‘ahc\_code’);javascript:this.value=this.value.toUpperCase();this.form.nextScr.value=‘setupdispute’;if (this.form.methodToCall.value != ‘refresh’) this.form.oldMethodToCall.value=this.form.methodToCall.value;this.form.methodToCall.value=this.form.oldMethodToCall.value;this.form.submit()}”\>

\</TD\>  
\</TR\>

\<td class=“label” \>&nbsp;\</td\>  
\<td class=“label” \>\<labels class=“required”\>\</label\>\</td\>  
\<td class=“label” nowrap\>  
\<label for=“service\_type\_code” class=“abled”\>  
\*  
Service Type :

\</label\>  
\</td\>  
\<td align=“left” width=“12” nowrap\>  
\<a id=“qhtxt\_h\_service\_type\_code” href=“javascript:uitmpl\_qhelp(‘h\_service\_type\_code’,‘qhdisp\_h\_service\_type\_code’);” tabindex=""\>\<img src="[?appId=gmpdispute&amp;flName=/uitmpl/en/img/quickhelp\_dk.gif](https://cstz0115.sldc.sbc.com:8201/servlet/GMPGate?appId=gmpdispute&flName=/uitmpl/en/img/quickhelp_dk.gif)" id=“qh\_img” width=“12” height=“12” alt=“Quick Help-Service Type” border=“0” /\>\</a\>  
\</td\>  
\<td colspan=“6” class=“value” width=“500”\>

\<select name=“service\_type\_code” tabindex="" id=“service\_type\_code” title=“Service Type”\>\<option value=""\>Make a Selection\</option\>

\<option value=“RAV”\>ANTI-VIRUS MANAGEMENT (RAV)\</option\>  
\<option value=“CAT”\>ASYNCHRONOUS TRANSFER MODE (CAT)\</option\>  
\<option value=“MAC”\>AUDIO CONFERENCING (MAC)\</option\>  
\<option value=“MCC”\>CALL CENTER/CUSTOMER CONTACT CENTER (MCC)\</option\>  
\<option value=“WCP”\>CELLULAR/PERSONAL COMMUNICATIONS (WCP)\</option\>  
\<option value=“CSD”\>CIRCUIT SWITCHED DATA (CSD)\</option\>  
\<option value=“MCS”\>COLLABORATION SUPPORT (MCS)\</option\>  
\<option value=“MCL”\>COLLOCATED HOSTING (MCL)\</option\>  
\<option value=“COM”\>COMBINED (COM)\</option\>  
\<option value=“CTS”\>COMMUNICATIONS TRANSPORT SERVICES (CTS)\</option\>  
\<option value=“ICD”\>CONTENT DELIVERY NETWORK (ICD)\</option\>  
\<option value=“ICI”\>CONVERGED IP (ICI)\</option\>  
\<option value=“MSD”\>CUSTOMER SPECIFIC DESIGN AND ENGINEERING (MSD)\</option\>  
\<option value=“ODF”\>DARK FIBER (ODF)\</option\>  
\<option value=“MDH”\>DEDICATED HOSTING (MDH)\</option\>  
\<option value=“CEN”\>ETHERNET (CEN)\</option\>  
\<option value=“SFS”\>FIXED SATELLITE (SFS)\</option\>  
\<option value=“CFR”\>FRAME RELAY (CFR)\</option\>  
\<option value=“GEP”\>GENERAL PRICING (GEP)\</option\>  
\<option value=“GPR”\>GENERAL PRICING (GPR)\</option\>  
\<option value=“RIR”\>INCIDENT RESPONSE (RIR)\</option\>  
\<option value=“IIP”\>INTERNET PROTOCOL (IIP)\</option\>  
\<option value=“RID”\>INTRUSION DETECTION (RID)\</option\>  
\<option value=“IPS”\>IP BASED SERVICES (IPS)\</option\>  
\<option value=“IIT”\>IP TELEPHONY (IIT)\</option\>  
\<option value=“SLM”\>LAND MOBILE RADIO (SLM)\</option\>  
\<option value=“ILV”\>LAYER 2 VPN (ILV)\</option\>  
\<option value=“RME”\>MANAGED E-AUTHENTICATION (RME)\</option\>  
\<option value=“RMF”\>MANAGED FIREWALL (RMF)\</option\>  
\<option value=“MNT”\>MANAGED NETWORK (MNT)\</option\>  
\<option value=“RMT”\>MANAGED-TIERED SECURITY (RMT)\</option\>  
\<option value=“MAS”\>MANAGEMENT &amp; APPLICATION SERVICES (MAS)\</option\>  
\<option value=“SMS”\>MOBILE SATELLITE (SMS)\</option\>  
\<option value=“WMM”\>MULTIMODE WIRELESS LAN (WMM)\</option\>  
\<option value=“INB”\>NETWORK-BASED IP VPN (INB)\</option\>  
\<option value=“OBS”\>OPTICAL BASED SERVICES (OBS)\</option\>  
\<option value=“OWL”\>OPTICAL WAVELENGTH (OWL)\</option\>  
\<option value=“IPB”\>PREMISES-BASED IP VPN (IPB)\</option\>  
\<option value=“CPL”\>PRIVATE LINE (CPL)\</option\>  
\<option value=“RSM”\>SECURE MANAGED E-MAIL (RSM)\</option\>  
\<option value=“RTS”\>SECURITY SERVICES (RTS)\</option\>  
\<option value=“SPS”\>SPECIAL SERVICES (SPS)\</option\>  
\<option value=“MSS”\>STORAGE (MSS)\</option\>  
\<option value=“OSN”\>SYNCHRONOUS OPTICAL NETWORK (OSN)\</option\>  
\<option value=“MTW”\>TELEWORKING (MTW)\</option\>  
\<option value=“CTF”\>TOLL-FREE (CTF)\</option\>  
\<option value=“MUM”\>UNIFIED MESSAGING (MUM)\</option\>  
\<option value=“MVT”\>VIDEO TELECONFERENCING (MVT)\</option\>  
\<option value=“CSV”\>VOICE (CSV)\</option\>  
\<option value=“IVO”\>VOICE OVER IP TRANSPORT (IVO)\</option\>  
\<option value=“RVS”\>VULNERABILITY SCANNING (RVS)\</option\>  
\<option value=“MWC”\>WEB CONFERENCING (MWC)\</option\>  
\<option value=“WLS”\>WIRELESS SERVICES (WLS)\</option\>\</select\>

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [May 6, 2019, 2:48pm UTC](https://forum.katalon.com/t/xpath-in-groovy-script/24485/5 "2019-05-06T14:48:32Z")

</div>

Is this what you want?

```auto
WebElement optionMac = WebUICommonHelper.findWebElement(By.xpath("//select[@id='service_type_code']/option[text()='AUDIO CONFERENCING (MAC)']")
String value = optionMac.getAttribute('value') // --> "MAC"

```

---

<div class="post-metadata">

**Author:** ![vdavuluri2](https://avatars.discourse-cdn.com/v4/letter/v/ec9cab/32.png) [@vdavuluri2](https://forum.katalon.com/u/vdavuluri2)\
**Post date:** [May 7, 2019, 7:12am UTC](https://forum.katalon.com/t/xpath-in-groovy-script/24485/6 "2019-05-07T07:12:32Z")

</div>

Thanks for your reply. I have made the changes to the webelement.

It was running fine till yesterday my feature file. Now, I am getting the below error today. Can you please look into and suggest to proceed further ?

**Keyword runFeatureFile was failed (Root cause: com.kms.katalon.core.exception.StepFailedException: Feature file ‘Include/features/GMPPortal1.feature’ was failed**  
\*\* at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:48)\*\*  
at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy)  
at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:21)  
at com.kms.katalon.core.keyword.internal.KeywordMain$stepFailed$0.call(Unknown Source)  
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$\_runFeatureFile\_closure1.doCall(CucumberBuiltinKeywords.groovy:82)  
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$\_runFeatureFile\_closure1.doCall(CucumberBuiltinKeywords.groovy)  
at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:66)  
at com.kms.katalon.core.keyword.internal.KeywordMain$runKeyword.call(Unknown Source)  
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords.runFeatureFile(CucumberBuiltinKeywords.groovy:46)  
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$runFeatureFile$0.callStatic(Unknown Source)  
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords.runFeatureFile(CucumberBuiltinKeywords.groovy:101)  
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$runFeatureFile.call(Unknown Source)  
at WSVerification1557212716684.run(WSVerification1557212716684:2)  
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.WSVerificationExecutor.runScript(WSVerificationExecutor.java:146)  
at com.kms.katalon.core.main.WSVerificationExecutor.doExecute(WSVerificationExecutor.java:140)  
at com.kms.katalon.core.main.WSVerificationExecutor.processExecutionPhase(WSVerificationExecutor.java:123)  
at com.kms.katalon.core.main.WSVerificationExecutor.accessMainPhase(WSVerificationExecutor.java:115)  
at com.kms.katalon.core.main.WSVerificationExecutor.execute(WSVerificationExecutor.java:103)  
at com.kms.katalon.core.main.TestCaseMain.runFeatureFile(TestCaseMain.java:144)  
at com.kms.katalon.core.main.TestCaseMain$runFeatureFile$0.call(Unknown Source)  
at TempTempCase1557212712266.run(TempTempCase1557212712266.groovy:21)

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [May 7, 2019, 7:31am UTC](https://forum.katalon.com/t/xpath-in-groovy-script/24485/7 "2019-05-07T07:31:33Z")

</div>

The stacktrace you attached provides very little information. More info please.

> [@\[TIP\] How To Help Us Help You!](http://forum.katalon.com/t/tip-my-test-is-broken-nothing-works-please-help-me/12919):
>
> My test is BROKEN! NOTHING WORKS! HELP ME! Relax. We get it. We really do. There are some pretty smart and clever people on this forum, but you must realize, they are not magicians or wizards or gods. They cannot see your code, they can’t see your errors and they don’t even know what your AUT is meant to do even though it might seem perfectly obvious to you. So please relax and follow the advice below, before you start writing your post. The advice below will tell you the exact information …

---

<div class="post-metadata">

**Author:** ![vdavuluri2](https://avatars.discourse-cdn.com/v4/letter/v/ec9cab/32.png) [@vdavuluri2](https://forum.katalon.com/u/vdavuluri2)\
**Post date:** [May 7, 2019, 7:41am UTC](https://forum.katalon.com/t/xpath-in-groovy-script/24485/8 "2019-05-07T07:41:36Z")

</div>

Thanks for your reply. I have attached all the content from the log. And also, when I try new recording to see how this error is occurring during the record, I am finding the chrome error which is also attached.

 ![Chrome](https://europe1.discourse-cdn.com/katalon/original/2X/8/868fb824860ad31c8a472d7f4dd3dc6a3e1c9aeb.png) ![Snap1](https://europe1.discourse-cdn.com/katalon/original/2X/d/dfca43889c209f41d6bd4022e31817ace921b6ea.png) ![Snap2](https://europe1.discourse-cdn.com/katalon/original/2X/f/fe1ed4912da1162b22d38090a3f3850cbbba9ef9.png)

**Log Content:**  
05-07-2019 01:01:27 PM SCENARIO Login in GMPA Application

Elapsed time: 5.657s

SCENARIO Login in GMPA Application 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 GMPPortal.User\_is\_on\_vagb\_application(GMPPortal.groovy:60)  
at ✽.User is on VAGB Application(C:/Users/vdavuluri2/Katalon Studio/Simple/Include/features/GMPPortal1.feature:18)  
Caused by: org.openqa.selenium.SessionNotCreatedException: session not created: Chrome version must be between 70 and 73  
(Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 6.1.7601 SP1 x86\_64) (WARNING: The server did not provide any stacktrace information)  
Command duration or timeout: 2.41 seconds  
Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’  
System info: host: ‘CSCINDAE751188’, ip: ‘135.210.136.247’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0\_181’  
Driver info: driver.version: CChromeDriver  
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)  
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)  
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)  
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)  
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:123)  
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)  
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)  
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)  
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)  
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:600)  
at com.kms.katalon.selenium.driver.CChromeDriver.execute(CChromeDriver.java:20)  
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)  
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142)  
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:181)  
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:147)  
at com.kms.katalon.selenium.driver.CChromeDriver.(CChromeDriver.java:13)  
at com.kms.katalon.core.webui.driver.DriverFactory.createNewChromeDriver(DriverFactory.java:281)  
at com.kms.katalon.core.webui.driver.DriverFactory.startNewBrowser(DriverFactory.java:243)  
at com.kms.katalon.core.webui.driver.DriverFactory.openWebDriver(DriverFactory.java:188)  
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)  
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 GMPPortal.User\_is\_on\_vagb\_application(GMPPortal.groovy:60)  
at cucumber.runtime.Utils$1.call(Utils.java:26)  
at cucumber.runtime.Timeout.timeout(Timeout.java:16)  
at cucumber.runtime.Utils.invoke(Utils.java:20)  
at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:48)  
at cucumber.runtime.PickleStepDefinitionMatch.runStep(PickleStepDefinitionMatch.java:50)  
at cucumber.runner.TestStep.executeStep(TestStep.java:55)  
at cucumber.runner.TestStep.run(TestStep.java:42)  
at cucumber.runner.PickleStepTestStep.run(PickleStepTestStep.java:53)  
at cucumber.runner.TestCase.run(TestCase.java:47)  
at cucumber.runner.Runner.runPickle(Runner.java:44)  
at cucumber.runtime.Runtime.runFeature(Runtime.java:120)  
at cucumber.runtime.Runtime.run(Runtime.java:106)  
at cucumber.api.cli.Main.run(Main.java:35)  
at cucumber.api.cli.Main$run.call(Unknown Source)  
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$\_runFeatureFile\_closure1.doCall(CucumberBuiltinKeywords.groovy:76)  
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$\_runFeatureFile\_closure1.doCall(CucumberBuiltinKeywords.groovy)  
at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:66)  
at com.kms.katalon.core.keyword.internal.KeywordMain$runKeyword.call(Unknown Source)  
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords.runFeatureFile(CucumberBuiltinKeywords.groovy:46)  
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$runFeatureFile$0.callStatic(Unknown Source)  
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords.runFeatureFile(CucumberBuiltinKeywords.groovy:101)  
at com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords$runFeatureFile.call(Unknown Source)  
at WSVerification1557214285692.run(WSVerification1557214285692:2)  
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.WSVerificationExecutor.runScript(WSVerificationExecutor.java:146)  
at com.kms.katalon.core.main.WSVerificationExecutor.doExecute(WSVerificationExecutor.java:140)  
at com.kms.katalon.core.main.WSVerificationExecutor.processExecutionPhase(WSVerificationExecutor.java:123)  
at com.kms.katalon.core.main.WSVerificationExecutor.accessMainPhase(WSVerificationExecutor.java:115)  
at com.kms.katalon.core.main.WSVerificationExecutor.execute(WSVerificationExecutor.java:103)  
at com.kms.katalon.core.main.TestCaseMain.runFeatureFile(TestCaseMain.java:144)  
at com.kms.katalon.core.main.TestCaseMain$runFeatureFile$0.call(Unknown Source)  
at TempTempCase1557214282652.run(TempTempCase1557214282652.groovy:21)

---

<div class="post-metadata">

**Author:** ![HeleneB](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/heleneb/32/2775_2.png) [@HeleneB](https://forum.katalon.com/u/HeleneB)\
**Post date:** [May 7, 2019, 7:55am UTC](https://forum.katalon.com/t/xpath-in-groovy-script/24485/9 "2019-05-07T07:55:57Z")

</div>

> [@vdavuluri2](#):
>
> Caused by: org.openqa.selenium.SessionNotCreatedException: session not created: Chrome version must be between 70 and 73  
> (Driver info: chromedriver=73.0.3683.68

For the Chrome error, update your Katalon Studio

> **[Release v6.1.3: Merge pull request #143 from katalon-studio/release-6.1.3 ·...](https://github.com/katalon-studio/katalon-studio/releases/tag/v6.1.3)**
>
> Contribute to katalon-studio/katalon-studio development by creating an account on GitHub.

or your chrome driver

> [@Unable to Open Chrome Driver Browser](http://forum.katalon.com/t/unable-to-open-chrome-driver-browser/23883/3):
>
> Hi @Sample, If your current Chrome browser version is v74, please follow these steps: Manually download chromedriver at this link [https://chromedriver.storage.googleapis.com/index.html?path=74.0.3729.6/](https://chromedriver.storage.googleapis.com/index.html?path=74.0.3729.6/). Extract and replace the current chromedriver in: Windows 32bit: \<KS\_folder\>/configuration/resources/drivers/chromedriver\_win32 Windows 64bit: \<KS\_folder\>/configuration/resources/drivers/chromedriver\_win64 macOS: /Applications/Katalon Studio.app/Contents/Eclipse/configuration/resources/dr…

---

<div class="post-metadata">

**Author:** ![vdavuluri2](https://avatars.discourse-cdn.com/v4/letter/v/ec9cab/32.png) [@vdavuluri2](https://forum.katalon.com/u/vdavuluri2)\
**Post date:** [May 7, 2019, 9:25am UTC](https://forum.katalon.com/t/xpath-in-groovy-script/24485/10 "2019-05-07T09:25:25Z")

</div>

Thank You, it is working fine now. I have upgraded the chrome driver.

Another thing that I am finding the error is again related to findWebElement. Can you please look into it ?

**Code:**  
@And (“select the service as (.\*)”)  
def select\_the\_service\_number\_with(String servicec) {  
WebElement textArea = WebUiCommonHelper.findWebElement(By.xpath("//select[@id=‘service\_type\_code’]"), 10)  
textArea.selectByValue(servicec)  
WebUI.delay(10)  
}

**Error from the log:**  
05-07-2019 02:48:50 PM select the service as WEB CONFERENCING (MWC)

Elapsed time: 0.073s

GMPDispute.select\_the\_service\_number\_with:261

select the service as WEB CONFERENCING (MWC) FAILED.  
Reason:  
groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webui.common.WebUiCommonHelper.findWebElement() is applicable for argument types: (org.openqa.selenium.By$ByXPath, java.lang.Integer) values: [By.xpath: //select[@id=‘service\_type\_code’], 10]  
Possible solutions: findWebElement(com.kms.katalon.core.testobject.TestObject, int), findWebElements(com.kms.katalon.core.testobject.TestObject, int)  
at GMPDispute.select\_the\_service\_number\_with(GMPDispute.groovy:261)  
at ✽.select the service as WEB CONFERENCING (MWC)(C:/Users/vdavuluri2/Katalon Studio/Simple/Include/features/GMPDispute.feature:67)

---

<div class="post-metadata">

**Author:** ![HeleneB](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/heleneb/32/2775_2.png) [@HeleneB](https://forum.katalon.com/u/HeleneB)\
**Post date:** [May 7, 2019, 9:39am UTC](https://forum.katalon.com/t/xpath-in-groovy-script/24485/11 "2019-05-07T09:39:03Z")

</div>

> [@vdavuluri2](#):
>
> Reason:  
> groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webui.common.WebUiCommonHelper.findWebElement() is applicable for argument types: **(org.openqa.selenium.By$ByXPath**, java.lang.Integer) values: [By.xpath: //select[@id=‘service\_type\_code’], 10]  
> Possible solutions: findWebElement( **com.kms.katalon.core.testobject.TestObject** , int), findWebElements(com.kms.katalon.core.testobject.TestObject, int)

You have to create a TestObject in ObjectRepository, then call

```auto
WebUiCommonHelper.findWebElement(findTestObject('path of the created object'), 10)

```

---

<div class="post-metadata">

**Author:** ![vdavuluri2](https://avatars.discourse-cdn.com/v4/letter/v/ec9cab/32.png) [@vdavuluri2](https://forum.katalon.com/u/vdavuluri2)\
**Post date:** [May 7, 2019, 9:41am UTC](https://forum.katalon.com/t/xpath-in-groovy-script/24485/12 "2019-05-07T09:41:30Z")

</div>

no… i am using xpath because the test object was too long and it cannot be stored in object repository.  
so… I cannot store it the object repository.

---

<div class="post-metadata">

**Author:** ![HeleneB](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/heleneb/32/2775_2.png) [@HeleneB](https://forum.katalon.com/u/HeleneB)\
**Post date:** [May 7, 2019, 9:47am UTC](https://forum.katalon.com/t/xpath-in-groovy-script/24485/13 "2019-05-07T09:47:17Z")

</div>

I don’t understand why it couldn’t work like this 🤔

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/c/cbad638f4568458ba5f8a588f1079e42e41ce761.png)

```auto
WebUiCommonHelper.findWebElement(findTestObject('select_type_code'), 10)

```

---

<div class="post-metadata">

**Author:** ![vdavuluri2](https://avatars.discourse-cdn.com/v4/letter/v/ec9cab/32.png) [@vdavuluri2](https://forum.katalon.com/u/vdavuluri2)\
**Post date:** [May 7, 2019, 9:56am UTC](https://forum.katalon.com/t/xpath-in-groovy-script/24485/14 "2019-05-07T09:56:47Z")

</div>

Please find the attached file for your reference..

 ![Scrn1](https://europe1.discourse-cdn.com/katalon/original/2X/6/636ab119ea370fd653b0c00363341d4fb0f67a8d.png)

---

<div class="post-metadata">

**Author:** ![vdavuluri2](https://avatars.discourse-cdn.com/v4/letter/v/ec9cab/32.png) [@vdavuluri2](https://forum.katalon.com/u/vdavuluri2)\
**Post date:** [May 7, 2019, 9:58am UTC](https://forum.katalon.com/t/xpath-in-groovy-script/24485/15 "2019-05-07T09:58:45Z")

</div>

do you want me to rename it ?  
OR then when do we use the xpath ?

---

<div class="post-metadata">

**Author:** ![HeleneB](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/heleneb/32/2775_2.png) [@HeleneB](https://forum.katalon.com/u/HeleneB)\
**Post date:** [May 7, 2019, 10:02am UTC](https://forum.katalon.com/t/xpath-in-groovy-script/24485/16 "2019-05-07T10:02:03Z")

</div>

Right click on ObjectRepository, create a Folder “Page\_Create Dispute”. Then, on this Folder, right click and create a new TestObject, give it a short name like in my example, and use your XPath in Selector Editor

Edit : I See you also can rename the object in “Object Properties” then “Object name” directly in Object Spy

---

<div class="post-metadata">

**Author:** ![vdavuluri2](https://avatars.discourse-cdn.com/v4/letter/v/ec9cab/32.png) [@vdavuluri2](https://forum.katalon.com/u/vdavuluri2)\
**Post date:** [May 7, 2019, 10:17am UTC](https://forum.katalon.com/t/xpath-in-groovy-script/24485/17 "2019-05-07T10:17:33Z")

</div>

@And (“select the service as (.\*)”)  
def select\_the\_service\_number\_with(String servicec) {  
WebElement textArea = WebUiCommonHelper.findWebElement(findTestObject(By.xpath("//select[@id=‘service\_type\_code’]"), 10))  
textArea.selectByValue(servicec)  
WebUI.delay(10)  
}

Is this looks fine ?

---

<div class="post-metadata">

**Author:** ![vdavuluri2](https://avatars.discourse-cdn.com/v4/letter/v/ec9cab/32.png) [@vdavuluri2](https://forum.katalon.com/u/vdavuluri2)\
**Post date:** [May 7, 2019, 10:29am UTC](https://forum.katalon.com/t/xpath-in-groovy-script/24485/18 "2019-05-07T10:29:52Z")

</div>

**Again… I am receiving the same error…**

05-07-2019 03:57:02 PM select the service as WEB CONFERENCING (MWC)

Elapsed time: 0.078s

GMPDispute.select\_the\_service\_number\_with:261

select the service as WEB CONFERENCING (MWC) FAILED.  
Reason:  
groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.testobject.ObjectRepository.findTestObject() is applicable for argument types: (org.openqa.selenium.By$ByXPath, java.lang.Integer) values: [By.xpath: //select[@id=‘service\_type\_code’], 10]  
Possible solutions: findTestObject(java.lang.String), findTestObject(java.lang.String, java.util.Map)  
at GMPDispute.select\_the\_service\_number\_with(GMPDispute.groovy:261)  
at ✽.select the service as WEB CONFERENCING (MWC)(C:/Users/vdavuluri2/Katalon Studio/Simple/Include/features/GMPDispute.feature:67)

---

<div class="post-metadata">

**Author:** ![HeleneB](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/heleneb/32/2775_2.png) [@HeleneB](https://forum.katalon.com/u/HeleneB)\
**Post date:** [May 7, 2019, 11:38am UTC](https://forum.katalon.com/t/xpath-in-groovy-script/24485/19 "2019-05-07T11:38:08Z")

</div>

You don’t change the TestObject

```auto
@And (“select the service as (.*)”)
def select_the_service_number_with(String servicec) {
WebElement textArea = WebUiCommonHelper.findWebElement(findTestObject("Page_Create Dispute/name of the object"), 10)
textArea.selectByValue(servicec)
WebUI.delay(10)
}

```

Replace “name of the object” by the name you give to the Object

---

<div class="post-metadata">

**Author:** ![vdavuluri2](https://avatars.discourse-cdn.com/v4/letter/v/ec9cab/32.png) [@vdavuluri2](https://forum.katalon.com/u/vdavuluri2)\
**Post date:** [May 7, 2019, 12:53pm UTC](https://forum.katalon.com/t/xpath-in-groovy-script/24485/20 "2019-05-07T12:53:22Z")

</div>

still there is an error… can you please suggest !!

**Code:**  
@And (“select the service as (.\*)”)  
def select\_the\_service\_number\_with(String servicec) {  
WebElement textArea = WebUiCommonHelper.findWebElement(findTestObject(‘Object Repository/Page\_Create Dispute/servicetype\_code’, 10))  
textArea.selectOptionByValue(servicec)

**Error Log**  
05-07-2019 06:18:03 PM select the service as WEB CONFERENCING (MWC)

Elapsed time: 0.051s

GMPDispute.select\_the\_service\_number\_with:264

select the service as WEB CONFERENCING (MWC) FAILED.  
Reason:  
groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.testobject.ObjectRepository.findTestObject() is applicable for argument types: (java.lang.String, java.lang.Integer) values: [Object Repository/Page\_Create Dispute/servicetype\_code, 10]  
Possible solutions: findTestObject(java.lang.String), findTestObject(java.lang.String, java.util.Map), findRequestObject(java.lang.String, java.io.File)  
at GMPDispute.select\_the\_service\_number\_with(GMPDispute.groovy:264)  
at ✽.select the service as WEB CONFERENCING (MWC)(C:/Users/vdavuluri2/Katalon Studio/Simple/Include/features/GMPDispute.feature:67)

[Next page](https://forum.katalon.com/t/xpath-in-groovy-script/24485.md?page=2)
