@Rosary_Philip
The following code will do what you want:
TestObject tObj = new TestObject(text).addProperty("xpath", ConditionType.EQUALS,
'//span[contains(.,"Ultimatrix") and contains(.,"Data") and contains(.,"Hub") and contains(.,":") and contains(.,"DHANYA(527014)") and contains(.,"have") and contains(.,"reject") and contains(.,"3") and contains(.,"row(s)") and contains(.,"from") and contains(.,"S1") and contains(.,"in") and contains(.,"DemoMailer2") and contains(.,"-") and contains(.,"2020") and contains(.,"FY") and contains(.,"Q4") and contains(.,"-") and contains(.,"Projection")]'
)
WebUI.verifyElementPresent(tObj, 10, FailureHandling.CONTINUE_ON_FAILURE)
I Tried this, but its too Lengthy and Time taken…Is thr any other way to create…I means where it handles " "
You should be able to write a Groovy function which
- as an input parameter, takes a string
"Ultimatrix Data Hub : DHANYA(527014) have reject 3 row(s) from S1 in DemoMailer2 - 2020 FY Q4 - Projection"
- based on the given string, generates and return a XPath expression string
'//span[contains(.,"Ultimatrix") and contains(.,"Data") and contains(.,"Hub") and contains(.,":") and contains(.,"DHANYA(527014)") and contains(.,"have") and contains(.,"reject") and contains(.,"3") and contains(.,"row(s)") and contains(.,"from") and contains(.,"S1") and contains(.,"in") and contains(.,"DemoMailer2") and contains(.,"-") and contains(.,"2020") and contains(.,"FY") and contains(.,"Q4") and contains(.,"-") and contains(.,"Projection")]'
It is just a string-to-string transformation. Please try to develop that Groovy code for yourself.