Answered

Text comparison fail

Hello,

 

I am trying to compare web value with local variable as seen in attachment. The test is failing due to the

The fact that the collected web value is disregarding the quotation marks.

I have verified the same Xpath and the returned text shows the full text with quotation marks as seen in attachment.

Please advise.

 

Thank you,

0
12 comments

Official comment

Avatar
Rex Feizi

Rexiti,

If you could provide the HTML of the page(or part that is necessary) as well as the text you are using, I can check to see if I can reproduce the issue.

Meanwhile, what I’m not understanding is the need to compare tags in plain text. I would have used Verify-Element with XPath expression to check anything I want against a tag in HTML.

Comment actions Permalink
Avatar
Payam Fard

Rexiti, would you please explain the reason as to why you are trying to do this? Why not use a verify_text or verify_element for this comparison/assertion?

0
Comment actions Permalink
Avatar
Jay Rexiti

I am using these commands because we are trying to compare a web value against a local variable. which I don't believe can be accomplished by verify_text or element.

I have used other text comparing tools online and the text is passing but somehow when using compare text command in proof it is failing.

 

0
Comment actions Permalink
Avatar
Jay Rexiti

It is a code snippet displayed on the DDS standards application. We are trying to compare that code snipped which is displayed as text on the web page.

 

0
Comment actions Permalink
Avatar
Jay Rexiti

You can find the test cases facing this issue under HOME> CVP_IVV> IVV_DDS> IVV_DDS_COMPONENTS_SMOKE>

all the test cases under this suite will have the same first 6 or 7 steps to verify code snippet.

Thank you,

0
Comment actions Permalink
Avatar
Rex Feizi

Please post them here as we don’t have access to your account.

Also, please elaborate as to why you feel then need to use such comparisons, when you have verify_element that was built for such scenarios.

Thanks

0
Comment actions Permalink
Avatar
Jay Rexiti

Verify_element will tell me if a element with a certain text exists or not etc, I am trying to see if the element has the same text as what I have locally stored. that is why I am using this type of comparison. 

0
Comment actions Permalink
Avatar
Jay Rexiti

I have attached two screenshots with the code snippet and test case.

0
Comment actions Permalink
Avatar
Jay Rexiti

 

 

 

Please take a look at two attachments.

When I compare two strings (retrieved from web value) it is passing(First Image above), however when I try to compare local with web value it is failing (Second Image above).

It is odd that two identical strings are failing when I get the value from the web element using get_web_value.

 

Thank you,

 

 

0
Comment actions Permalink
Avatar
Jay Rexiti

Rex and Payam,

Any update on this issue?

Thank you,

0
Comment actions Permalink
Avatar
Rex Feizi

Unfortunately, we cannot reproduce the issue on our environment. We need the DOM in text format as well as the actual command in text to be able to try this.

More important, why can’t you use Verify_Element with XPath to check for existence of an HTML tag? Compare doesn’t make that much sense in this scenario anyway.

0
Comment actions Permalink
Avatar
Jay Rexiti

I am not trying to verify the HTML tag, there is a sample code snipped I am trying to verify. I am not sure If we have permission to post that information on a public forum

I will have to double check.

0
Comment actions Permalink

Please sign in to leave a comment.