Home > Net >  How to verify search result for having results with only Nonstop flights
How to verify search result for having results with only Nonstop flights

Time:11-09

My Scenario is writing a script to search flights from Los Angles to Houston George Bush Internationational Air port with filters

  1. Oneway Flight
  2. Nonstop flight

I got search result as in picture

enter image description here

Now I want to verify results that it should be only having Nonstop flights or not

How i could do this?

I'm using Testcafe testing framework

Code that i am writing

Error message i got on console

CodePudding user response:

Use assertions to check if the tested page’s state matches the expected state.

CodePudding user response:

Could you try the following code snippet in your test:

test('test name', async t =\> {​​​​​​
const elVal = await Selector('#ELEMENTID').value    
console.log(elVal)
}​​​​​​);

I suppose you need to use the Selector Object in your test, since the ClientFunction Object is intended for retrieving serialized data, so you cannot use the result of ClientFunction for working directly with DOM objects.

  • Related