Selenium tag with error flag


#1

This sample shows how to catch RPA processing issue and use it inside business process like true/false flag
site_chaged - flag is true by default

<?xml version="1.0" encoding="UTF-8"?>
<config>
	<script><![CDATA[
		import com.thoughtworks.selenium.*;
		import org.openqa.selenium.*;
		import java.util.concurrent.TimeUnit;
		profilePage = "";
		profilePageCase = "";
	]]></script>

	<var-def name="xmlValue" />

	<var-def name="search_case_number">
		<template>${search_case_number}</template>
	</var-def>

	<var-def name="first_name">
		<template>${first_name}</template>
	</var-def>

	<var-def name="last_name">
		<template>${last_name}</template>
	</var-def>

	<var-def name="dob">
		<template>${dob}</template>
	</var-def>

	<var-def name="site_chaged">
		<template>false</template>
	</var-def>

	<var-def name="site_chaged">
		<template>false</template>
	</var-def>

	<var-def name="source_name">
		<template>Duval County Clerk of Courts</template>
	</var-def>

	<var-def name="source_search_url">
		<template>https://core.duvalclerk.com/CoreCms.aspx?mode=PublicAccess
		</template>
	</var-def>

	<try>
		<body>

			<selenium-flow>
				<selenium name="seleniumDriver" browser="chrome"
					close-on-completion="true">
					<script><![CDATA[
						driver = seleniumDriver.getWrappedObject();
						driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS).pageLoadTimeout(1, TimeUnit.MINUTES);
						driver.get(source_search_url.toString());
						SeleniumFunctions.waitUntilVisible(By.id("form1"),30,driver).click();

						SeleniumFunctions.waitUntilClickable(By.xpath("//div[@id='ContentPlaceHolder1_c_TabContainerDiv']//tr[5]/td[@class='caseSearchFieldInput']/input[contains(@name,'LastName')]"),driver).sendKeys(new String[]{
							last_name.toString().trim()
						});

						SeleniumFunctions.waitUntilClickable(By.xpath("//div[@id='ContentPlaceHolder1_c_TabContainerDiv']//tr[5]/td[@class='caseSearchFieldInput']/input[contains(@name,'FirstName')]"),driver).sendKeys(new String[]{
							first_name.toString().trim()
						});

						SeleniumFunctions.waitUntilClickable(By.xpath("//div[@id='ContentPlaceHolder1_c_TabContainerDiv']//td[@class='caseSearchFooter']/input[@value='Begin Search']"),driver).click();

						SeleniumFunctions.waitUntilVisible(By.xpath("//table[@class='resultGrid']"),30,driver);
					]]></script>
				</selenium>
			</selenium-flow>

		</body>
		<catch>
			<var-def name="site_chaged">
				<template>true</template>
			</var-def>
		</catch>
	</try>
	<export include-original-data="true">
		<single-column name="site_chaged" value='${site_chaged}' />
	</export>
</config>

#2

@azinchuk

Is it worth to have same in KB?


#3

sure, will add