# I want to get testobecjt xpath

**URL:** <https://forum.katalon.com/t/i-want-to-get-testobecjt-xpath/35145>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [October 23, 2019, 8:57am UTC](https://forum.katalon.com/t/i-want-to-get-testobecjt-xpath/35145 "2019-10-23T08:57:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![1018742342](https://avatars.discourse-cdn.com/v4/letter/1/f475e1/32.png) [@1018742342](https://forum.katalon.com/u/1018742342)\
**Post date:** [October 23, 2019, 8:57am UTC](https://forum.katalon.com/t/i-want-to-get-testobecjt-xpath/35145/1 "2019-10-23T08:57:53Z")

</div>

```
@Keyword
def waitLocationDisplay(TestObject to, int timeout){
	WebDriver driver = DriverFactory.getWebDriver()
	WebDriverWait wait = new WebDriverWait(driver, 30)
             //
             //  
	wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(xpath)))
}
 i create a parameter TestObject " to", i want to get to's xpath ,how
```

---

<div class="post-metadata">

**Author:** ![ThanhTo](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thanhto/32/697_2.png) [@ThanhTo](https://forum.katalon.com/u/ThanhTo)\
**Post date:** [October 23, 2019, 9:10am UTC](https://forum.katalon.com/t/i-want-to-get-testobecjt-xpath/35145/2 "2019-10-23T09:10:07Z")

</div>

Hi @1018742342

Please refer to the accepted answer of this post:

> [@How to obtain xpath from the Xpath Selection Method](http://forum.katalon.com/t/how-to-obtain-xpath-from-the-xpath-selection-method/13133/2):
>
> import static com.kms.katalon.core.testobject.ObjectRepository.findTestObjectimport com.kms.katalon.core.testobject.SelectorMethod String path = findTestObject("test/object").getSelectorCollection().get(SelectorMethod.XPATH)

---

<div class="post-metadata">

**Author:** ![1018742342](https://avatars.discourse-cdn.com/v4/letter/1/f475e1/32.png) [@1018742342](https://forum.katalon.com/u/1018742342)\
**Post date:** [October 23, 2019, 9:54am UTC](https://forum.katalon.com/t/i-want-to-get-testobecjt-xpath/35145/3 "2019-10-23T09:54:58Z")

</div>

can i use js to submit form

```
@Keyword
def clickJquery(){
WebDriver driver = DriverFactory.getWebDriver()
String js = "var checkoutNowForm = $('#CheckoutNowForm'); var selectedPaymentType= $(':input[name=selectedPaymentType]:checked').val();checkoutNowForm.find('#selectedPaymentType').val(selectedPaymentType);var selectedShippingType= $(':input[name=selectedShippingType]:checked').val();checkoutNowForm.find('#selectedShippingType').val(selectedShippingType);checkoutNowForm.submit();"
driver.execute_script(js)
}

```

like this

---

<div class="post-metadata">

**Author:** ![ThanhTo](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thanhto/32/697_2.png) [@ThanhTo](https://forum.katalon.com/u/ThanhTo)\
**Post date:** [October 23, 2019, 10:09am UTC](https://forum.katalon.com/t/i-want-to-get-testobecjt-xpath/35145/4 "2019-10-23T10:09:16Z")

</div>

Yes, you can, provided the javascript is correct.

---

<div class="post-metadata">

**Author:** ![1018742342](https://avatars.discourse-cdn.com/v4/letter/1/f475e1/32.png) [@1018742342](https://forum.katalon.com/u/1018742342)\
**Post date:** [October 23, 2019, 10:14am UTC](https://forum.katalon.com/t/i-want-to-get-testobecjt-xpath/35145/5 "2019-10-23T10:14:42Z")

</div>

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

| Description | Resource | Path | Location | Type |
| --- | --- | --- | --- | --- |
| Groovy:illegal string body character after dollar sign; | operationTools.groovy | /POC.prj/Keywords/tools | line 34 | Java Problem |
| but it failed with error . | | | | |
| katalon version 6.3.2 | | | | |

---

<div class="post-metadata">

**Author:** ![ThanhTo](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thanhto/32/697_2.png) [@ThanhTo](https://forum.katalon.com/u/ThanhTo)\
**Post date:** [October 23, 2019, 10:25am UTC](https://forum.katalon.com/t/i-want-to-get-testobecjt-xpath/35145/6 "2019-10-23T10:25:08Z")

</div>

Hi @1018742342

Try to wrap the string with triple quotes instead of double quotes.
