0

My problem:

How to check content of this txt file opened in new firefox window???

Please help me!

  • Assert that Driver.FindElement(ByCssSelector="pre").Text.Contains("what you want") or (would be better) download file and use programming language methods to read file content – Slava Klevchenia Jan 18 '15 at 5:50
1

Because you're opening a new tab in your browser, you can follow this pattern.

  1. Once the tab is opened, make Selenium switch its focus to it. If you don't know how, this question has got several answers here or elsewhere.
  2. Apparently, Firefox puts the file content in a <pre> tag so you have a valid HTML document. So it's easy to use driver.findElement to get the contents in the tag.
  3. You now have the whole file's contents to do the string operations you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.