Search Results

Search found 8 results on 1 pages for 'gagneet'.

Page 1/1 | 1 

  • Open a URL with parameters using selenium.open()

    - by gagneet
    I am using selenium.open(), to open a URL, which prints the cookie output to the browser window: String cookiestr = "http://my.server.com/cookie?out=text"; selenium.open( cookiestr ); The problem is that, it opens a "Save As..." popup, to save the file named "cookie". When I open the same URL in my browser directly, it displays text in the browser window. I want to capture the body text shown, when I open the URL, but am unable to do so. Is there any other command available which I can use to do this? BufferedWriter outputfile = null; String bodytext = selenium.getBodyText(); System.out.println("Body Text :" + bodytext); Integer I = new Integer(i); filename = "C:\\cookies\\" + I.toString() + ".txt"; outputfile = new BufferedWriter(new FileWriter( filename )); outputfile.write( bodytext ); outputfile.newLine(); i++;

    Read the article

  • Algorithm for max integer in an array of integers

    - by gagneet
    Explain which algorithm you would use to implement a function that takes an array of integers and returns the maximum integer in the collection, assuming that the length of the array is less than 1000. Would you use Bubble Sort or Merge Sort and Why? Also, what happens to the above algorithm choice, if the array length is greater than 1000?

    Read the article

  • Finding duplicate files by content across multiple directories

    - by gagneet
    I have downloaded some files from the internet related to a particular topic. Now I wish to check if the files have any duplicates. The issue is that the names of the files would be different, but the content may match. Is there any way to implement some code, which will iterate through the multiple folders and inform which of the files are duplicates?

    Read the article

  • How to checkout a case sensitive SVN source code branch to a case insensitive system?

    - by gagneet
    I am working on a Macbook system , which is formatted as a case insensitive system. The issue is that, I need to check out a SVN branch which has some case sensitive files in it. Example: inbuilt-file.c InBuilt-File.c How do I checkout this branch when both the files are in the same folder? When I try and checkout, it gives me an error stating that an unversioned file of the name already exists.

    Read the article

  • Parsing line and selecting values corresponding to a key

    - by gagneet
    there is a set of data which is arranged in a specific manner (as a tree), as is given below. basically a key=value pair, with some additional values at the end, which informs how many children does the branch have and some junk value. 11=1 123 2 11=1>1=45 234 1 11=1>1=45>9=16 345 1 11=1>1=45>9=16>2=34 222 1 11=1>1=45>9=16>2=34>7=0 2234 1 11=1>1=45>9=16>2=34>7=0>8=0 22345 1 11=1>1=45>9=16>2=34>7=0>8=0>0=138 22234 1 11=1>1=45>9=16>2=34>7=0>8=0>0=138>5=0 5566 1 11=1>1=45>9=16>2=34>7=0>8=0>0=138>5=0>4=0 664 1 11=1>1=45>9=16>2=34>7=0>8=0>0=138>5=0>4=0>6=10 443 1 11=1>1=45>9=16>2=34>7=0>8=0>0=138>5=0>4=0>6=10>3=11 445 0 11=1>1=47 4453 1 11=1>1=47>9=16 887 1 11=1>1=47>9=16>2=34 67 1 11=1>1=47>9=16>2=340>7=0 98 1 11=1>1=47>9=16>2=34>7=0>8=0 654 1 11=1>1=47>9=16>2=34>7=0>8=0>0=138 5789 1 11=1>1=47>9=16>2=34>7=0>8=0>0=138>5=0 9870 1 11=1>1=47>9=16>2=34>7=0>8=0>0=138>5=0>4=0 3216 1 11=1>1=47>9=16>2=34>7=0>8=0>0=138>5=0>4=0>6=10>3=11 66678 0 my problem is to get the appropriate branch from the above data, which satisfies exactly the values, which i give as the input. suppose, my input value to search in the above data stack are: 5=0 4=0 6=10 3=11 11=1 1=45 0=138 9=16 2=34 7=0 8=0 for the above given list of key-values, the function should return 11=11=459=162=347=08=00=1385=04=06=103=11 as the match. likewise, for another input file, in which another set of keys is given: 5=0 4=0 6=10 3=11 11=1 1=45 9=16 2=34 7=0 8=0 the function should return 11=11=459=162=347=08=0 1 as the match. not the last line; as that would also match all the values given in my input key, but, i want only the exact match. Also, I want to find out how many nodes were selected in the given array. (separated by ). What will be the best way to implement this kind of scenario?

    Read the article

  • Capture output from browser call using Selenium

    - by gagneet
    I need to create a use case (using Selenium) in which I send HTTP calls with a Cookie through the browser and capture the return value in a text file. What do I need to do this, I have run this using CURL in the command line, but we are encountering issues with the same, and hence wish to verify using a real UI browser.

    Read the article

  • Sending multiple requests simultaneously to the Server using Selenium with Java

    - by gagneet
    I wish to send multiple requests to the server, simultaneously. The problem statement will be: Read a text file containing multiple URL’s. Open each URL in the web browser. Collect the Cookie information for each call, and store it to a file. Send another call: http://myserver.com:1111/cookie?out=text Store the output (body text) of this file to a separate file for each call made in 4 Open the next URL in the text file given in 1 and repeat steps 1-6. The above is to be run with multi-threading, so that I can send around 5-10 URL requests simultaneously. I have implemented something in Selenium using Java, but have not been able to do the multi-threading approach. Code is given below: package com.cookie.selenium; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import com.thoughtworks.selenium.*; public class ReadURL extends SeleneseTestCase { public void setUp() throws Exception { setUp("http://www.myserver.com/", "*chrome"); } public static void main(String args[]) { Selenium selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://myserver"); selenium.start(); selenium.setTimeout("30000000"); try { BufferedReader inputfile = new BufferedReader(new FileReader("C:\\url.txt")); BufferedReader cookietextfile = new BufferedReader(new FileReader("C:\\text.txt")); BufferedWriter cookiefile = new BufferedWriter(new FileWriter("C:\\cookie.txt")); BufferedWriter outputfile = null; String str; String cookiestr = "http://myserver.com:1111/cookie?out=text"; String filename = null; int i = 0; while ((str = inputfile.readLine()) != null) { selenium.createCookie("T=222redHyt345&f=5&r=fg&t=100",""); selenium.open( str ); selenium.waitForPageToLoad("120000"); String urlcookie = selenium.getCookie(); System.out.println( "URL :" + str ); System.out.println( "Cookie :" + urlcookie ); cookiefile.write( urlcookie ); cookiefile.newLine(); selenium.open( cookiestr ); selenium.waitForPageToLoad("120000"); String bodytext = selenium.getBodyText(); System.out.println("Body Text :" + bodytext); filename = "C:\\cookies\\" + i + ".txt"; outputfile = new BufferedWriter(new FileWriter( filename )); outputfile.write( bodytext ); outputfile.newLine(); i++; } inputfile.close(); outputfile.close(); cookiefile.close(); selenium.stop(); } catch (IOException e) { } } } What basically I am trying to do here is, open the first set of URL from a text file (which has list given of all the URL's i wish to open). Then when I capture the cookie information from here and store it, I open another window to output all the cookie information for that server to my browser window. This works fine when I do outside of Selenium code, but when I do it within the above code, it opens a "Save As..." popup and my tests stop. :-( I wish to save the contents of that second call to a new file, but have not been able to do the same. Also, if I have to send multiple such requests to the server, how would that be possible in Java using a Selenium Framework. Currently, I am opening multiple instances of the framework and running them with different parameters :-(

    Read the article

1