How to get the value of one label field into another page in selenium automationHow do I call one constructor from another in Java?How to get an enum value from a string value in Java?How to get the last value of an ArrayListHow do I determine whether an array contains a particular value in Java?How to read the value of a private field from a different class in Java?Java Hashmap: How to get key from value?How to initialize HashSet values by construction?How to pass an object from one activity to another on AndroidHow to get the current date/time in JavaHow to tell Jackson to ignore a field during serialization if its value is null?

I do not have power to all my breakers

Project Euler, problem # 9, Pythagorean triplet

Why doesn't Anakin's lightsaber explode when it's chopped in half on Geonosis?

Why is dry soil hydrophobic? Bad gardener paradox

writting to disk and compress with xz at the same time

How can I legally visit the United States Minor Outlying Islands in the Pacific?

Is `curl something | sudo bash -` a reasonably safe installation method?

Why does the trade federation become so alarmed upon learning the ambassadors are Jedi Knights?

Is it rude to tell recruiters I would only change jobs for a better salary?

Adding a vertical line at the right end of the horizontal line in frac

Why do mean value theorems have open interval for differentiablity while closed for continuity?

What is the closed form of the following recursive function?

Are there any double stars that I can actually see orbit each other?

What is this old "lemon-squeezer" shaped pan

Can a continent naturally split into two distant parts within a week?

What caused Windows ME's terrible reputation?

Is killing off one of my queer characters homophobic?

Are lithium batteries allowed in the International Space Station?

How long do Apple retain notifications to be pushed to iOS devices until they expire?

What is the standard dungeon scale at the table?

Why does a small sanhedrin have 23 judges rather than 21?

Why does the Earth have a z-component at the start of the J2000 epoch?

Why didn't Al Powell investigate the lights at the top of the building?

Postgresql numeric and decimal is automatically rounding off



How to get the value of one label field into another page in selenium automation


How do I call one constructor from another in Java?How to get an enum value from a string value in Java?How to get the last value of an ArrayListHow do I determine whether an array contains a particular value in Java?How to read the value of a private field from a different class in Java?Java Hashmap: How to get key from value?How to initialize HashSet values by construction?How to pass an object from one activity to another on AndroidHow to get the current date/time in JavaHow to tell Jackson to ignore a field during serialization if its value is null?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I need value of a label field set in a pom class into another another class.How will i acheive this.



value is storing in orderid.I need to use this order id in another pom class for automationg another test case.Kindly llok into this.



public void AddSalesOrder() throws InterruptedException 
try
wait.until(ExpectedConditions.titleIs("Sales Order"));
salesOrder.click();
Thread.sleep(2000);
String js1 = "arguments[0].style.display='block';arguments[0].click();";
js.executeScript(js1, customerName);
Select select = new Select(customerName);
select.selectByVisibleText("LLH HOSPITAL AL MUSSAFAH LLC");
if (blockAlert.isDisplayed())
blockAlert.click();

for (int i = 0; i <= 6; i++)
r.executeScript("window.scrollBy(0,100)");
Thread.sleep(300);

wait.until(ExpectedConditions.visibilityOf(itemNameSelect));
itemNameSelect.click();
String js2 = "arguments[0].style.display='block';arguments[0].click();";
js.executeScript(js2, baseUOM);
wait.until(ExpectedConditions.visibilityOf(mattresSelect));
mattresSelect.click();
Select sel=new Select(baseUOM);
sel.selectByVisibleText("PCS");
Thread.sleep(2000);
blockAlert.click();
quantity.sendKeys("1");
addItem.click();
Thread.sleep(6000);
String netAmtRec=totAmt.getText();
saveButton.click();
Thread.sleep(3000);
wait.until(ExpectedConditions.visibilityOf(blockAlert));
blockAlert.click();
Thread.sleep(6000);
WebElement netAmt=driver.findElement(By.xpath("//table[@id='tableId']//tbody/tr[1]/td[5]"));
String netAmtRec2=netAmt.getText();
WebElement orderIdRec=driver.findElement(By.xpath("//table[@id='tableId']//tbody/tr[1]/td[2]"));
orderid=orderIdRec.getText();
System.out.println("orderid2"+orderid);
if(netAmtRec.equals(netAmtRec2))

Reporter.log("Sales Order Saved succesfully", true);
Reporter.log("showed Net Amount is matching with listed Amount as"+netAmtRec, true);

Assert.assertEquals(netAmtRec, netAmtRec2, "Test case Passed");

Thread.sleep(4000);
catch (Exception e)
e.printStackTrace();






i need this order id in another method in another pom class as below.



public void AddDeliveryNote() throws InterruptedException 
try
wait.until(ExpectedConditions.titleIs("Delivery Note"));
Thread.sleep(2000);
String js1 = "arguments[0].style.display='block';arguments[0].click();";
js.executeScript(js1, customerName);
Select select = new Select(customerName);
select.selectByVisibleText("LLH HOSPITAL AL MUSSAFAH LLC");
if (blockAlert.isDisplayed())
blockAlert.click();

SalesOrder order=new SalesOrder(driver);
String newOrderId=order.returnOrderId();
System.out.println(newOrderId);enter code here
salesID.sendKeys(newOrderId);
catch (Exception e)
e.printStackTrace();












share|improve this question
























  • Well you can return this value and invoke this method in another when you want your orderId. Or you can make a class variable then you can take it wherever you want inside this class

    – Rafał Sokalski
    Mar 26 at 6:27

















1















I need value of a label field set in a pom class into another another class.How will i acheive this.



value is storing in orderid.I need to use this order id in another pom class for automationg another test case.Kindly llok into this.



public void AddSalesOrder() throws InterruptedException 
try
wait.until(ExpectedConditions.titleIs("Sales Order"));
salesOrder.click();
Thread.sleep(2000);
String js1 = "arguments[0].style.display='block';arguments[0].click();";
js.executeScript(js1, customerName);
Select select = new Select(customerName);
select.selectByVisibleText("LLH HOSPITAL AL MUSSAFAH LLC");
if (blockAlert.isDisplayed())
blockAlert.click();

for (int i = 0; i <= 6; i++)
r.executeScript("window.scrollBy(0,100)");
Thread.sleep(300);

wait.until(ExpectedConditions.visibilityOf(itemNameSelect));
itemNameSelect.click();
String js2 = "arguments[0].style.display='block';arguments[0].click();";
js.executeScript(js2, baseUOM);
wait.until(ExpectedConditions.visibilityOf(mattresSelect));
mattresSelect.click();
Select sel=new Select(baseUOM);
sel.selectByVisibleText("PCS");
Thread.sleep(2000);
blockAlert.click();
quantity.sendKeys("1");
addItem.click();
Thread.sleep(6000);
String netAmtRec=totAmt.getText();
saveButton.click();
Thread.sleep(3000);
wait.until(ExpectedConditions.visibilityOf(blockAlert));
blockAlert.click();
Thread.sleep(6000);
WebElement netAmt=driver.findElement(By.xpath("//table[@id='tableId']//tbody/tr[1]/td[5]"));
String netAmtRec2=netAmt.getText();
WebElement orderIdRec=driver.findElement(By.xpath("//table[@id='tableId']//tbody/tr[1]/td[2]"));
orderid=orderIdRec.getText();
System.out.println("orderid2"+orderid);
if(netAmtRec.equals(netAmtRec2))

Reporter.log("Sales Order Saved succesfully", true);
Reporter.log("showed Net Amount is matching with listed Amount as"+netAmtRec, true);

Assert.assertEquals(netAmtRec, netAmtRec2, "Test case Passed");

Thread.sleep(4000);
catch (Exception e)
e.printStackTrace();






i need this order id in another method in another pom class as below.



public void AddDeliveryNote() throws InterruptedException 
try
wait.until(ExpectedConditions.titleIs("Delivery Note"));
Thread.sleep(2000);
String js1 = "arguments[0].style.display='block';arguments[0].click();";
js.executeScript(js1, customerName);
Select select = new Select(customerName);
select.selectByVisibleText("LLH HOSPITAL AL MUSSAFAH LLC");
if (blockAlert.isDisplayed())
blockAlert.click();

SalesOrder order=new SalesOrder(driver);
String newOrderId=order.returnOrderId();
System.out.println(newOrderId);enter code here
salesID.sendKeys(newOrderId);
catch (Exception e)
e.printStackTrace();












share|improve this question
























  • Well you can return this value and invoke this method in another when you want your orderId. Or you can make a class variable then you can take it wherever you want inside this class

    – Rafał Sokalski
    Mar 26 at 6:27













1












1








1








I need value of a label field set in a pom class into another another class.How will i acheive this.



value is storing in orderid.I need to use this order id in another pom class for automationg another test case.Kindly llok into this.



public void AddSalesOrder() throws InterruptedException 
try
wait.until(ExpectedConditions.titleIs("Sales Order"));
salesOrder.click();
Thread.sleep(2000);
String js1 = "arguments[0].style.display='block';arguments[0].click();";
js.executeScript(js1, customerName);
Select select = new Select(customerName);
select.selectByVisibleText("LLH HOSPITAL AL MUSSAFAH LLC");
if (blockAlert.isDisplayed())
blockAlert.click();

for (int i = 0; i <= 6; i++)
r.executeScript("window.scrollBy(0,100)");
Thread.sleep(300);

wait.until(ExpectedConditions.visibilityOf(itemNameSelect));
itemNameSelect.click();
String js2 = "arguments[0].style.display='block';arguments[0].click();";
js.executeScript(js2, baseUOM);
wait.until(ExpectedConditions.visibilityOf(mattresSelect));
mattresSelect.click();
Select sel=new Select(baseUOM);
sel.selectByVisibleText("PCS");
Thread.sleep(2000);
blockAlert.click();
quantity.sendKeys("1");
addItem.click();
Thread.sleep(6000);
String netAmtRec=totAmt.getText();
saveButton.click();
Thread.sleep(3000);
wait.until(ExpectedConditions.visibilityOf(blockAlert));
blockAlert.click();
Thread.sleep(6000);
WebElement netAmt=driver.findElement(By.xpath("//table[@id='tableId']//tbody/tr[1]/td[5]"));
String netAmtRec2=netAmt.getText();
WebElement orderIdRec=driver.findElement(By.xpath("//table[@id='tableId']//tbody/tr[1]/td[2]"));
orderid=orderIdRec.getText();
System.out.println("orderid2"+orderid);
if(netAmtRec.equals(netAmtRec2))

Reporter.log("Sales Order Saved succesfully", true);
Reporter.log("showed Net Amount is matching with listed Amount as"+netAmtRec, true);

Assert.assertEquals(netAmtRec, netAmtRec2, "Test case Passed");

Thread.sleep(4000);
catch (Exception e)
e.printStackTrace();






i need this order id in another method in another pom class as below.



public void AddDeliveryNote() throws InterruptedException 
try
wait.until(ExpectedConditions.titleIs("Delivery Note"));
Thread.sleep(2000);
String js1 = "arguments[0].style.display='block';arguments[0].click();";
js.executeScript(js1, customerName);
Select select = new Select(customerName);
select.selectByVisibleText("LLH HOSPITAL AL MUSSAFAH LLC");
if (blockAlert.isDisplayed())
blockAlert.click();

SalesOrder order=new SalesOrder(driver);
String newOrderId=order.returnOrderId();
System.out.println(newOrderId);enter code here
salesID.sendKeys(newOrderId);
catch (Exception e)
e.printStackTrace();












share|improve this question
















I need value of a label field set in a pom class into another another class.How will i acheive this.



value is storing in orderid.I need to use this order id in another pom class for automationg another test case.Kindly llok into this.



public void AddSalesOrder() throws InterruptedException 
try
wait.until(ExpectedConditions.titleIs("Sales Order"));
salesOrder.click();
Thread.sleep(2000);
String js1 = "arguments[0].style.display='block';arguments[0].click();";
js.executeScript(js1, customerName);
Select select = new Select(customerName);
select.selectByVisibleText("LLH HOSPITAL AL MUSSAFAH LLC");
if (blockAlert.isDisplayed())
blockAlert.click();

for (int i = 0; i <= 6; i++)
r.executeScript("window.scrollBy(0,100)");
Thread.sleep(300);

wait.until(ExpectedConditions.visibilityOf(itemNameSelect));
itemNameSelect.click();
String js2 = "arguments[0].style.display='block';arguments[0].click();";
js.executeScript(js2, baseUOM);
wait.until(ExpectedConditions.visibilityOf(mattresSelect));
mattresSelect.click();
Select sel=new Select(baseUOM);
sel.selectByVisibleText("PCS");
Thread.sleep(2000);
blockAlert.click();
quantity.sendKeys("1");
addItem.click();
Thread.sleep(6000);
String netAmtRec=totAmt.getText();
saveButton.click();
Thread.sleep(3000);
wait.until(ExpectedConditions.visibilityOf(blockAlert));
blockAlert.click();
Thread.sleep(6000);
WebElement netAmt=driver.findElement(By.xpath("//table[@id='tableId']//tbody/tr[1]/td[5]"));
String netAmtRec2=netAmt.getText();
WebElement orderIdRec=driver.findElement(By.xpath("//table[@id='tableId']//tbody/tr[1]/td[2]"));
orderid=orderIdRec.getText();
System.out.println("orderid2"+orderid);
if(netAmtRec.equals(netAmtRec2))

Reporter.log("Sales Order Saved succesfully", true);
Reporter.log("showed Net Amount is matching with listed Amount as"+netAmtRec, true);

Assert.assertEquals(netAmtRec, netAmtRec2, "Test case Passed");

Thread.sleep(4000);
catch (Exception e)
e.printStackTrace();






i need this order id in another method in another pom class as below.



public void AddDeliveryNote() throws InterruptedException 
try
wait.until(ExpectedConditions.titleIs("Delivery Note"));
Thread.sleep(2000);
String js1 = "arguments[0].style.display='block';arguments[0].click();";
js.executeScript(js1, customerName);
Select select = new Select(customerName);
select.selectByVisibleText("LLH HOSPITAL AL MUSSAFAH LLC");
if (blockAlert.isDisplayed())
blockAlert.click();

SalesOrder order=new SalesOrder(driver);
String newOrderId=order.returnOrderId();
System.out.println(newOrderId);enter code here
salesID.sendKeys(newOrderId);
catch (Exception e)
e.printStackTrace();









java






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 26 at 6:25







Arun

















asked Mar 26 at 6:22









ArunArun

83 bronze badges




83 bronze badges












  • Well you can return this value and invoke this method in another when you want your orderId. Or you can make a class variable then you can take it wherever you want inside this class

    – Rafał Sokalski
    Mar 26 at 6:27

















  • Well you can return this value and invoke this method in another when you want your orderId. Or you can make a class variable then you can take it wherever you want inside this class

    – Rafał Sokalski
    Mar 26 at 6:27
















Well you can return this value and invoke this method in another when you want your orderId. Or you can make a class variable then you can take it wherever you want inside this class

– Rafał Sokalski
Mar 26 at 6:27





Well you can return this value and invoke this method in another when you want your orderId. Or you can make a class variable then you can take it wherever you want inside this class

– Rafał Sokalski
Mar 26 at 6:27












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55350944%2fhow-to-get-the-value-of-one-label-field-into-another-page-in-selenium-automation%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55350944%2fhow-to-get-the-value-of-one-label-field-into-another-page-in-selenium-automation%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현