<commit_before># Test for new windows
# revision: $Revision$

$LOAD_PATH.<< File.join(File.dirname(__FILE__), '..')
require 'unittests/setup'

class TC_Links < Test::Unit::TestCase
   
    def test_newWindows 
        $ie.captureEvents
        $ie.goto($htmlRoot + 'links1.html')
        $ie.link(:index ,5).click
        ie2 = $ie.newWindow
        ie2.link(:index ,5).click
    end
end<commit_msg>added error checking in case new window doesnt open<commit_after># Test for new windows
# revision: $Revision$

$LOAD_PATH.<< File.join(File.dirname(__FILE__), '..')
require 'unittests/setup'

class TC_Links < Test::Unit::TestCase
   
    def test_newWindows 
        $ie.captureEvents
        $ie.goto($htmlRoot + 'links1.html')
        $ie.link(:index ,5).click
        ie2 = $ie.newWindow
        if ie2 == nil
          puts "Couldnt get newly opened window."
        else
          ie2.link(:index ,5).click
        end
    end
end
{'fraction_non_alphanumeric': 0.12941176470588237, 'fraction_numerical': 0.011764705882352941, 'mean_word_length': 2.627906976744186, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '107442', 'n_tokens_mistral': 308, 'n_tokens_neox': 301, 'n_words': 72}