2 browser when i execute test case

Hi,

When i execute one testcase i have 2 browser open in the beginning of execution:
one is towards atlassian.com
and the other it’s pagesjaunes.fr

I would like to delete the opening of atlassian.com

this is my script :

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import org.openqa.selenium.By as By
import org.openqa.selenium.WebDriver as WebDriver
import org.openqa.selenium.WebElement as WebElement
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import internal.GlobalVariable as GlobalVariable
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Date;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.lang.String

WebUI.navigateToUrl(‘https://www.pagesjaunes.fr/’)
WebUI.delay(5)
WebUI.setText(findTestObject(‘Pagesjaunes/Page_Accueil/input_quoi qui _quoiqui’), ‘architecte’)

WebUI.setText(findTestObject(‘Pagesjaunes/Page_Accueil/input_o _ou’), ‘ile-de-france’)

WebUI.click(findTestObject(‘Pagesjaunes/Page_Accueil/i_A proximit_icon icon-search’))

//Création d’un objet Email:
/TestObject button_email = new TestObject(‘Email Button’)
a=2
button_confirm.addProperty(‘title’, ConditionType.EQUALS, ‘E-Mail’)
WebUI.click(button_confirm)
a=1
/
WebUI.delay(5)

//aide brandon_hein
WebDriver driver = DriverFactory.getWebDriver()

List buttons = driver.findElements(By.xpath(’//a[@title=‘E-Mail’]’))

a = buttons.size()

//println(a)
//age = (22 + 5)
//phrase = ((‘Le capitaine a ’ + age) + ’ ans’)
//println(phrase + age)

//Write Excel File
//Déclaration et Ouverture
//FileInputStream file = new FileInputStream (new File(“E:\Testdata.xlsx”))
//XSSFWorkbook workbook = new XSSFWorkbook(file);
//XSSFSheet sheet = workbook.getSheetAt(0);

//récupérer le nom du prospect à qui ont a envoyé le message
//WebUI.openBrowser(‘https://www.katalon.com/’)
//def driver = DriverFactory.getWebDriver()
//String baseUrl = “https://www.katalon.com/
//selenium = new WebDriverBackedSelenium(driver, baseUrl)
//selenium.open(“https://www.pagesjaunes.fr/pros/detail?bloc_id=50133457000002C0001&no_sequence=1&code_rubrique=30050400#contacterParMail”)
//selenium.click(“xpath=(.//*[normalize-space(text()) and normalize-space(.)=‘Ajouter une photo’])[1]/following::h1[1]”)

//String nomProspect = selenium.getText(“xpath=(.//*[normalize-space(text()) and normalize-space(.)=‘Ajouter une photo’])[1]/following::h1[1]”)
//String nomProspect = WebUI.getText(findTestObject(‘Pagesjaunes/Page4_RetourResultat/h1_Titre’))

//‘Write data to excel’
//sheet.createRow(0);
//sheet.getRow(1).createCell(1).setCellValue(nomProspect);
//
//file.close();
//FileOutputStream outFile =new FileOutputStream(new File(“C:\Users\33695\Desktop\EMAIL_Prospect.xlsx”));
//workbook.write(outFile);
//outFile.close();
//
WebUI.delay(3)
buttons.get(0).click()

WebUI.delay(3)

WebUI.click(findTestObject(‘Page_Mommeja Vincent SAMOREAU (adresse)/label_Votre message’))

WebUI.click(findTestObject(‘Page_Mommeja Vincent SAMOREAU (adresse)/button_Envoyer le message’))

WebUI.click(findTestObject(‘Page_Mommeja Vincent SAMOREAU (adresse)/p_Merci votre message a bien t envoy’))

WebUI.click(findTestObject(‘Page_Mommeja Vincent SAMOREAU (adresse)/i_Fermer_icon icon-fermer’))

@ouknam From your script I can’t see anything which says open atlassian.com

Whenever Katalon Studio starts the execution it will create a new session of the browser you selected without disturbing the one that you may already have open.

Let me know if my understanding is wrong ?

yes @manpreet.mukkar.
first is https://id.atlassian.com/login?continue=https%3A%2F%2Fkatalon.atlassian.net%2Flogin%3FredirectCount%3D1%26application%3Djira&application=jira

i dont’ know why i have this atlassian window
second is my siteweb test : pagesjaunes.fr

@ouknam Can you please describe the execution flow you are trying to achieve?

You said

The script is not having any code to open atlassian.com

yes and i don’t know if in the katalon setting there is an option to disable ?

@ouknam

Katalon Studio will navigate to whatever url you will give in the WebUI.navigateToUrl.

Are you sure you have pasted the full code? I don’t see anything which says WebUI.openBrowser

Katalon will throw an error for a script which doesn’t have WebUI.openBrowser

that’s why i posted about this pb.

this my beginning:
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import org.openqa.selenium.By as By
import org.openqa.selenium.WebDriver as WebDriver
import org.openqa.selenium.WebElement as WebElement

import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

WebUI.navigateToUrl(‘https://www.pagesjaunes.fr/’)

@ouknam I would need to see the full script, I think you are missing some part of the script. I haven’t seen anywhere in your script the WebUI.open browser command and according to my understanding, Katalon will throw an error when you will not have that statement.

Are there any desired capabilities added in the project settings?

I think the default profile is the problem :

I delete… and yes it’s good.

I don’t know why i have this profile.

may be it’s provide by the katalon sample ddt projet

Thank you @manpreet.mukkar

@ouknam Great that you were able to solve it, You continued your project within the sample project shared by Katalon. It is always best to start from the scratch project. The sample project is just for educational purpose.